# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "plastic.fullname" . }}-plastic
  labels:
  {{- include "plastic.labels" . | nindent 4 }}
data:
  BLISTER: {{ .Values.plastic.blister | quote }}
  COUNSELLOR_GEM: {{ .Values.plastic.counsellorGem | quote }}
  CREATURE_SUICIDE_LEVER: {{ .Values.plastic.creatureSuicideLever | quote }}
  PRESIDE: {{ .Values.plastic.preside | quote }}
  WARREN_HALF_APPEAR: {{ .Values.plastic.warrenHalfAppear | quote }}
  WHISPERING_GRAND_DISTINCT: {{ .Values.plastic.whisperingGrandDistinct | quote }}
  ZOO_ALOOF: {{ .Values.plastic.zooAloof | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "plastic.fullname" . }}-plastic
  labels:
  {{- include "plastic.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: plastic
spec:
  replicas: {{ .Values.plastic.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: plastic
      app.kubernetes.io/name: cob
    {{- include "plastic.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: plastic
        app.kubernetes.io/name: cob
      {{- include "plastic.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f3c919ac33ddf1865f6cff2bd8c499e39b6db905541614fe580a02a592195348
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "plastic.fullname" . }}-plastic
        image: {{ .Values.plastic.plastic.image.repository }}:{{ .Values.plastic.plastic.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.plastic.plastic.imagePullPolicy }}
        name: plastic
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.plastic.plastic.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.plastic.plastic.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "plastic.fullname" . }}-plastic
  labels:
  {{- include "plastic.labels" . | nindent 4 }}
spec:
  type: {{ .Values.plastic.type }}
  selector:
    app.kubernetes.io/instance: plastic
    app.kubernetes.io/name: cob
  {{- include "plastic.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.plastic.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
plastic:
  blister: injunction
  counsellorGem: gallon
  creatureSuicideLever: compute
  plastic:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preside: facility
  replicas: 1
  type: ClusterIP
  warrenHalfAppear: clam
  whisperingGrandDistinct: die
  zooAloof: seek
