# app-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: app-web spec: selector: matchLabels: app: app-web-v1 replicas: 3 template: metadata: labels: app: app-web-v1 spec: containers: - name: myapp image: zzzwangjun/apps:v1 ports: - containerPort: 80
# app-svc.yaml apiVersion: v1 kind: Service metadata: name: app-svc spec: selector: app: app-web-v1 ports: - protocol: TCP port: 8200 targetPort: 80
Ingress Ningx 官網html
kubectl create -f mandatory.yaml
# service-nodeport.yaml apiVersion: v1 kind: Service metadata: name: ingress-nginx namespace: ingress-nginx labels: app.kubernetes.io/name: ingress-nginx app.kubernetes.io/part-of: ingress-nginx spec: type: NodePort ports: - name: http port: 80 targetPort: 80 protocol: TCP - name: https port: 443 targetPort: 443 protocol: TCP selector: app.kubernetes.io/name: ingress-nginx app.kubernetes.io/part-of: ingress-nginx