# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "farmland.fullname" . }}-farmland
  labels:
  {{- include "farmland.labels" . | nindent 4 }}
data:
  DRAGON: {{ .Values.farmland.dragon | quote }}
  GALLERY: {{ .Values.farmland.gallery | quote }}
  LESBIAN_TRAIL_BIT: {{ .Values.farmland.lesbianTrailBit | quote }}
  SERVAL_WIDE: {{ .Values.farmland.servalWide | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "farmland.fullname" . }}-farmland
  labels:
  {{- include "farmland.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: farmland
spec:
  replicas: {{ .Values.farmland.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: farmland
      app.kubernetes.io/name: neologism
    {{- include "farmland.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: farmland
        app.kubernetes.io/name: neologism
      {{- include "farmland.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6a6fe311f12c796b798b30e88aed3e4c9cde26d042d1a530a3cd0ecaa96e37d7
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "farmland.fullname" . }}-farmland
        image: {{ .Values.farmland.farmland.image.repository }}:{{ .Values.farmland.farmland.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.farmland.farmland.imagePullPolicy }}
        name: farmland
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.farmland.farmland.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.farmland.farmland.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "farmland.fullname" . }}-farmland
  labels:
  {{- include "farmland.labels" . | nindent 4 }}
spec:
  type: {{ .Values.farmland.type }}
  selector:
    app.kubernetes.io/instance: farmland
    app.kubernetes.io/name: neologism
  {{- include "farmland.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.farmland.ports | toYaml | nindent 2 -}}
farmland:
  dragon: risk
  farmland:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  gallery: importance
  lesbianTrailBit: pulse
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  servalWide: quickest
  type: ClusterIP
kubernetesClusterDomain: cluster.local
