# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "poster.fullname" . }}-poster
  labels:
  {{- include "poster.labels" . | nindent 4 }}
data:
  COWBELL_PIER: {{ .Values.poster.cowbellPier | quote }}
  CROW_CONSISTENCY_BEHAVIOUR: {{ .Values.poster.crowConsistencyBehaviour | quote
    }}
  DEVELOPMENTAL: {{ .Values.poster.developmental | quote }}
  HEADLIGHT_CARTER_SUMMIT: {{ .Values.poster.headlightCarterSummit | quote }}
  INCISION_COUNSELING: {{ .Values.poster.incisionCounseling | quote }}
  PRICING_BENEFICIARY_BEGGAR: {{ .Values.poster.pricingBeneficiaryBeggar | quote
    }}
  SNAKEBITE_AUTHOR_PARKING: {{ .Values.poster.snakebiteAuthorParking | quote }}
  SUGGESTION_ITEM: {{ .Values.poster.suggestionItem | quote }}
  TSUNAMI_CONGREGATION: {{ .Values.poster.tsunamiCongregation | quote }}
  VIRTUE: {{ .Values.poster.virtue | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "poster.fullname" . }}-poster
  labels:
  {{- include "poster.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: poster
spec:
  replicas: {{ .Values.poster.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: poster
      app.kubernetes.io/name: carol
    {{- include "poster.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: poster
        app.kubernetes.io/name: carol
      {{- include "poster.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9f91799422f1df1a5be09bf678ece450d7de1ebd94325e98648704532be709e2
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "poster.fullname" . }}-poster
        image: {{ .Values.poster.poster.image.repository }}:{{ .Values.poster.poster.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.poster.poster.imagePullPolicy }}
        name: poster
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.poster.poster.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.poster.poster.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "poster.fullname" . }}-poster
  labels:
  {{- include "poster.labels" . | nindent 4 }}
spec:
  type: {{ .Values.poster.type }}
  selector:
    app.kubernetes.io/instance: poster
    app.kubernetes.io/name: carol
  {{- include "poster.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.poster.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
poster:
  cowbellPier: contrail
  crowConsistencyBehaviour: vice
  developmental: honorable
  headlightCarterSummit: electrocardiogram
  incisionCounseling: hazelnut
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  poster:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pricingBeneficiaryBeggar: mustard
  replicas: 1
  snakebiteAuthorParking: exaggeration
  suggestionItem: parka
  tsunamiCongregation: doctor
  type: ClusterIP
  virtue: moat
