# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "calibre.fullname" . }}-calibre
  labels:
  {{- include "calibre.labels" . | nindent 4 }}
data:
  MEND_COMPARE_ARMAMENT: {{ .Values.calibre.mendCompareArmament | quote }}
  PREGNANCY_SOUVENIR_HELPLESS: {{ .Values.calibre.pregnancySouvenirHelpless | quote
    }}
  PREMEDITATION_WOK: {{ .Values.calibre.premeditationWok | quote }}
  UPWARD_DROWN_TRY: {{ .Values.calibre.upwardDrownTry | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "calibre.fullname" . }}-calibre
  labels:
  {{- include "calibre.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: calibre
spec:
  replicas: {{ .Values.calibre.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: calibre
      app.kubernetes.io/name: owner
    {{- include "calibre.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: calibre
        app.kubernetes.io/name: owner
      {{- include "calibre.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 41232455fdd38ed1343418511540f6c9d706b6dbea992b4dc422f33d00f859d8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "calibre.fullname" . }}-calibre
        image: {{ .Values.calibre.calibre.image.repository }}:{{ .Values.calibre.calibre.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.calibre.calibre.imagePullPolicy }}
        name: calibre
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.calibre.calibre.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.calibre.calibre.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "calibre.fullname" . }}-calibre
  labels:
  {{- include "calibre.labels" . | nindent 4 }}
spec:
  type: {{ .Values.calibre.type }}
  selector:
    app.kubernetes.io/instance: calibre
    app.kubernetes.io/name: owner
  {{- include "calibre.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.calibre.ports | toYaml | nindent 2 -}}
calibre:
  calibre:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  mendCompareArmament: joy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pregnancySouvenirHelpless: t-shirt
  premeditationWok: maggot
  replicas: 1
  type: ClusterIP
  upwardDrownTry: cornerstone
kubernetesClusterDomain: cluster.local
