Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 2.23 KB

how-to-add-custom-secret.md

File metadata and controls

35 lines (25 loc) · 2.23 KB

Add custom secret to Prow

This tutorial shows how to add a custom secret and use it in the Prow pipeline.

Procedure

  1. Add a secret to the Google Secret Manager service and apply the necessary permissions. Add the [email protected] principal with the Secret Manager Secret Accessor role if the secret will be used only for a postsubmit or release job. If you are creating a Secret for a presubmit job, use [email protected] principal with the same role. If you want to use the secret in presubmit and postsubmit jobs, apply both principals.

permissions

  1. Apply labels to the secret in Secret Manager that will help identify the owner of a secret. For example: owner: team name

  2. Update External Secrets Operator YAML file.

    Add External Secret definitions to one of the following files:

  3. Apply the Secrets manually in the Prow cluster as Kubernetes External Secret.

  4. Create ProwJob Preset in prow-config.yaml that maps the Secret to the variable or to the file.

    For example:

    - labels:
        preset-kyma-btp-manager-bot-github-token: "true"
        env:
        - name: BOT_GITHUB_TOKEN
          valueFrom:
            secretKeyRef:
                name: kyma-btp-manager-bot-github-token
                key: token

    Now you can use the Preset in your job definition and refer to the Secret in your pipeline.