apiVersion: v1
kind: Pod
metadata:
  name: myservice-pod
  labels:
    consul: myservice
spec:
  containers:
  - name: myservice-with-hooks-container
    image: golang:1.10.0-stretch
    command: ["python", "-m", "SimpleHTTPServer", "8080"]
    env:
    - name: KUBERNETES_POD_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: KUBERNETES_POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    ports:
    - containerPort: 8080
    volumeMounts:
    - name: hooks
      mountPath: /hooks
  - name: consul-dev-container
    image: consul
    command: ["consul", "agent", "-dev"]
    ports:
    - containerPort: 8500
  volumes:
  - name: hooks
    hostPath:
      path: /hooks
