# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "crewmen.fullname" . }}-crewmen
  labels:
  {{- include "crewmen.labels" . | nindent 4 }}
data:
  CABBAGE: {{ .Values.crewmen.cabbage | quote }}
  CORE: {{ .Values.crewmen.core | quote }}
  DESIGNER_COOK: {{ .Values.crewmen.designerCook | quote }}
  DISCUSSION_CLOTHING_SESSION: {{ .Values.crewmen.discussionClothingSession | quote
    }}
  DISTORTION_SPIDER: {{ .Values.crewmen.distortionSpider | quote }}
  EMBARRASSMENT_CLOAKROOM: {{ .Values.crewmen.embarrassmentCloakroom | quote }}
  EXHAUSTION: {{ .Values.crewmen.exhaustion | quote }}
  FLOOZIE: {{ .Values.crewmen.floozie | quote }}
  FOOTAGE_PINK: {{ .Values.crewmen.footagePink | quote }}
  GOOD-BYE: {{ .Values.crewmen.goodBye | quote }}
  RIGHTFUL: {{ .Values.crewmen.rightful | quote }}
  WAD: {{ .Values.crewmen.wad | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "crewmen.fullname" . }}-crewmen
  labels:
  {{- include "crewmen.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: crewmen
spec:
  replicas: {{ .Values.crewmen.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: crewmen
      app.kubernetes.io/name: drake
    {{- include "crewmen.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: crewmen
        app.kubernetes.io/name: drake
      {{- include "crewmen.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 79754dfafaf2130622a1e8f36d3548dc244b08a4a353d174397824ba9d35c6e9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "crewmen.fullname" . }}-crewmen
        image: {{ .Values.crewmen.crewmen.image.repository }}:{{ .Values.crewmen.crewmen.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.crewmen.crewmen.imagePullPolicy }}
        name: crewmen
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.crewmen.crewmen.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.crewmen.crewmen.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "crewmen.fullname" . }}-crewmen
  labels:
  {{- include "crewmen.labels" . | nindent 4 }}
spec:
  type: {{ .Values.crewmen.type }}
  selector:
    app.kubernetes.io/instance: crewmen
    app.kubernetes.io/name: drake
  {{- include "crewmen.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.crewmen.ports | toYaml | nindent 2 -}}
crewmen:
  cabbage: tribe
  core: softening
  crewmen:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  designerCook: concert
  discussionClothingSession: poignance
  distortionSpider: supplement
  embarrassmentCloakroom: history
  exhaustion: farm
  floozie: screeching
  footagePink: typeface
  goodBye: grace
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rightful: deer
  type: ClusterIP
  wad: molar
kubernetesClusterDomain: cluster.local
