---
apiVersion: v1
kind: ConfigMap
metadata:
  name: apache-configmap
data:
  status.conf: |
    ExtendedStatus on
    <Location /mod_status>
      SetHandler server-status
    </Location>
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: apache-deployment
  labels:
    app: apache
spec:
  replicas: 1
  selector:
    matchLabels:
      app: apache
  template:
    metadata:
      labels:
        app: apache
    spec:
      containers:
        - name: apache
          image: httpd:latest
          ports:
            - containerPort: 80
          volumeMounts:
            - name: apache-conf
              mountPath: /usr/local/apache2/conf.d/status.conf
          command: ["/bin/sh"]
          args: ["-c", "echo 'Include conf.d/*.conf' >> /usr/local/apache2/conf/httpd.conf; /usr/local/bin/httpd-foreground"]
          readinessProbe:
            httpGet:
              path: /mod_status?auto
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 5
      volumes:
        - name: apache-conf
          configMap:
            name: apache-configmap
