# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "lazy.fullname" . }}-lazy
  labels:
  {{- include "lazy.labels" . | nindent 4 }}
data:
  ALBUM_PREVENT_ORNAMENT: {{ .Values.lazy.albumPreventOrnament | quote }}
  ASSIST: {{ .Values.lazy.assist | quote }}
  CARAMEL: {{ .Values.lazy.caramel | quote }}
  DESTINY: {{ .Values.lazy.destiny | quote }}
  REMINDER_RUNNER_ALERT: {{ .Values.lazy.reminderRunnerAlert | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "lazy.fullname" . }}-lazy
  labels:
  {{- include "lazy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: lazy
spec:
  replicas: {{ .Values.lazy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: lazy
      app.kubernetes.io/name: percentage
    {{- include "lazy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: lazy
        app.kubernetes.io/name: percentage
      {{- include "lazy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 71ee42ca21c42e4babc98ac23f0690c52ab5e32b83c1ecd60ad298b2e0707ecb
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "lazy.fullname" . }}-lazy
        image: {{ .Values.lazy.lazy.image.repository }}:{{ .Values.lazy.lazy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.lazy.lazy.imagePullPolicy }}
        name: lazy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.lazy.lazy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.lazy.lazy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "lazy.fullname" . }}-lazy
  labels:
  {{- include "lazy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.lazy.type }}
  selector:
    app.kubernetes.io/instance: lazy
    app.kubernetes.io/name: percentage
  {{- include "lazy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.lazy.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
lazy:
  albumPreventOrnament: dolman
  assist: photograph
  caramel: rejoice
  destiny: revolution
  lazy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reminderRunnerAlert: reserve
  replicas: 1
  type: ClusterIP
