---
apiVersion: v1
kind: List
items:
- kind: Pod
  apiVersion: v1
  metadata:
    name: release
    labels:
      infra: cockpit-release
  spec:
    containers:
      - name: release
        image: cockpit/release
        ports:
          - containerPort: 8080
            protocol: TCP
        command: [ "webhook" ]
        volumeMounts:
        - name: release-secrets
          mountPath: /run/secrets/release
          readOnly: true
        - name: webhook-secrets
          mountPath: /run/secrets/webhook
          readOnly: true
    volumes:
    - name: release-secrets
      secret:
        secretName: cockpit-release-secrets
    - name: webhook-secrets
      secret:
        secretName: cockpit-release-webhook-secrets

- kind: Service
  apiVersion: v1
  metadata:
    name: cockpit-release
  spec:
    clusterIP: None
    selector:
      infra: cockpit-release
    ports:
    - name: webhook
      port: 8080
      protocol: TCP

- kind: Route
  apiVersion: v1
  metadata:
    name: release
  spec:
    to:
      kind: Service
      name: cockpit-release

---
apiVersion: v1
kind: List
items:
- kind: ReplicationController
  apiVersion: v1
  metadata:
    name: release
  spec:
    replicas: 1
    selector:
      infra: cockpit-release
    template:
      metadata:
        name: release
        labels:
          infra: cockpit-release
      spec:
        containers:
          - name: release
            image: cockpit/release
            ports:
              - containerPort: 8080
                protocol: TCP
            command: [ "webhook" ]
            volumeMounts:
            - name: release-secrets
              mountPath: /run/secrets/release
              readOnly: true
            - name: webhook-secrets
              mountPath: /run/secrets/webhook
              readOnly: true
        volumes:
        - name: release-secrets
          secret:
            secretName: cockpit-release-secrets
        - name: webhook-secrets
          secret:
            secretName: cockpit-release-webhook-secrets

- kind: Service
  apiVersion: v1
  metadata:
    name: cockpit-release
  spec:
    clusterIP: None
    selector:
      infra: cockpit-release
    ports:
    - name: webhook
      port: 8080
      protocol: TCP

- kind: Route
  apiVersion: v1
  metadata:
    name: release
  spec:
    to:
      kind: Service
      name: cockpit-release

Use ReplicationController for webhook pod
release: Use ReplicationController for webhook pod

Pods can fail at any time, and sometimes our solitary "release" pod got
killed the other day when the underlying node went away. So wrap it in a
replication controller with one replica (which is sufficient for our
purposes).

Closes #211
