-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'improvement/sync-kube-manifest-with-kubeadm' into tmp/o…
…ctopus/w/2.9/improvement/sync-kube-manifest-with-kubeadm
- Loading branch information
Showing
11 changed files
with
136 additions
and
29 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM centos:7 | ||
|
||
ARG K8S_VERSION | ||
|
||
RUN printf "[kubernetes]\n\ | ||
name=Kubernetes\n\ | ||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64\n\ | ||
enabled=1\n\ | ||
gpgcheck=1\n\ | ||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg\n\ | ||
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg\n" \ | ||
> /etc/yum.repos.d/kubernetes.repo \ | ||
&& yum install -y "kubeadm-${K8S_VERSION}" --disableexcludes=kubernetes \ | ||
&& yum clean all | ||
|
||
RUN kubeadm init phase control-plane all \ | ||
&& kubeadm init phase etcd local | ||
|
||
CMD echo -e "\e[32m#### Apiserver manifest ####\e[39m" \ | ||
&& cat /etc/kubernetes/manifests/kube-apiserver.yaml \ | ||
&& echo -e "\e[32m#### Controller manager manifest ####\e[39m" \ | ||
&& cat /etc/kubernetes/manifests/kube-controller-manager.yaml \ | ||
&& echo -e "\e[32m#### Scheduler manifest ####\e[39m" \ | ||
&& cat /etc/kubernetes/manifests/kube-scheduler.yaml \ | ||
&& echo -e "\e[32m#### Etcd manifest ####\e[39m" \ | ||
&& cat /etc/kubernetes/manifests/etcd.yaml |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Simple tool to get the kubernetes control plane manifests deployed by kubeadm for a | ||
specific version | ||
|
||
## Building | ||
|
||
Build the docker container for the Kubernetes version you want | ||
|
||
```shell | ||
K8S_VERSION=$(grep 'K8S_VERSION.*=' "$(git rev-parse --show-toplevel)/buildchain/buildchain/versions.py" | cut -d '"' -f 2) | ||
docker build "$(git rev-parse --show-toplevel)/tools/get-kubeadm-manifests" --build-arg "K8S_VERSION=$K8S_VERSION" -t "metalk8s-kubeadm:$K8S_VERSION" | ||
``` | ||
|
||
## Get Kubernetes control plane manifests | ||
|
||
To retrieve the various Kubernetes control plane manifests, | ||
you must run the previously built container. | ||
|
||
```shell | ||
docker run -it --rm "metalk8s-kubeadm:$K8S_VERSION" | ||
``` |