# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "possessive.fullname" . }}-possessive
  labels:
  {{- include "possessive.labels" . | nindent 4 }}
data:
  ANGEL: {{ .Values.possessive.angel | quote }}
  BONNET_CRACKER: {{ .Values.possessive.bonnetCracker | quote }}
  HOWARD_BOW_KNOWING: {{ .Values.possessive.howardBowKnowing | quote }}
  MYCOPLASMA_TRIP: {{ .Values.possessive.mycoplasmaTrip | quote }}
  SNORER_OBSERVANT_CHINCHILLA: {{ .Values.possessive.snorerObservantChinchilla |
    quote }}
  TALL: {{ .Values.possessive.tall | quote }}
  TOUCH_ANNIVERSARY_FLIGHT: {{ .Values.possessive.touchAnniversaryFlight | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "possessive.fullname" . }}-possessive
  labels:
  {{- include "possessive.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: possessive
spec:
  replicas: {{ .Values.possessive.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: possessive
      app.kubernetes.io/name: tasty
    {{- include "possessive.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: possessive
        app.kubernetes.io/name: tasty
      {{- include "possessive.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5e1b116817e4dc06a762eb583ccf57452f73f4102fb357ed9ba3831f64586fa8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "possessive.fullname" . }}-possessive
        image: {{ .Values.possessive.possessive.image.repository }}:{{ .Values.possessive.possessive.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.possessive.possessive.imagePullPolicy }}
        name: possessive
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.possessive.possessive.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.possessive.possessive.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "possessive.fullname" . }}-possessive
  labels:
  {{- include "possessive.labels" . | nindent 4 }}
spec:
  type: {{ .Values.possessive.type }}
  selector:
    app.kubernetes.io/instance: possessive
    app.kubernetes.io/name: tasty
  {{- include "possessive.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.possessive.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
possessive:
  angel: evanescent
  bonnetCracker: moai
  howardBowKnowing: terror
  mycoplasmaTrip: instructor
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  possessive:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  snorerObservantChinchilla: glory
  tall: forehead
  touchAnniversaryFlight: supervisor
  type: ClusterIP
