# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "vein.fullname" . }}-vein
  labels:
  {{- include "vein.labels" . | nindent 4 }}
data:
  MORALE_FANTASTIC: {{ .Values.vein.moraleFantastic | quote }}
  SPECTACULAR: {{ .Values.vein.spectacular | quote }}
  TESTY_BICYCLE_DILIGENT: {{ .Values.vein.testyBicycleDiligent | quote }}
  TORSO_DAFFODIL: {{ .Values.vein.torsoDaffodil | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "vein.fullname" . }}-vein
  labels:
  {{- include "vein.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: vein
spec:
  replicas: {{ .Values.vein.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: vein
      app.kubernetes.io/name: moth
    {{- include "vein.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: vein
        app.kubernetes.io/name: moth
      {{- include "vein.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1a8650aa90456b20e4810cc7c544af97abb41a067a41be72a990119a0e0649b8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "vein.fullname" . }}-vein
        image: {{ .Values.vein.vein.image.repository }}:{{ .Values.vein.vein.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.vein.vein.imagePullPolicy }}
        name: vein
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.vein.vein.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.vein.vein.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "vein.fullname" . }}-vein
  labels:
  {{- include "vein.labels" . | nindent 4 }}
spec:
  type: {{ .Values.vein.type }}
  selector:
    app.kubernetes.io/instance: vein
    app.kubernetes.io/name: moth
  {{- include "vein.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.vein.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
vein:
  moraleFantastic: rightful
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  spectacular: cup
  testyBicycleDiligent: attic
  torsoDaffodil: urge
  type: ClusterIP
  vein:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
