Add kube config generator for clusters#74
Merged
Conversation
This was referenced Jan 12, 2023
d7b933b to
230043a
Compare
5 tasks
mbruner
reviewed
Jan 13, 2023
mbruner
reviewed
Jan 13, 2023
Collaborator
Author
|
Note: Interface name and methods have been renamed to improve readability |
krithika369
reviewed
Jan 13, 2023
krithika369
approved these changes
Jan 13, 2023
Collaborator
krithika369
left a comment
There was a problem hiding this comment.
Left one small comment, the rest LGTM. Thanks, @shydefoo !
shydefoo
added a commit
to caraml-dev/merlin
that referenced
this pull request
Feb 1, 2023
<!-- Thanks for sending a pull request! Here are some tips for you: 1. Run unit tests and ensure that they are passing 2. If your change introduces any API changes, make sure to update the e2e tests 3. Make sure documentation is updated for your PR! --> **What this PR does / why we need it**: * This PR removes the dependency on vault. Clusters are accessed via configuration passed at runtime. * caraml-dev/mlp#74 should be merged first before merging * The changes related to deprecating vault dependencies are in these dirs: * `cluster` * `cmd/api` * `config` * `istio` * `charts/merlin` * The `gke-gcloud-auth-plugin` binary is added to the Dockerfile, this is allow access to GKE clusters without providing static credentials. ### Setup changes To configure access to model clusters, the `environments.yaml` has a new field `k8s_config`: ```yaml - name: id-dev ... k8s_config: name: id-dev cluster: server: id-dev.k8s-cluster insecure-skip-tls-verify: true user: exec: apiVersion: client.authentication.k8s.io/v1beta1 command: gke-gcloud-auth-plugin interactiveMode: IfAvailable provideClusterInfo: true ``` The cluster and user fields correspond to the [Cluster](https://pkg.go.dev/k8s.io/client-go/tools/clientcmd/api/v1#Cluster) struct and [AuthInfo](https://pkg.go.dev/k8s.io/client-go/tools/clientcmd/api/v1#AuthInfo) struct defined in client-go clientcmd/api/v1 package. To configure access to the Imagebuilder cluster, there is a new environment variable `IMG_BUILDER_K8S_CONFIG` which takes a json object of the same format as what's passed into the `k8s_config` field in `environments.yaml`: ``` IMG_BUILDER_K8S_CONFIG='{"name":"id-dev","cluster":{"server":"id-dev.k8s.cluster","insecure-skip-tls-verify":true},"user":{"exec":{"apiVersion":"client.authentication.k8s.io/v1beta1","command":"gke-gcloud-auth-plugin","interactiveMode":"IfAvailable","provideClusterInfo":true}}}' ``` **Does this PR introduce a user-facing change?**: <!-- If no, just write "NONE" in the release-note block below. If yes, a release note is required. Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information about release notes, see kubernetes' guide here: http://git.k8s.io/community/contributors/guide/release-notes.md --> No ```release-note NONE ``` **Checklist** - [x] Added unit test, integration, and/or e2e tests - [x] Tested locally - [x] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduce API changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds common code to generate k8s rest.Config that will be used in Merlin and Turing.