apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      hostname: nginx
      hostAliases:
        - ip: "101.132.135.79"
          hostnames:
            - "api-new.westfutu.com"
            - "store-new.westfutu.com"
      containers:
        - name: nginx
          image: nginx:1.21.3
          volumeMounts:
            - name: config
              mountPath: /etc/nginx/conf.d
            - name: log
              mountPath: /var/log/nginx
            - name: www
              mountPath: /home
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
          ports:
            - containerPort: 80
              name: "http"
      volumes:
        - name: config
          nfs:
            server: 369df4abd8-qmf27.cn-shanghai.nas.aliyuncs.com
            path: "/home/NFSData/dev/nginx/config"
        - name: log
          nfs:
            server: 369df4abd8-qmf27.cn-shanghai.nas.aliyuncs.com
            path: "/home/NFSData/dev/nginx/log"
        - name: www
          nfs:
            server: 369df4abd8-qmf27.cn-shanghai.nas.aliyuncs.com
            path: "/home/NFSData/dev/nginx/www"
        - name: localtime
          hostPath:
            path: "/etc/localtime"

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: nginx
  name: nginx
spec:
  type: NodePort
  ports:
  - port: 80
    nodePort: 31080
    name: "http"
  selector:
    app: nginx

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 0m
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  generation: 1
  name: new-westfutu
  namespace: default
  resourceVersion: "22425684"
  uid: be2d582a-ff57-447b-ba16-84fd5145ad5a
spec:
  ingressClassName: nginx
  rules:
  - host: new.westfutu.com
    http:
      paths:
      - backend:
          service:
            name: nginx
            port:
              number: 80
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - new.westfutu.com
    secretName: west-secret
status:
  loadBalancer: {}