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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| kind: Deployment apiVersion: extensions/v1beta1 metadata: labels: app: linux-nginx-deployment-label name: linux-nginx-deployment namespace: linux spec: replicas: 1 selector: matchLabels: app: linux-nginx-selector template: metadata: labels: app: linux-nginx-selector spec: containers: - name: linux-nginx-container image: harbor.qh.net/linux/nginx-web1:2019-05-03_18_26_52 imagePullPolicy: Always ports: - containerPort: 80 protocol: TCP name: http - containerPort: 443 protocol: TCP name: https env: - name: "password" value: "123456" - name: "age" value: "18" resources: limits: cpu: 2 memory: 2Gi requests: cpu: 500m memory: 1Gi
volumeMounts: - name: linux-images mountPath: /usr/local/nginx/html/webapp/images readOnly: false - name: linux-static mountPath: /usr/local/nginx/html/webapp/static readOnly: false volumes: - name: linux-images nfs: server: 192.168.7.108 path: /data/k8sdata/linux36/images - name: linux-static nfs: server: 192.168.7.108 path: /data/k8sdata/linux36/static
--- kind: Service apiVersion: v1 metadata: labels: app: linux-nginx-service-label name: linux-nginx-service namespace: linux spec: type: NodePort ports: - name: http port: 80 protocol: TCP targetPort: 80 nodePort: 30002 - name: https port: 443 protocol: TCP targetPort: 443 nodePort: 30443 selector: app: linux-nginx-selector
|