apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: example-token-refresher
    app.kubernetes.io/name: token-refresher
    app.kubernetes.io/version: master-2021-03-05-b34376b
  name: example-token-refresher
  namespace: observatroium
spec:
  selector:
    matchLabels:
      app.kubernetes.io/instance: example-token-refresher
      app.kubernetes.io/name: token-refresher
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: example-token-refresher
        app.kubernetes.io/name: token-refresher
        app.kubernetes.io/version: master-2021-03-05-b34376b
    spec:
      containers:
      - args:
        - --log.level=info
        - --log.format=logfmt
        - --web.listen=0.0.0.0:8080
        - --web.internal.listen=0.0.0.0:8081
        - --oidc.audience=$(OIDC_AUDIENCE)
        - --oidc.client-id=$(OIDC_CLIENT_ID)
        - --oidc.client-secret=$(OIDC_CLIENT_SECRET)
        - --oidc.issuer-url=$(OIDC_ISSUER_URL)
        - --url=http://observatorium-observatorium-api.observatorium.svc:8080
        env:
        - name: OIDC_AUDIENCE
          valueFrom:
            secretKeyRef:
              key: audience
              name: token-refresher-oidc
        - name: OIDC_CLIENT_ID
          valueFrom:
            secretKeyRef:
              key: clientID
              name: token-refresher-oidc
        - name: OIDC_CLIENT_SECRET
          valueFrom:
            secretKeyRef:
              key: clientSecret
              name: token-refresher-oidc
        - name: OIDC_ISSUER_URL
          valueFrom:
            secretKeyRef:
              key: issuerURL
              name: token-refresher-oidc
        image: quay.io/observatorium/token-refresher:master-2021-03-05-b34376b
        name: token-refresher
        ports:
        - containerPort: 8081
          name: internal
        - containerPort: 8080
          name: web
