k8s-create-secret icon indicating copy to clipboard operation
k8s-create-secret copied to clipboard

Add support for multiple secrets

Open alxxyz opened this issue 2 years ago • 7 comments

At the moment we should call the action multiple times in case we have multiple secrets. It will be useful to set multiple secrets at once in one action call.

alxxyz avatar Nov 04 '22 13:11 alxxyz

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Nov 18 '22 15:11 github-actions[bot]

Hi @alxxyz! We don't want to add this feature because it would significantly complicate the way users have to use this action (actions can't take lists or other yaml features as inputs). Running the action multiple times should be just as effective of a solution.

Is there a reason why you want this action to be able to set multiple secrets at the same time instead of just running this action multiple times?

OliverMKing avatar Nov 28 '22 18:11 OliverMKing

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Dec 12 '22 21:12 github-actions[bot]

Hi @OliverMKing, we have to pass 20-30 secrets, and it looks bad when we need to pass such amount of secrets

alxxyz avatar Jan 19 '23 13:01 alxxyz

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Feb 02 '23 18:02 github-actions[bot]

@alxxyz Would this work for you? Store whole secret manifest inside a github secret, and then apply it as a resource directly?

For example:

Github Secret content:

apiVersion: v1
kind: Secret
metadata:
  name: <secret name>
  namespace: <namespace name>
type: Opaque
data:
  DB_PASSWORD: <b64 of database password>
  RMQ_PASSWORD: <b64 of rmq password>
  JWT_SECRET_KEY: <b64 of jwt secret>

And then in your workflow definition:

      - name: Set secret
        env:
          SECRET_CONTENT: ${{ secrets.APP_SECRET }}
        run: |
          echo "$env:SECRET_CONTENT" | kubectl apply -f -
        shell: bash

mihiic avatar Oct 18 '23 19:10 mihiic

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Nov 01 '23 21:11 github-actions[bot]