Cray-HPE / sat

System Admin Toolkit
https://cray-hpe.github.io/docs-sat/
MIT License
4 stars 5 forks source link

CRAYSAT-1912: Get K8s version from node-images #273

Closed haasken-hpe closed 2 weeks ago

haasken-hpe commented 2 weeks ago

Summary and Scope

Update the cray-sat image build process to get the Kubernetes version from its new location in the node-images repository instead of the old version in the deprecated metal-provision repository.

This is more involved than just changing the repository URL and path in the docker_scripts/config-docker-sat.sh script because the node-images repository is private in GitHub, but metal-provision was public. Thus we need to authenticate to GitHub when cloning this repository. This is best achieved through a git command in the Jenkinsfile.

In order to continue supporting local builds, add a target to the Makefile that clones the node-images repository if it does not already exist. Use the git protocol instead of https to allow it to use the user's configured SSH keypair to authenticate when cloning the repo.

In either case, the node-images repository gets bind-mounted during the RUN command, so that it can be accessed by the config-docker-sat.sh script.

Issues and Related PRs

Testing

Tested on:

Test description:

Built the image locally using make image. Then ran the container and executed kubectl version to verify the version of the kubectl client that was installed.

Pushed to Jenkins and verified that the Jenkins pipeline worked.

Risks and Mitigations

Pull Request Checklist

haasken-hpe commented 2 weeks ago

Before merge, we should test the few important places where we use kubectl. In order of importance:

shivaprasad-metimath commented 2 weeks ago

@annapoorna-s-alt testing results: https://gist.github.com/annapoorna-s-alt/45736c9032a583c3bf5dc972acb60e7e

The testing looks good, hence proceeding with merging the PR