# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pendulum.fullname" . }}-pendulum
  labels:
  {{- include "pendulum.labels" . | nindent 4 }}
data:
  ADJOINING: {{ .Values.pendulum.adjoining | quote }}
  EAST_GROVE_BIRDBATH: {{ .Values.pendulum.eastGroveBirdbath | quote }}
  GROW_FERRYBOAT: {{ .Values.pendulum.growFerryboat | quote }}
  ROB_DIVING: {{ .Values.pendulum.robDiving | quote }}
  SHOE-HORN: {{ .Values.pendulum.shoeHorn | quote }}
  SPELT_YURT: {{ .Values.pendulum.speltYurt | quote }}
  TOTE: {{ .Values.pendulum.tote | quote }}
  TRACKSUIT_CAPTION: {{ .Values.pendulum.tracksuitCaption | quote }}
  UNEVEN: {{ .Values.pendulum.uneven | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pendulum.fullname" . }}-pendulum
  labels:
  {{- include "pendulum.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pendulum
spec:
  replicas: {{ .Values.pendulum.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pendulum
      app.kubernetes.io/name: permafrost
    {{- include "pendulum.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pendulum
        app.kubernetes.io/name: permafrost
      {{- include "pendulum.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3c98492cc3e7db5ceb70e8964b2681ccf0d00bdca746910633d40be41c855027
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pendulum.fullname" . }}-pendulum
        image: {{ .Values.pendulum.pendulum.image.repository }}:{{ .Values.pendulum.pendulum.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pendulum.pendulum.imagePullPolicy }}
        name: pendulum
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pendulum.pendulum.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pendulum.pendulum.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pendulum.fullname" . }}-pendulum
  labels:
  {{- include "pendulum.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pendulum.type }}
  selector:
    app.kubernetes.io/instance: pendulum
    app.kubernetes.io/name: permafrost
  {{- include "pendulum.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pendulum.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pendulum:
  adjoining: hay
  eastGroveBirdbath: citizenship
  growFerryboat: step-uncle
  pendulum:
    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
  replicas: 1
  robDiving: revelation
  shoeHorn: worth
  speltYurt: e-mail
  tote: march
  tracksuitCaption: fiction
  type: ClusterIP
  uneven: numeracy
