# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "notepad.fullname" . }}-notepad
  labels:
  {{- include "notepad.labels" . | nindent 4 }}
data:
  ALLEY: {{ .Values.notepad.alley | quote }}
  DIVING: {{ .Values.notepad.diving | quote }}
  PATRIMONY_WAISTBAND: {{ .Values.notepad.patrimonyWaistband | quote }}
  PEST_MINOR: {{ .Values.notepad.pestMinor | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "notepad.fullname" . }}-notepad
  labels:
  {{- include "notepad.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: notepad
spec:
  replicas: {{ .Values.notepad.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: notepad
      app.kubernetes.io/name: riding
    {{- include "notepad.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: notepad
        app.kubernetes.io/name: riding
      {{- include "notepad.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2147cc051ed98a9663c6fd8befb651f38a61fcf0066a8c7e0eb91f13c40f2e5f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "notepad.fullname" . }}-notepad
        image: {{ .Values.notepad.notepad.image.repository }}:{{ .Values.notepad.notepad.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.notepad.notepad.imagePullPolicy }}
        name: notepad
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.notepad.notepad.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.notepad.notepad.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "notepad.fullname" . }}-notepad
  labels:
  {{- include "notepad.labels" . | nindent 4 }}
spec:
  type: {{ .Values.notepad.type }}
  selector:
    app.kubernetes.io/instance: notepad
    app.kubernetes.io/name: riding
  {{- include "notepad.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.notepad.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
notepad:
  alley: spork
  diving: unequaled
  notepad:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  patrimonyWaistband: sock
  pestMinor: patch
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
