SayMyName

Deployment, service, pvc, and ingress to deploy the saymyname v2 app.

Parameters

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myname
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 100Mi
  volumeMode: Filesystem
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: saymyname
  name: saymyname
spec:
  replicas: 3
  selector:
    matchLabels:
      app: saymyname
  template:
    metadata:
      labels:
        app: saymyname
    spec:
      containers:
      - image: sauerburger/saymyname:0.2.0
        name: saymyname
        livenessProbe:
          httpGet:
            path: /
            port: 8080
          failureThreshold: 3
          periodSeconds: 10
          initialDelaySeconds: 20
        readinessProbe:
          httpGet:
            path: /
            port: 8080
          failureThreshold: 3
          periodSeconds: 5
          initialDelaySeconds: 0
        volumeMounts:
        - mountPath: /pvc
          name: pvc-mount
      volumes:
      - name: pvc-mount
        persistentVolumeClaim:
          claimName: myname
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: pvc-inspector
  name: pvc-inspector
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pvc-inspector
  template:
    metadata:
      labels:
        app: pvc-inspector
    spec:
      containers:
      - image: alpine
        name: pvc-inspector
        command: ["tail"]
        args: ["-f", "/dev/null"]
        volumeMounts:
        - mountPath: /pvc
          name: pvc-mount
      volumes:
      - name: pvc-mount
        persistentVolumeClaim:
          claimName: myname
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata: 
  annotations:
    cert-manager.io/cluster-issuer: {{ tlsIssuer }}
  name: "saymyname-ingress"
spec:
  ingressClassName: {{ ingressClass }}
  rules:
  - host: {{ host }}
    http:
      paths:
      - path: "/"
        pathType: Prefix 
        backend:
          service:
            name: saymyname
            port:
              number: 8080
  tls:
  - hosts:
    - {{ host }}
    secretName: saymyname-tls-secret
---
apiVersion: v1
kind: Service
metadata:
  name: saymyname
spec:
  type: ClusterIP
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app: saymyname