# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "regime.fullname" . }}-regime
  labels:
  {{- include "regime.labels" . | nindent 4 }}
data:
  CENTER_RESOURCE_BREAKFAST: {{ .Values.regime.centerResourceBreakfast | quote }}
  DANDELION_COP: {{ .Values.regime.dandelionCop | quote }}
  HASTE: {{ .Values.regime.haste | quote }}
  INDEPENDENCE_TEMPERATURE: {{ .Values.regime.independenceTemperature | quote }}
  MALNUTRITION: {{ .Values.regime.malnutrition | quote }}
  MISSPELL_ENTHUSIASM_TYPE: {{ .Values.regime.misspellEnthusiasmType | quote }}
  PLEAT_CRANBERRY: {{ .Values.regime.pleatCranberry | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "regime.fullname" . }}-regime
  labels:
  {{- include "regime.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: regime
spec:
  replicas: {{ .Values.regime.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: regime
      app.kubernetes.io/name: shackle
    {{- include "regime.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: regime
        app.kubernetes.io/name: shackle
      {{- include "regime.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6bdb125dcdbea55ebae9135e099175020b46f748f6666dc8592b1f322ded1d39
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "regime.fullname" . }}-regime
        image: {{ .Values.regime.regime.image.repository }}:{{ .Values.regime.regime.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.regime.regime.imagePullPolicy }}
        name: regime
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.regime.regime.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.regime.regime.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "regime.fullname" . }}-regime
  labels:
  {{- include "regime.labels" . | nindent 4 }}
spec:
  type: {{ .Values.regime.type }}
  selector:
    app.kubernetes.io/instance: regime
    app.kubernetes.io/name: shackle
  {{- include "regime.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.regime.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
regime:
  centerResourceBreakfast: resonant
  dandelionCop: agreement
  haste: barrel
  independenceTemperature: led
  malnutrition: pouch
  misspellEnthusiasmType: ambition
  pleatCranberry: sale
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  regime:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  type: ClusterIP
