Skip to content

add shared path support to kubernetes, CONCOURSE_KUBERNETES_SHARED_PATH - #9643

Merged
taylorsilva merged 9 commits into
concourse:masterfrom
VikranthBala:master
Jul 16, 2026
Merged

taylorsilva merged 9 commits into
concourse:masterfrom
VikranthBala:master

Conversation

@VikranthBala

Copy link
Copy Markdown
Contributor

Changes proposed by this PR

As of now, it is not possible to configure shared paths for Kubernetes secret manager as opposed to other cred managers such as Vault,AWS. So I propose to add a new parameter --kubernetes-shared-path similar to the Vault cred manager. This parameter can be optional (as with Vault). This PR provides all the changes needed for this functionality.
Notes to reviewer

Release Note

Added --kubernetes-shared-path to configure shared secret paths for Kubernetes cred manager similarly to the one for Vault, SSM.

PR is for the issue: #9062

@VikranthBala

Copy link
Copy Markdown
Contributor Author

@taylorsilva I'd like your thoughts on how sharedPath should map to Kubernetes.

Other credential managers naturally support hierarchical paths, but Kubernetes secrets are namespaced rather than path-based. To support sharedPath, the current implementation maps it to a dedicated namespace:

sharedPath = shared
↓
concourse-shared/<secret-name>

This has the benefit of preserving Kubernetes' namespace-based RBAC model. Teams can be granted access to their own namespace (concourse-) and the shared namespace (concourse-shared), while the root namespace remains isolated.

An alternative would be to store shared secrets in the root namespace (e.g. concourse-/shared.secret-name), but that either requires broader RBAC permissions on the root namespace or explicit resourceNames entries for every shared secret, which becomes harder to manage.

Does mapping sharedPath to a dedicated namespace seem like the right Kubernetes interpretation, or would you prefer a different approach?

@taylorsilva taylorsilva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first thought is what you've done here: operators can define a shared k8s namespace and this new config option points to that namespace.

The help text should also note that the given shared path is appended to the namespace prefix.

@VikranthBala
VikranthBala marked this pull request as ready for review July 14, 2026 16:44
@VikranthBala
VikranthBala requested a review from a team July 14, 2026 16:44
@VikranthBala

Copy link
Copy Markdown
Contributor Author

@taylorsilva I have updated the PR, please review it & let me know if any changes needs to be done

Comment thread atc/creds/kubernetes/manager.go Outdated
InClusterConfig bool `long:"in-cluster" description:"Enables the in-cluster client."`
ConfigPath string `long:"config-path" description:"Path to Kubernetes config when running ATC outside Kubernetes."`
NamespacePrefix string `long:"namespace-prefix" default:"concourse-" description:"Prefix to use for Kubernetes namespaces under which secrets will be looked up."`
SharedPath string `long:"shared-path" description:"Path under which to look up shared credentials. This value is appended to the configured namespacePrefix to determine the shared namespace."`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept thinking about the implied semantics given the name of the flag and I don't like it. SharedPath implies I can set this to some kind of system-like path (e.g. some/path/here) like the other cred managers, when that's not the case here.

I'd prefer we be explicit about what this does so I'll suggest the following change:

Suggested change
SharedPath string `long:"shared-path" description:"Path under which to look up shared credentials. This value is appended to the configured namespacePrefix to determine the shared namespace."`
NamespaceSharedSuffix string `long:"shared-namespace-suffix" description:"Appended to the namespace-prefix, which combined should match an existing Kubernetes namespace used to lookup shared secrets in."`

Update the name and related vars, then this looks good to merge.

@VikranthBala

Copy link
Copy Markdown
Contributor Author

@taylorsilva I have Updated the PR with renamed flag & vars. Please review & let me know if these changes look fine

@taylorsilva taylorsilva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks again for your work on this!

@taylorsilva
taylorsilva merged commit 8bd5939 into concourse:master Jul 16, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Contributor to Done in Pull Requests Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants