# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "hammock.fullname" . }}-hammock
  labels:
  {{- include "hammock.labels" . | nindent 4 }}
data:
  ABDOMEN_ANTIBODY: {{ .Values.hammock.abdomenAntibody | quote }}
  BAIL_REPOSITORY_CONTRAIL: {{ .Values.hammock.bailRepositoryContrail | quote }}
  BILLION: {{ .Values.hammock.billion | quote }}
  ELIMINATION: {{ .Values.hammock.elimination | quote }}
  ERECTION_SKYLINE: {{ .Values.hammock.erectionSkyline | quote }}
  EX-WIFE: {{ .Values.hammock.exWife | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hammock.fullname" . }}-hammock
  labels:
  {{- include "hammock.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: hammock
spec:
  replicas: {{ .Values.hammock.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: hammock
      app.kubernetes.io/name: sociology
    {{- include "hammock.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: hammock
        app.kubernetes.io/name: sociology
      {{- include "hammock.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d913f316b81c0b64d11ca590f06c841bf016ff1582af60215da3ec678ca71ea3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "hammock.fullname" . }}-hammock
        image: {{ .Values.hammock.hammock.image.repository }}:{{ .Values.hammock.hammock.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.hammock.hammock.imagePullPolicy }}
        name: hammock
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.hammock.hammock.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.hammock.hammock.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "hammock.fullname" . }}-hammock
  labels:
  {{- include "hammock.labels" . | nindent 4 }}
spec:
  type: {{ .Values.hammock.type }}
  selector:
    app.kubernetes.io/instance: hammock
    app.kubernetes.io/name: sociology
  {{- include "hammock.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.hammock.ports | toYaml | nindent 2 -}}
hammock:
  abdomenAntibody: negotiate
  bailRepositoryContrail: lesson
  billion: lesson
  elimination: consist
  erectionSkyline: email
  exWife: stealth
  hammock:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
