apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring-cloud-kubernetes-k8s-client-reload
spec:
  selector:
    matchLabels:
      app: spring-cloud-kubernetes-k8s-client-reload
  template:
    metadata:
      labels:
        app: spring-cloud-kubernetes-k8s-client-reload
    spec:
      serviceAccountName: spring-cloud-kubernetes-serviceaccount
      containers:
        - name: spring-cloud-kubernetes-k8s-client-reload
          image: docker.io/springcloud/spring-cloud-kubernetes-k8s-client-reload
          imagePullPolicy: IfNotPresent
          readinessProbe:
            httpGet:
              port: 8080
              path: /actuator/health/readiness
          livenessProbe:
            httpGet:
              port: 8080
              path: /actuator/health/liveness
          ports:
            - containerPort: 8080
          env:
            - name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_KUBERNETES_CLIENT_CONFIG_RELOAD
              value: DEBUG
            - name: SPRING_PROFILES_ACTIVE
              value: "with-bootstrap"
            - name: SPRING_CLOUD_BOOTSTRAP_ENABLED
              value: "TRUE"
            - name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_KUBERNETES_COMMONS
              value: DEBUG

          volumeMounts:
            - mountPath: /tmp
              name: "secret-volume"
              readOnly: true

      volumes:
        - name: "secret-volume"
          secret:
            defaultMode: 420
            secretName: secret-reload
