48 lines
911 B
YAML
48 lines
911 B
YAML
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: eshop
|
||
|
component: frontend
|
||
|
name: frontend
|
||
|
spec:
|
||
|
ports:
|
||
|
- port: 80
|
||
|
targetPort: 8080
|
||
|
selector:
|
||
|
app: eshop
|
||
|
component: frontend
|
||
|
type: LoadBalancer
|
||
|
---
|
||
|
apiVersion: extensions/v1beta1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: frontend
|
||
|
spec:
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: eshop
|
||
|
component: frontend
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: nginx
|
||
|
image: nginx:1.11.10-alpine
|
||
|
imagePullPolicy: IfNotPresent
|
||
|
ports:
|
||
|
- containerPort: 8080
|
||
|
lifecycle:
|
||
|
preStop:
|
||
|
exec:
|
||
|
command: ["/usr/sbin/nginx","-s","quit"]
|
||
|
volumeMounts:
|
||
|
- name: config
|
||
|
mountPath: /etc/nginx
|
||
|
volumes:
|
||
|
- name: config
|
||
|
configMap:
|
||
|
name: config-files
|
||
|
items:
|
||
|
- key: nginx-conf
|
||
|
path: nginx.conf
|