1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| vim nginx-deploy.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment namespace: nginx spec: selector: matchLabels: app: nginx replicas: 3 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:alpine ports: - containerPort: 80 volumeMounts: - mountPath: /etc/localtime name: c-v-path - mountPath: /etc/nginx/conf.d name: c-v-path-ng restartPolicy: Always volumes: - hostPath: path: /etc/localtime type: '' name: c-v-path - hostPath: path: /root/opt/k8s/nginx-yaml/nginx-conf type: '' name: c-v-path-ng
|