# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "incision.fullname" . }}-incision
  labels:
  {{- include "incision.labels" . | nindent 4 }}
data:
  ANTICODON_MACRO_KINASE: {{ .Values.incision.anticodonMacroKinase | quote }}
  DUCKLING: {{ .Values.incision.duckling | quote }}
  HYPOTHESIS: {{ .Values.incision.hypothesis | quote }}
  MATCH: {{ .Values.incision.match | quote }}
  TYPHOON_RIP_LONG: {{ .Values.incision.typhoonRipLong | quote }}
  VINTNER_TUSK: {{ .Values.incision.vintnerTusk | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "incision.fullname" . }}-incision
  labels:
  {{- include "incision.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: incision
spec:
  replicas: {{ .Values.incision.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: incision
      app.kubernetes.io/name: pathology
    {{- include "incision.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: incision
        app.kubernetes.io/name: pathology
      {{- include "incision.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1a5ec269a7d730166e1963bd564e10914423e806d5841466e28d9b11cd90b4aa
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "incision.fullname" . }}-incision
        image: {{ .Values.incision.incision.image.repository }}:{{ .Values.incision.incision.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.incision.incision.imagePullPolicy }}
        name: incision
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.incision.incision.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.incision.incision.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "incision.fullname" . }}-incision
  labels:
  {{- include "incision.labels" . | nindent 4 }}
spec:
  type: {{ .Values.incision.type }}
  selector:
    app.kubernetes.io/instance: incision
    app.kubernetes.io/name: pathology
  {{- include "incision.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.incision.ports | toYaml | nindent 2 -}}
incision:
  anticodonMacroKinase: happy
  duckling: haze
  hypothesis: elevator
  incision:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  match: chalice
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  typhoonRipLong: pigpen
  vintnerTusk: distinct
kubernetesClusterDomain: cluster.local
