apiVersion: v1
kind: ConfigMap
metadata:
  name: sidecar-injector-webhook-configmap
data:
  sidecarconfig.yaml: |
    containers:
      - name: sidecar-nginx
        image: nginx:1.12.2
        imagePullPolicy: IfNotPresent
        volumeMounts:
          - name: nginx-conf
            mountPath: /etc/nginx
          - name: testgrid
            mountPath: /opt/testgrid
            subPathExpr: ${podname}
        env:
          - name: nodename
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: podname
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: podnamespace
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: podip
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
    volumes:
      - name: nginx-conf
        configMap:
          name: nginx-configmap
      - name: testgrid
        hostPath:
          path: /var/logs/default
    volumeMounts:
      - name: testgrid
        mountPath: /opt/testgrid
        subPathExpr: ${podname}
    env:
      - name: nodename
        valueFrom:
          fieldRef:
            fieldPath: spec.nodeName
      - name: podname
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: podnamespace
        valueFrom:
          fieldRef:
            fieldPath: metadata.namespace
      - name: podip
        valueFrom:
          fieldRef:
            fieldPath: status.podIP
