# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cushion.fullname" . }}-cushion
  labels:
  {{- include "cushion.labels" . | nindent 4 }}
data:
  COLT_ABANDONED_MESSAGE: {{ .Values.cushion.coltAbandonedMessage | quote }}
  CONSOLE_WORTH_WIRING: {{ .Values.cushion.consoleWorthWiring | quote }}
  CYTOPLASM: {{ .Values.cushion.cytoplasm | quote }}
  FLUTE_STORAGE: {{ .Values.cushion.fluteStorage | quote }}
  INTEGRAL_RHETORICAL: {{ .Values.cushion.integralRhetorical | quote }}
  LISTING_FIGURINE_COOING: {{ .Values.cushion.listingFigurineCooing | quote }}
  SCISSORS_TAMBOURINE: {{ .Values.cushion.scissorsTambourine | quote }}
  STRONG: {{ .Values.cushion.strong | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cushion.fullname" . }}-cushion
  labels:
  {{- include "cushion.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cushion
spec:
  replicas: {{ .Values.cushion.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cushion
      app.kubernetes.io/name: payment
    {{- include "cushion.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cushion
        app.kubernetes.io/name: payment
      {{- include "cushion.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ed89af162fa1b755d45680c3e17cc7041411fb945aa8a4fc4f17115924e5ebb1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cushion.fullname" . }}-cushion
        image: {{ .Values.cushion.cushion.image.repository }}:{{ .Values.cushion.cushion.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cushion.cushion.imagePullPolicy }}
        name: cushion
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cushion.cushion.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cushion.cushion.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cushion.fullname" . }}-cushion
  labels:
  {{- include "cushion.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cushion.type }}
  selector:
    app.kubernetes.io/instance: cushion
    app.kubernetes.io/name: payment
  {{- include "cushion.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cushion.ports | toYaml | nindent 2 -}}
cushion:
  coltAbandonedMessage: hummus
  consoleWorthWiring: corporal
  cushion:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  cytoplasm: fetus
  fluteStorage: hushed
  integralRhetorical: celery
  listingFigurineCooing: angiosperm
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scissorsTambourine: loquat
  strong: surfboard
  type: ClusterIP
kubernetesClusterDomain: cluster.local
