# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tin.fullname" . }}-tin
  labels:
  {{- include "tin.labels" . | nindent 4 }}
data:
  BALLOONIST: {{ .Values.tin.balloonist | quote }}
  EFFECT: {{ .Values.tin.effect | quote }}
  GRANDSON_HARPSICHORD: {{ .Values.tin.grandsonHarpsichord | quote }}
  RATIONS_NETSUKE_SUMMIT: {{ .Values.tin.rationsNetsukeSummit | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tin.fullname" . }}-tin
  labels:
  {{- include "tin.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tin
spec:
  replicas: {{ .Values.tin.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tin
      app.kubernetes.io/name: reservoir
    {{- include "tin.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tin
        app.kubernetes.io/name: reservoir
      {{- include "tin.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0da2729bc524f3c7b396fd57ccf6afd564f4adf53aea62c3012310ccad984f33
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tin.fullname" . }}-tin
        image: {{ .Values.tin.tin.image.repository }}:{{ .Values.tin.tin.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tin.tin.imagePullPolicy }}
        name: tin
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tin.tin.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tin.tin.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tin.fullname" . }}-tin
  labels:
  {{- include "tin.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tin.type }}
  selector:
    app.kubernetes.io/instance: tin
    app.kubernetes.io/name: reservoir
  {{- include "tin.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tin.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tin:
  balloonist: blackness
  effect: resemblance
  grandsonHarpsichord: morphology
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rationsNetsukeSummit: idiotic
  replicas: 1
  tin:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
