# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "shoulder.fullname" . }}-shoulder
  labels:
  {{- include "shoulder.labels" . | nindent 4 }}
data:
  COVERAGE_WEBINAR_RATING: {{ .Values.shoulder.coverageWebinarRating | quote }}
  CUSTODY: {{ .Values.shoulder.custody | quote }}
  EGG_INCREASE: {{ .Values.shoulder.eggIncrease | quote }}
  FORTNIGHT: {{ .Values.shoulder.fortnight | quote }}
  GLOOM: {{ .Values.shoulder.gloom | quote }}
  KNOWN_EAGLE_PASTURE: {{ .Values.shoulder.knownEaglePasture | quote }}
  LATTER_SMILING: {{ .Values.shoulder.latterSmiling | quote }}
  MUTE_COLT: {{ .Values.shoulder.muteColt | quote }}
  OAK: {{ .Values.shoulder.oak | quote }}
  PALACE_STRETCH: {{ .Values.shoulder.palaceStretch | quote }}
  ROCKET_PATHWAY_DOUBT: {{ .Values.shoulder.rocketPathwayDoubt | quote }}
  SCARE_SHELTER_KID: {{ .Values.shoulder.scareShelterKid | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "shoulder.fullname" . }}-shoulder
  labels:
  {{- include "shoulder.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: shoulder
spec:
  replicas: {{ .Values.shoulder.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: shoulder
      app.kubernetes.io/name: councilman
    {{- include "shoulder.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: shoulder
        app.kubernetes.io/name: councilman
      {{- include "shoulder.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 36c8c7a4eb5b420e08d7d65fef89124d276cbe749c19366c2dbe8b97c7fd679c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "shoulder.fullname" . }}-shoulder
        image: {{ .Values.shoulder.shoulder.image.repository }}:{{ .Values.shoulder.shoulder.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.shoulder.shoulder.imagePullPolicy }}
        name: shoulder
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.shoulder.shoulder.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.shoulder.shoulder.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "shoulder.fullname" . }}-shoulder
  labels:
  {{- include "shoulder.labels" . | nindent 4 }}
spec:
  type: {{ .Values.shoulder.type }}
  selector:
    app.kubernetes.io/instance: shoulder
    app.kubernetes.io/name: councilman
  {{- include "shoulder.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.shoulder.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
shoulder:
  coverageWebinarRating: lobotomy
  custody: flume
  eggIncrease: hair
  fortnight: plead
  gloom: stag
  knownEaglePasture: twister
  latterSmiling: barbecue
  muteColt: crane
  oak: wave
  palaceStretch: fierce
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rocketPathwayDoubt: ark
  scareShelterKid: soulmate
  shoulder:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
