apiVersion: apps/v1 kind: Deployment metadata: labels: app: nginx name: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - image: nginx name: nginx ports: - containerPort: 80 name: http volumeMounts: - mountPath: /etc/nginx/conf.d name: nginx-config - mountPath: /usr/share/nginx/html name: nginx-html volumes: - configMap: name: nginx-config name: nginx-config - configMap: name: nginx-html name: nginx-html --- apiVersion: v1 kind: Service metadata: labels: app: nginx name: nginx spec: ports: - name: http port: 80 protocol: TCP targetPort: 80 selector: app: nginx type: ClusterIP