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

inject init-container secrets webhook #944

Closed

Conversation

sseidman
Copy link
Contributor

What this PR does:
Changes the default secrets-webhook to inject an init-container into each pod that is eligible for mutation through the secrets injection annotation. The webhook will insert the init-container into the first position of each pod since some init-containers might depend on the credentials being available on the local filesystem (e.g. medusa restores). By default, the webhook will inject the k8ssandra/k8ssandra-client image, which will have a mount command to process the annotation string, retrieving and mounting the secrets to the specified path. If a user wants to use their own custom image, they can set the annotation k8ssandra.io/inject-secret-image with the image name. The custom image must be compatible with the args ["mount", {secretInjection}"]

Which issue(s) this PR fixes:
Fixes #605

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

@sseidman sseidman requested a review from a team as a code owner April 12, 2023 15:39
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
20.4% 20.4% Duplication

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #944 (5d2ca44) into main (dc852e4) will increase coverage by 0.14%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
+ Coverage   57.64%   57.78%   +0.14%     
==========================================
  Files          96       96              
  Lines        9446     9462      +16     
==========================================
+ Hits         5445     5468      +23     
+ Misses       3542     3537       -5     
+ Partials      459      457       -2     
Impacted Files Coverage Δ
...elemetry/cassandra_agent/cassandra_agent_config.go 21.87% <ø> (ø)
pkg/telemetry/prom_cass_servicemonitor.go 85.18% <ø> (ø)
controllers/secrets-webhook/secretswebhook.go 75.47% <86.36%> (+5.47%) ⬆️

... and 2 files with indirect coverage changes

@sseidman
Copy link
Contributor Author

sseidman commented May 4, 2023

closing after discussion on 4/20/23. The webhook itself will be configurable rather than injecting an init-container

@sseidman sseidman closed this May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

K8SSAND-1623 ⁃ Create a mutating webhook for the internal secrets provider
1 participant