39 lines
		
	
	
		
			729 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			729 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| #
 | |
| #---
 | |
| #apiVersion: apps/v1
 | |
| #kind: Deployment
 | |
| #metadata:
 | |
| #  name: nginx-deployment
 | |
| #spec:
 | |
| #  selector:
 | |
| #    matchLabels:
 | |
| #      app: nginx-backend
 | |
| #  replicas: 2 # tells deployment to run 2 pods matching the template
 | |
| #  template:
 | |
| #    metadata:
 | |
| #      labels:
 | |
| #        app: nginx
 | |
| #    spec:
 | |
| #      containers:
 | |
| #        - name: nginx
 | |
| #          image: nginx:1.14.2
 | |
| #          ports:
 | |
| #            - containerPort: 80
 | |
| #---
 | |
| apiVersion: v1
 | |
| kind: Service
 | |
| metadata:
 | |
|   name: nginx-lb
 | |
| spec:
 | |
|   selector:
 | |
|     app: whoami-service
 | |
|   ports:
 | |
|     - port: 80 # Published port
 | |
|       targetPort: 80 # Container port
 | |
| #    - port: 443 # Published port
 | |
| #      targetPort: 443 # Container port
 | |
|   externalTrafficPolicy: Local
 | |
|   type: LoadBalancer
 | |
| #---
 | |
| 
 | 
