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

Fix kubernetes cert connections #4519

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Fix kubernetes cert connections #4519

wants to merge 8 commits into from

Conversation

epicfaace
Copy link
Member

@epicfaace epicfaace commented Aug 23, 2023

Fix kubernetes cert connections -- we are now passing certs in through an environment variable. This removes the issues that were happening with the newlines being parsed.

@@ -222,7 +222,7 @@ def parse_args():
parser.add_argument(
'--kubernetes-cert',
type=str,
help='Contents of the SSL cert for the Kubernetes cluster. Only applicable if --bundle-runtime is set to kubernetes and --kubernetes-cert-path is set to /dev/null.',
help='Base64 encoded contents of the SSL cert for the Kubernetes cluster. Only applicable if --bundle-runtime is set to kubernetes and --kubernetes-cert-path is set to /dev/null.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there not a way to use a path or environment variables?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is set using an environment variable -- CODALAB_WORKER_MANAGER_GPU_KUBERNETES_CERT -- when starting up codalab_service.py.

We could use a path, but in that case we'd need to copy the cert file over to the worker pods on kubernetes when running them, which I think is a more complex solution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's already an environment variable, why do we need to pass it in as an argument?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will try this

codalab/worker/main.py Outdated Show resolved Hide resolved
codalab/worker/main.py Outdated Show resolved Hide resolved
Base automatically changed from rc1.7.0 to master August 28, 2023 02:26
@mergify mergify bot mentioned this pull request Sep 6, 2023
Copy link
Collaborator

@percyliang percyliang left a comment

Choose a reason for hiding this comment

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

This looks nice and clean. So we ended up being able to pass the cert as a file (rather than doing some weird base64 or quoting thing)? I thought we had trouble with this approach last time?

@epicfaace
Copy link
Member Author

This looks nice and clean. So we ended up being able to pass the cert as a file (rather than doing some weird base64 or quoting thing)? I thought we had trouble with this approach last time?

We passed it as a file, but through an environment variable rather than a command-line argument (we were trying a command-line argument earlier, which didn't work).

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.

2 participants