apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: cheese
    cheese: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cheese
      task: nginx
  template:
    metadata:
      labels:
        app: cheese
        task: nginx
        version: v0.0.1
    spec:
#      hostNetwork: true
      containers:
      - name: nginx
        image: registry.aliyuncs.com/slzcc/nginx-1.11.5
        ports:
        - name: http
          containerPort: 8080
        volumeMounts:
          - mountPath: "/etc/nginx"
            name: config
      volumes:
        - hostPath:
           path: "/root/nginx"
          name: config
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  type: NodePort
  ports:
   - name: http
     port: 80
#     targetPort: 80
     nodePort: 80
     protocol: TCP
  selector:
    app: cheese
    task: nginx

