-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Automatically set kube context in development container (#246)
#### Motivation When using the containerized development environment `make develop` to run FVT tests, one needs to configure access to a Kubernetes or OpenShift cluster from inside the container. Which has to be done for every `make develop` session. This can be tricky when cloud provider specific CLI tools are needed to connect and authenticate to a cluster. Currently there is a short paragraph in the FVT README about how to export a minified kubeconfig file and create that inside the container. It is tedious to repeat those steps for each `make develop` session and depending on OS, shell environment, editors and possible text encoding issue it is also error prone. #### Modifications This PR proposes to automatically create the kubeconfig file in a local and git-ignored directory inside the local project and automatically mount it to the develop container. All the user then has to do is connect and authenticate to the cluster in the shell that will be running `make develop`. #### Result Kubernetes context is ready inside the development container. ```Shell # shell environment, outside the develop container has access to K8s cluster [modelmesh-serving_ckadner]$ kubectl get pods NAME READY STATUS RESTARTS AGE pod/etcd 1/1 Running 0 17m pod/minio 1/1 Running 0 17m pod/modelmesh-controller-387aef25be-ftyqu 1/1 Running 0 17m [modelmesh-serving_ckadner]$ make develop ./scripts/build_devimage.sh Pulling dev image kserve/modelmesh-controller-develop:6be58b09c25833c1... Building dev image kserve/modelmesh-controller-develop:6be58b09c25833c1... Image kserve/modelmesh-controller-develop:6be58b09c25833c1 has 14 layers Tagging dev image kserve/modelmesh-controller-develop:6be58b09c25833c1 as latest ./scripts/develop.sh [root@17c121286549 workspace]# kubectl get pods NAME READY STATUS RESTARTS AGE pod/etcd 1/1 Running 0 18m pod/minio 1/1 Running 0 18m pod/modelmesh-controller-387aef25be-ftyqu 1/1 Running 0 18m [root@17c121286549 workspace]# ``` /cc @njhill Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
- Loading branch information
Showing
4 changed files
with
67 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ bin | |
# Modelmesh development related artifacts | ||
devbuild | ||
.develop_image_name | ||
.bash_history | ||
.dev/ |
This file contains 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
This file contains 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
This file contains 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