# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "composition.fullname" . }}-composition
  labels:
  {{- include "composition.labels" . | nindent 4 }}
data:
  DEVELOPING_VALUABLE: {{ .Values.composition.developingValuable | quote }}
  GLANCE_ATTRACT_POMELO: {{ .Values.composition.glanceAttractPomelo | quote }}
  ID_ABLAZE_INDUSTRY: {{ .Values.composition.idAblazeIndustry | quote }}
  ORIENTED: {{ .Values.composition.oriented | quote }}
  PANTY_PLAY_ALBATROSS: {{ .Values.composition.pantyPlayAlbatross | quote }}
  PINE: {{ .Values.composition.pine | quote }}
  RACCOON_PLATE_JOYOUS: {{ .Values.composition.raccoonPlateJoyous | quote }}
  WASABI_PRODUCTIVE_FOAM: {{ .Values.composition.wasabiProductiveFoam | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "composition.fullname" . }}-composition
  labels:
  {{- include "composition.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: composition
spec:
  replicas: {{ .Values.composition.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: composition
      app.kubernetes.io/name: punishment
    {{- include "composition.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: composition
        app.kubernetes.io/name: punishment
      {{- include "composition.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7acdd5a469cc2ddbc7d186d56be415aeeb6f97b7d941ef16b8fa017f37658480
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "composition.fullname" . }}-composition
        image: {{ .Values.composition.composition.image.repository }}:{{ .Values.composition.composition.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.composition.composition.imagePullPolicy }}
        name: composition
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.composition.composition.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.composition.composition.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "composition.fullname" . }}-composition
  labels:
  {{- include "composition.labels" . | nindent 4 }}
spec:
  type: {{ .Values.composition.type }}
  selector:
    app.kubernetes.io/instance: composition
    app.kubernetes.io/name: punishment
  {{- include "composition.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.composition.ports | toYaml | nindent 2 -}}
composition:
  composition:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  developingValuable: set
  glanceAttractPomelo: secure
  idAblazeIndustry: giggle
  oriented: commercial
  pantyPlayAlbatross: bang
  pine: counseling
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  raccoonPlateJoyous: observant
  replicas: 1
  type: ClusterIP
  wasabiProductiveFoam: guess
kubernetesClusterDomain: cluster.local
