Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-create WOODPECKER_AGENT_SECRET secret #228

Merged
merged 22 commits into from
Nov 10, 2024
Merged

Auto-create WOODPECKER_AGENT_SECRET secret #228

merged 22 commits into from
Nov 10, 2024

Conversation

pat-s
Copy link
Collaborator

@pat-s pat-s commented Sep 23, 2024

While #144 took a first stab, the implementation does not work in practice for users as the secret is not generated automatically. Right now, only an empty k8s secret is created which must be filled manually with data containing WOODPECKER_AGENT_SECRET.

As #207 shows, users ideally expect the server-agent connection to work OOB.

This new approach

  • creates a k8s secret called woodpecker-default-agent-secret which contains a valid WOODPECKER_AGENT_SECRET
  • Creation is controlled by a boolean flag createAgentSecret (default true for server), which can be set to false if users want to control the creation themselves

woodpecker-default-agent-secret will be read by the server and agent (if both are in the same namespace).
If the agent chart is deployed to a different namespace, users must configure the same secret on their own as we can't ensure the creation of identical secrets across namespaces.

fix #207

TODO

  • Update README/instructions
  • Add tests

Breaking

As this PR changes the way how secrets are created and removes the default woodpecker-custom-secret (as this is not in use anymore), this might break existing installations, hence the "breaking" label and major bump.

@pat-s pat-s added the feature 🚀️ Add new feature label Sep 23, 2024
@pat-s pat-s added the breaking label Oct 5, 2024
@pat-s pat-s marked this pull request as ready for review October 5, 2024 20:43
@pat-s
Copy link
Collaborator Author

pat-s commented Oct 5, 2024

@anbraten @xoxys RFR

@pat-s
Copy link
Collaborator Author

pat-s commented Oct 24, 2024

ping @xoxys

charts/woodpecker/README.md Outdated Show resolved Hide resolved
charts/woodpecker/charts/agent/README.md Show resolved Hide resolved
charts/woodpecker/charts/server/templates/secret.yaml Outdated Show resolved Hide resolved
charts/woodpecker/charts/server/values.yaml Outdated Show resolved Hide resolved
@pat-s pat-s requested a review from xoxys November 1, 2024 19:07
@pat-s pat-s merged commit 4e15579 into main Nov 10, 2024
4 checks passed
@pat-s pat-s deleted the auto-create-secret branch November 10, 2024 15:40
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 10, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent pod crashes with "agent could not auth: please provide an auth token"
2 participants