yaml文件实例:nginx+ingress
[root@lab3 nginx]# cat nginx-test.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: http-test-dm2 spec: replicas: 1 template: metadata: labels: name: http-test-dm2 spec: containers: - name: http-test-con image: nginx:alpine imagePullPolicy: Never ports: - containerPort: 80 --- apiVersion: v1 kind: Service metadata: name: http-nginx-ser spec: type: NodePort ports: - port: 80 nodePort: 31000 targetPort: 80 selector: name: http-test-dm2 --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: grafana spec: rules: - host: www.nginx2.com http: paths: - path: / backend: serviceName: http-nginx-ser servicePort: 80