This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nginx-service | |
| spec: | |
| type: ClusterIP | |
| selector: | |
| app: nginx | |
| ports: | |
| - port: 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nginx-nodeport | |
| spec: | |
| type: NodePort | |
| selector: | |
| app: nginx | |
| ports: | |
| - port: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nginx-lb | |
| spec: | |
| ports: | |
| - port: 80 | |
| type: LoadBalancer | |
| selector: | |
| app: nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: ReplicaSet | |
| metadata: | |
| name: nginx-replicaset | |
| labels: | |
| app: nginx | |
| tier: web-page | |
| spec: | |
| replicas: 2 | |
| selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: nginx-deployment | |
| labels: | |
| app: nginx | |
| spec: | |
| replicas: 2 | |
| selector: | |
| matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: webapp-ingress | |
| namespace: app | |
| annotations: | |
| kubernetes.io/ingress.class: nginx | |
| nginx.ingress.kubernetes.io/ssl-redirect: "false" | |
| nginx.ingress.kubernetes.io/use-regex: "true" | |
| nginx.ingress.kubernetes.io/rewrite-target: /$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Install docker | |
| hosts: swarm_hosts | |
| become: true | |
| tasks: | |
| - name: Install pre-requisite packages | |
| yum: | |
| name: "{{item}}" | |
| state: latest | |
| loop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import request, Flask | |
| import json | |
| app1 = Flask(__name__) | |
| @app1.route('/') | |
| def hello_world(): | |
| return 'this is response from app1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import request, Flask | |
| import json | |
| app2 = Flask(__name__) | |
| @app2.route('/') | |
| def hello_world(): | |
| return 'this is response from app2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream loadbalance { | |
| server 10.154.0.4:5001; | |
| server 10.154.0.4:5002; | |
| } | |
| server { | |
| location / { | |
| proxy_pass http://loadbalance; | |
| } | |
| } |
OlderNewer