# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "capacity.fullname" . }}-capacity
  labels:
  {{- include "capacity.labels" . | nindent 4 }}
data:
  BEGINNER_ALIVE: {{ .Values.capacity.beginnerAlive | quote }}
  BILLION: {{ .Values.capacity.billion | quote }}
  COLONY_MEDICATION_CYMBAL: {{ .Values.capacity.colonyMedicationCymbal | quote }}
  HARBOUR_REACTION: {{ .Values.capacity.harbourReaction | quote }}
  IGLOO_FREON_DRAG: {{ .Values.capacity.iglooFreonDrag | quote }}
  LEAGUE_UNDERSTATEMENT_PELICAN: {{ .Values.capacity.leagueUnderstatementPelican
    | quote }}
  PARAMECIUM_POSTBOX_CONDOMINIUM: {{ .Values.capacity.parameciumPostboxCondominium
    | quote }}
  STICK_TATAMI: {{ .Values.capacity.stickTatami | quote }}
  TANDEM: {{ .Values.capacity.tandem | quote }}
  TRACKSUIT_ADJECTIVE_STURGEON: {{ .Values.capacity.tracksuitAdjectiveSturgeon |
    quote }}
  WANT_DIPLOMA: {{ .Values.capacity.wantDiploma | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "capacity.fullname" . }}-capacity
  labels:
  {{- include "capacity.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: capacity
spec:
  replicas: {{ .Values.capacity.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: capacity
      app.kubernetes.io/name: someplace
    {{- include "capacity.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: capacity
        app.kubernetes.io/name: someplace
      {{- include "capacity.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3c4d38378163f2602da0a205dcb90c45cb4c527b73c3b41282d5b5a303e4e917
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "capacity.fullname" . }}-capacity
        image: {{ .Values.capacity.capacity.image.repository }}:{{ .Values.capacity.capacity.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.capacity.capacity.imagePullPolicy }}
        name: capacity
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.capacity.capacity.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.capacity.capacity.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "capacity.fullname" . }}-capacity
  labels:
  {{- include "capacity.labels" . | nindent 4 }}
spec:
  type: {{ .Values.capacity.type }}
  selector:
    app.kubernetes.io/instance: capacity
    app.kubernetes.io/name: someplace
  {{- include "capacity.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.capacity.ports | toYaml | nindent 2 -}}
capacity:
  beginnerAlive: skywalk
  billion: comb
  capacity:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  colonyMedicationCymbal: matter
  harbourReaction: nutty
  iglooFreonDrag: obsidian
  leagueUnderstatementPelican: science
  parameciumPostboxCondominium: personnel
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  stickTatami: watchmaker
  tandem: rally
  tracksuitAdjectiveSturgeon: pocket
  type: ClusterIP
  wantDiploma: justification
kubernetesClusterDomain: cluster.local
