apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: busybox
  name: busybox
  namespace: test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      labels:
        app: busybox
    spec:
      containers:
      - image: samkulkarni20/busybox-conjur
        name: busybox
        env:
          - name: CONJUR_APPLIANCE_URL
            value: "https://conjur-oss.conjur.svc.cluster.local"
          - name: CONJUR_ACCOUNT
            value: "default"
          - name: CONJUR_AUTHN_TOKEN_FILE
            value: /run/conjur/access-token
          - name: CONJUR_SSL_CERTIFICATE
            valueFrom:
              secretKeyRef:
                name: conjur-oss-conjur-ssl-cert
                key: tls.crt
        volumeMounts:
          - mountPath: /run/conjur
            name: conjur-access-token
            readOnly: true
      initContainers:
      - image: cyberark/conjur-authn-k8s-client
        name: authenticator
        env:
          - name: CONTAINER_MODE
            value: init
          - name: MY_POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: MY_POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: MY_POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
          - name: CONJUR_AUTHN_URL
            value: "https://conjur-oss.conjur.svc.cluster.local/authn-k8s/demo"
          - name: CONJUR_ACCOUNT
            value: "default"
          - name: CONJUR_AUTHN_LOGIN
            value: "host/conjur/authn-k8s/demo/apps/test/deployment/busybox"
          - name: CONJUR_SSL_CERTIFICATE
            valueFrom:
              secretKeyRef:
                name: conjur-oss-conjur-ssl-cert
                key: tls.crt
        volumeMounts:
          - mountPath: /run/conjur
            name: conjur-access-token
      volumes:
      - name: conjur-access-token
        emptyDir:
          medium: Memory