-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adding Porch private authenticated registries functionality #126
base: main
Are you sure you want to change the base?
Adding Porch private authenticated registries functionality #126
Conversation
/retest presubmit-nephio-go-test |
@Catalin-Stratulat-Ericsson: The
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test presubmit-nephio-go-test |
1 similar comment
/test presubmit-nephio-go-test |
/approve |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Catalin-Stratulat-Ericsson, JamesMcDermott The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Just a side question: should all the functions use the same image pull secret? Probably that will be the most used scenario. But how about adding an imagePullSecret row in the kptfile? This will provide more flexibility.
|
|
…should have used update instead of patch for secret rbac
I understand the points thanks for explaining. In this case making changes in KPT file will result in making quite big changes in all the files. |
First of all thanks for this much needed feature! |
You are correct Istvan.
|
Thank you for the detailed clarification. I haven't realized before that we need the same secret in two different namespaces. That properly explains the copying in the code. I think this also explains what my follow-up question would have been, namely why aren't we just adding the pull secretes to the appropriate service accounts (as explained here). But now I understand that wouldn't solve the authentication problem when the /lgtm |
@@ -57,6 +58,9 @@ const ( | |||
fieldManagerName = "krm-function-runner" | |||
functionContainerName = "function" | |||
defaultManagerNamespace = "porch-system" | |||
defaultRegistry = "gcr.io/kpt-fn/" | |||
// perhaps should try and get the name of the dockerconfig secret given by user and match this secret name to that to avoid hard coded value? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this will be removed with a new commit.
@@ -532,6 +650,7 @@ func (pm *podManager) retrieveOrCreatePod(ctx context.Context, image string, ttl | |||
// TODO: It's possible to set up a Watch in the fn runner namespace, and always try to maintain a up-to-date local cache. | |||
podList := &corev1.PodList{} | |||
podTemplate, templateVersion, err := pm.getBasePodTemplate(ctx) | |||
pm.appendImagePullSecret(image, registryAuthSecretPath, podTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this happen after the err check below?
@@ -41,6 +41,7 @@ var ( | |||
port = flag.Int("port", 9445, "The server port") | |||
functions = flag.String("functions", "./functions", "Path to cached functions.") | |||
config = flag.String("config", "./config.yaml", "Path to the config file.") | |||
registryAuthSecretPath = flag.String("registry-auth-secret-path", "", "Path to means of authentication for using images from custom registries e.g. docker config file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we provide a default path here?
|
Tackles #637
This PR adds the functionality for porch to use private authenticated container registries for its KPT functions in the porch packages.
It does this by mounting a docker config.json file as a secret which holds the authenticated information for the private repositories used by the user in their porch packages.
This secret information is then used as the ImagePullSecret on the KPT function pods created by the function runner at render time.
A documentation PR will soon follow which will document the configuration and i will link to it in this PR
Documentation PR #178
RBAC changes must be propagated in the catalog PR #126