# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "iceberg.fullname" . }}-iceberg
  labels:
  {{- include "iceberg.labels" . | nindent 4 }}
data:
  AFTERSHAVE_ENERGY_PRACTITIONER: {{ .Values.iceberg.aftershaveEnergyPractitioner
    | quote }}
  CROISSANT_STEP-SON: {{ .Values.iceberg.croissantStepSon | quote }}
  FRITTER_BEAR_GRIPPER: {{ .Values.iceberg.fritterBearGripper | quote }}
  GLIB: {{ .Values.iceberg.glib | quote }}
  HAIL_SETTLER: {{ .Values.iceberg.hailSettler | quote }}
  HALLOWED_JUDGE_SHARK: {{ .Values.iceberg.hallowedJudgeShark | quote }}
  MAGNET_HOOF: {{ .Values.iceberg.magnetHoof | quote }}
  RAGE_CAT_RID: {{ .Values.iceberg.rageCatRid | quote }}
  SCHNITZEL_CLOAKROOM: {{ .Values.iceberg.schnitzelCloakroom | quote }}
  TRAIN_GEAR: {{ .Values.iceberg.trainGear | quote }}
  VACUUM: {{ .Values.iceberg.vacuum | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "iceberg.fullname" . }}-iceberg
  labels:
  {{- include "iceberg.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: iceberg
spec:
  replicas: {{ .Values.iceberg.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: iceberg
      app.kubernetes.io/name: concern
    {{- include "iceberg.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: iceberg
        app.kubernetes.io/name: concern
      {{- include "iceberg.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 96472a691b81b52474182ed563ec4623f9aabb04e227685324de72f4773a295a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "iceberg.fullname" . }}-iceberg
        image: {{ .Values.iceberg.iceberg.image.repository }}:{{ .Values.iceberg.iceberg.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.iceberg.iceberg.imagePullPolicy }}
        name: iceberg
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.iceberg.iceberg.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.iceberg.iceberg.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "iceberg.fullname" . }}-iceberg
  labels:
  {{- include "iceberg.labels" . | nindent 4 }}
spec:
  type: {{ .Values.iceberg.type }}
  selector:
    app.kubernetes.io/instance: iceberg
    app.kubernetes.io/name: concern
  {{- include "iceberg.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.iceberg.ports | toYaml | nindent 2 -}}
iceberg:
  aftershaveEnergyPractitioner: agreement
  croissantStepSon: jam
  fritterBearGripper: resist
  glib: pegboard
  hailSettler: subcomponent
  hallowedJudgeShark: bay
  iceberg:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  magnetHoof: littleneck
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rageCatRid: catalogue
  replicas: 1
  schnitzelCloakroom: sousaphone
  trainGear: state
  type: ClusterIP
  vacuum: expensive
kubernetesClusterDomain: cluster.local
