# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bedrock.fullname" . }}-bedrock
  labels:
  {{- include "bedrock.labels" . | nindent 4 }}
data:
  BOTHER_SHAKEDOWN_TAVERN: {{ .Values.bedrock.botherShakedownTavern | quote }}
  CRAYFISH: {{ .Values.bedrock.crayfish | quote }}
  DEDUCE_PROVIDE: {{ .Values.bedrock.deduceProvide | quote }}
  DRAB: {{ .Values.bedrock.drab | quote }}
  INTEGRATE: {{ .Values.bedrock.integrate | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bedrock.fullname" . }}-bedrock
  labels:
  {{- include "bedrock.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bedrock
spec:
  replicas: {{ .Values.bedrock.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bedrock
      app.kubernetes.io/name: bellows
    {{- include "bedrock.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bedrock
        app.kubernetes.io/name: bellows
      {{- include "bedrock.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e8a513b4db171a99692024322bc11149c0ee5474827d81f46d7ae0944e19a3fa
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bedrock.fullname" . }}-bedrock
        image: {{ .Values.bedrock.bedrock.image.repository }}:{{ .Values.bedrock.bedrock.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bedrock.bedrock.imagePullPolicy }}
        name: bedrock
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bedrock.bedrock.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bedrock.bedrock.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bedrock.fullname" . }}-bedrock
  labels:
  {{- include "bedrock.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bedrock.type }}
  selector:
    app.kubernetes.io/instance: bedrock
    app.kubernetes.io/name: bellows
  {{- include "bedrock.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bedrock.ports | toYaml | nindent 2 -}}
bedrock:
  bedrock:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  botherShakedownTavern: cartel
  crayfish: think
  deduceProvide: cymbal
  drab: chemistry
  integrate: crime
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
