# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "reinscription.fullname" . }}-reinscription
  labels:
  {{- include "reinscription.labels" . | nindent 4 }}
data:
  GRANOLA_OVARY_FABRIC: {{ .Values.reinscription.granolaOvaryFabric | quote }}
  LIVER_FRIGHTENED_REAMER: {{ .Values.reinscription.liverFrightenedReamer | quote
    }}
  TOMATO: {{ .Values.reinscription.tomato | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "reinscription.fullname" . }}-reinscription
  labels:
  {{- include "reinscription.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: reinscription
spec:
  replicas: {{ .Values.reinscription.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: reinscription
      app.kubernetes.io/name: trowel
    {{- include "reinscription.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: reinscription
        app.kubernetes.io/name: trowel
      {{- include "reinscription.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: dda79e6800017c0e2a1845231e41c0ee726afe6120eb87f3f09111cfea8b66ee
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "reinscription.fullname" . }}-reinscription
        image: {{ .Values.reinscription.reinscription.image.repository }}:{{ .Values.reinscription.reinscription.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.reinscription.reinscription.imagePullPolicy }}
        name: reinscription
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.reinscription.reinscription.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.reinscription.reinscription.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "reinscription.fullname" . }}-reinscription
  labels:
  {{- include "reinscription.labels" . | nindent 4 }}
spec:
  type: {{ .Values.reinscription.type }}
  selector:
    app.kubernetes.io/instance: reinscription
    app.kubernetes.io/name: trowel
  {{- include "reinscription.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.reinscription.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
reinscription:
  granolaOvaryFabric: ragged
  liverFrightenedReamer: bar
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reinscription:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  tomato: headphones
  type: ClusterIP
