kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: nginx-amd64
  namespace: default
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: nginx-amd64
      labels:
        app: nginx
        nginx: active
    spec:
      nodeSelector:
        archType: amd64
        nginx: active
      
  
      hostNetwork: true
      containers:
      - name: nginx
        image: harbor.apulis.cn:8443/aiarts_v1.5.0_rc8/apulistech/nginx:1.9

        imagePullPolicy: Always   
        command: ["/home/auto-reload-nginx.sh"]
        livenessProbe:
          httpGet:
            path: /html/index.html
            port: 80
          initialDelaySeconds: 3000
          timeoutSeconds: 1
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 3
          periodSeconds: 30
          successThreshold: 1
          tcpSocket:
            port: 80
          timeoutSeconds: 10
        volumeMounts:
        - mountPath: /etc/nginx/ssl
          name: secret-volume
        - mountPath: /var/log/nginx
          name: nginx-log         
        - mountPath: /etc/nginx/conf.other
          name: configmap-volume
        - mountPath: /etc/nginx/fqdn/
          name: hostname-fqdn
        - mountPath: /etc/letsencrypt
          name: etc-letsencrpyt  
        - mountPath: /var/log/letsencrypt
          name: letsencrypt-log         
        - mountPath: /www/static
          name: www-static        
      volumes:
      - name: secret-volume
        hostPath:
          path: /etc/nginx/ssl
      - name: configmap-volume
        hostPath:
          path: /etc/nginx/conf.other
      - name: hostname-fqdn
        hostPath:
          path: /etc/nginx/fqdn/
      - name: nginx-log
        hostPath:
          path: /var/log/nginx
      - name: etc-letsencrpyt
        hostPath:
          path: /etc/letsencrypt
      - name: letsencrypt-log
        hostPath:
          path: /var/log/letsencrypt    
      - name: www-static
        hostPath:
          path: /www/static   
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists
      - key: node-role.kubernetes.io/master
        effect: NoSchedule              
