vars:
  clusterName:
    default: "httpbin-standalone"
    description: "Name of the Kind cluster"
  imageRepository:
    default: "mccutchen/go-httpbin"
    description: "go-httpbin Docker image repository"
  imageTag:
    default: "2.25.0"
    description: "go-httpbin Docker image tag"
images:
  preload:
    refs:
      - "{{ .imageRepository }}:{{ .imageTag }}"
kind:
  name: "{{ .clusterName }}"
  nodes:
    - role: control-plane
      extraPortMappings:
        - containerPort: 31880
          hostPort: 31880
components:
  - name: httpbin
    type: k8s
    k8s:
      manifests:
        - apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: httpbin
            labels:
              app: httpbin
          spec:
            replicas: 1
            selector:
              matchLabels:
                app: httpbin
            template:
              metadata:
                labels:
                  app: httpbin
              spec:
                automountServiceAccountToken: false
                containers:
                  - name: httpbin
                    image: "{{ .imageRepository }}:{{ .imageTag }}"
                    ports:
                      - containerPort: 8080
                        name: http
                    env:
                      # Report the pod name in /hostname so tests can tell
                      # replicas apart when load-balancing.
                      - name: USE_REAL_HOSTNAME
                        value: "true"
                    readinessProbe:
                      httpGet:
                        path: /status/200
                        port: 8080
                    livenessProbe:
                      httpGet:
                        path: /status/200
                        port: 8080
                      initialDelaySeconds: 5
                    resources:
                      requests:
                        cpu: 50m
                        memory: 32Mi
                      limits:
                        cpu: 500m
                        memory: 128Mi
        - apiVersion: v1
          kind: Service
          metadata:
            name: httpbin
            labels:
              app: httpbin
          spec:
            type: NodePort
            ports:
              - port: 8080
                targetPort: 8080
                nodePort: 31880
                name: http
            selector:
              app: httpbin
