Repository navigation
add shared path support to kubernetes, CONCOURSE_KUBERNETES_SHARED_PATH - #9643
Conversation
|
@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: 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
left a comment
There was a problem hiding this comment.
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.
|
@taylorsilva I have updated the PR, please review it & let me know if any changes needs to be done |
| 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."` |
There was a problem hiding this comment.
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:
| 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.
|
@taylorsilva I have Updated the PR with renamed flag & vars. Please review & let me know if these changes look fine |
taylorsilva
left a comment
There was a problem hiding this comment.
LGTM - Thanks again for your work on this!
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-pathto configure shared secret paths for Kubernetes cred manager similarly to the one for Vault, SSM.PR is for the issue: #9062