apiVersion: v1
kind: Service
metadata:
  name: smokeping
  labels:
    run: smokeping
spec:
  ports:
    - name: http
      port: 80
      targetPort: 80
  selector:
    run: smokeping
      #  type: LoadBalancer
      #status:
      #  loadBalancer: {}
      ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: smokeping-data
    spec:
      capacity:
        storage: 10Ti
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain # Keep 4eva
    storageClassName: default
    mountOptions:
      - hard
    - nfsvers=3
    nfs:
      path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/smokeping-data
    server: 10.42.42.10
    claimRef:
      name: smokeping-data
    namespace: default
      ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: smokeping-data
    spec:
      storaapiVersiongeClassName: standard
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 10Ti
    status: {}
      ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: smokeping-config
    spec:
      capacity:
        storage: 5Mi
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain # Keep 4eva
    storageClassName: default
    mountOptions:
      - hard
    - nfsvers=3
    nfs:
      path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/smokeping-config
    server: 10.42.42.10
    claimRef:
      name: smokeping-config
    namespace: default
      ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: smokeping-config
    annotations:
      nfs.io/storage-path: "smokeping-config"
    spec:
      storageClassName: default
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 5Mi
    status: {}
      ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: smokeping
    spec:
      replicas: 1
    selector:
      matchLabels:
        run: smokeping
    strategy:
      type: Recreate
    template:
      metadata:
        labels:
          run: smokeping
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        - image: lscr.io/linuxserver/smokeping:latest
          imagePullPolicy: "Always"
          name: smokeping
          env:
            - name: TZ
              value: US/Michigan
          ports:
            - containerPort: 80
          resources:
            limits:
              memory: "500Mi"
              cpu: "1000m"
            requests:
              memory: "200Mi"
              cpu: "500m"
          volumeMounts:
            - mountPath: /config
              name: smokeping-config
            - mountPath: /data
              name: smokeping-data
      restartPolicy: Always
      volumes:
        - name: smokeping-config
          persistentVolumeClaim:
            claimName: smokeping-config
        - name: smokeping-data
          persistentVolumeClaim:
            claimName: smokeping-data
      dnsPolicy: "None"
      dnsConfig:
        nameservers:
          - 10.42.42.239
          - 10.42.42.1
        searches:
          - default.svc.cluster.local
          - svc.cluster.local
          - cluster.local
        options:
          - name: ndots
            value: "2"
          - name: edns0
          - name: trust-ad
    status: {}
      ---
      # Hosting
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: smokeping-ingress
    annotations:
      cert-manager.io/cluster-issuer: "letsencrypt-prod"
        ## No basic auth for smokeping
        ## type of authentication
        #nginx.ingress.kubernetes.io/auth-type: basic
        ## name of the secret that contains the user/password definitions
        #nginx.ingress.kubernetes.io/auth-secret: basic-auth
        ## message to display with an appropriate context why the authentication is required
        #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Octoprint'
      spec:
        tls:
          - hosts:
            - smokeping.monkeybox.org
      secretName: smokeping-tls
      rules:
        - host: smokeping.monkeybox.org
      http:
        paths:
          - path: /
        pathType: Prefix
        backend:
          service:
            name: smokeping
            port:
              number: 80
