apiVersion: v1
kind: Service
metadata:
  name: {{k3sApp}}-{{k3sEnv}}-svc
  namespace: {{k3sNamespace}}
spec:
  type: NodePort
  selector:
    app: {{k3sApp}}-{{k3sEnv}}
  ports:
    - name: http
      nodePort: {{k3sport}}
      port: 80
      targetPort: 80

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{k3sApp}}-{{k3sEnv}}
  namespace: {{k3sNamespace}}
spec:
  replicas: 2
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: {{k3sApp}}-{{k3sEnv}}
  template:
    metadata:
      labels:
        app: {{k3sApp}}-{{k3sEnv}}
        delpoymentDate: "{{replaceMe}}"
    spec:
      containers:
        - name: {{k3sApp}}-{{k3sEnv}}
          image: 192.168.195.195:30000/{{k3sApp}}:{{k3sEnv}}
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 80
          readinessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5
            successThreshold: 1