# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "somersault.fullname" . }}-somersault
  labels:
  {{- include "somersault.labels" . | nindent 4 }}
data:
  CONVECTION: {{ .Values.somersault.convection | quote }}
  DOWNFORCE_FINANCE_CHATEAU: {{ .Values.somersault.downforceFinanceChateau | quote
    }}
  FLEE: {{ .Values.somersault.flee | quote }}
  GOLF_THEME: {{ .Values.somersault.golfTheme | quote }}
  INCANDESCENCE_VIBE_PREJUDICE: {{ .Values.somersault.incandescenceVibePrejudice
    | quote }}
  LANE_STEP-SON: {{ .Values.somersault.laneStepSon | quote }}
  MAKEUP_NATIONALITY: {{ .Values.somersault.makeupNationality | quote }}
  MANUFACTURING: {{ .Values.somersault.manufacturing | quote }}
  OUTFIT_WRAPPING_COMPROMISE: {{ .Values.somersault.outfitWrappingCompromise | quote
    }}
  OUTRIGGER_REBOOT_INSTANT: {{ .Values.somersault.outriggerRebootInstant | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "somersault.fullname" . }}-somersault
  labels:
  {{- include "somersault.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: somersault
spec:
  replicas: {{ .Values.somersault.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: somersault
      app.kubernetes.io/name: breakdown
    {{- include "somersault.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: somersault
        app.kubernetes.io/name: breakdown
      {{- include "somersault.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: aaad940ba8460430e401109b4d758bc730ae794e2bf5c30cd83d62f998638e6c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "somersault.fullname" . }}-somersault
        image: {{ .Values.somersault.somersault.image.repository }}:{{ .Values.somersault.somersault.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.somersault.somersault.imagePullPolicy }}
        name: somersault
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.somersault.somersault.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.somersault.somersault.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "somersault.fullname" . }}-somersault
  labels:
  {{- include "somersault.labels" . | nindent 4 }}
spec:
  type: {{ .Values.somersault.type }}
  selector:
    app.kubernetes.io/instance: somersault
    app.kubernetes.io/name: breakdown
  {{- include "somersault.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.somersault.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
somersault:
  convection: republican
  downforceFinanceChateau: niche
  flee: chapter
  golfTheme: earthquake
  incandescenceVibePrejudice: heavy
  laneStepSon: bandana
  makeupNationality: yoyo
  manufacturing: interval
  outfitWrappingCompromise: setback
  outriggerRebootInstant: jungle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  somersault:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
