# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rectangle.fullname" . }}-rectangle
  labels:
  {{- include "rectangle.labels" . | nindent 4 }}
data:
  CONSULATE_CABINET_PRODUCTIVE: {{ .Values.rectangle.consulateCabinetProductive |
    quote }}
  DRAMA_STANDARDIZATION_CHEESE: {{ .Values.rectangle.dramaStandardizationCheese |
    quote }}
  FLOODPLAIN: {{ .Values.rectangle.floodplain | quote }}
  FUNDRAISING_CONVENIENCE_ILLEGAL: {{ .Values.rectangle.fundraisingConvenienceIllegal
    | quote }}
  HYDROFOIL_SABRE: {{ .Values.rectangle.hydrofoilSabre | quote }}
  LOOP_VINYL: {{ .Values.rectangle.loopVinyl | quote }}
  OFFERING: {{ .Values.rectangle.offering | quote }}
  SHRIMP_BANK: {{ .Values.rectangle.shrimpBank | quote }}
  SONATA_REMAIN: {{ .Values.rectangle.sonataRemain | quote }}
  THRUST_INCLUSION: {{ .Values.rectangle.thrustInclusion | quote }}
  TONIGHT_HAMSTER_COLLECTIVIZATION: {{ .Values.rectangle.tonightHamsterCollectivization
    | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rectangle.fullname" . }}-rectangle
  labels:
  {{- include "rectangle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rectangle
spec:
  replicas: {{ .Values.rectangle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rectangle
      app.kubernetes.io/name: digging
    {{- include "rectangle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rectangle
        app.kubernetes.io/name: digging
      {{- include "rectangle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ffae987e14999df00ce7a04ffdcaf6e8dc7e16393e8349f27a3f99c5c7639380
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rectangle.fullname" . }}-rectangle
        image: {{ .Values.rectangle.rectangle.image.repository }}:{{ .Values.rectangle.rectangle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rectangle.rectangle.imagePullPolicy }}
        name: rectangle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rectangle.rectangle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rectangle.rectangle.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rectangle.fullname" . }}-rectangle
  labels:
  {{- include "rectangle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rectangle.type }}
  selector:
    app.kubernetes.io/instance: rectangle
    app.kubernetes.io/name: digging
  {{- include "rectangle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rectangle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rectangle:
  consulateCabinetProductive: mecca
  dramaStandardizationCheese: synonymous
  floodplain: number
  fundraisingConvenienceIllegal: celeriac
  hydrofoilSabre: boxspring
  loopVinyl: marten
  offering: tank
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rectangle:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  shrimpBank: roll
  sonataRemain: balloonist
  thrustInclusion: rainmaker
  tonightHamsterCollectivization: cement
  type: ClusterIP
