From e920820a62c9b37d086a1b4d348373776e8145ad Mon Sep 17 00:00:00 2001 From: ratanasovvmw <86951923+ratanasovvmw@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:26:18 +0200 Subject: [PATCH 1/8] Add Installer documentation --- docs/local_dev.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/docs/local_dev.md b/docs/local_dev.md index 09747ea51..e47845561 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -179,3 +179,83 @@ kubectl delete cluster $CLUSTER_NAME docker rm -f $HOST_NAME kind delete cluster ``` + +# Host Agent Installer +The installer is responsible for detecting the BYOH OS, downloading a BYOH bundle and installing/uninstalling it. + +## Creating a BYOH Bundle +### Upstream Ingredients +Optional. This step describes downloading upstream k8s host components for Debian. +```shell +#Build docker image +(cd agent/installer/bundle_builder/ingredients/deb/ && docker build -t byoh-ingredients-deb .) + +#Create a directory for the ingredients and download to it +(mkdir -p byoh-ingredients-download && docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients byoh-ingredients-deb) +``` +### Downstream Ingredients +This step describes providing custom k8s host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: +```shell +*containerd*.tar +*kubeadm*.deb +*kubelet*.deb +*kubectl*.deb +*cri-tools*.deb +*kubernetes-cni*.deb +``` + +## Building a BYOH Bundle +```shell +#Build docker image +(cd agent/installer/bundle_builder/ && docker build -t byoh-build-push-bundle .) +``` + +```shell +#Build a BYOH bundle and publish it to an OCI-compliant repo +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients --env BUILD_ONLY=0 build-push-bundle / +``` + +The bundle name must match one reported by ./cli --list-supported. + +```shell +#You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle --env BUILD_ONLY=1 build-push-bundle +``` + +```shell +#Optionally, additional configuration can be included in the bundle by mounting a local path under /config of the container. It will be placed on top of any drop-in configuration created by the packages and tars in the bundle +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle -v`pwd`/agent/installer/bundle_builder/config/ubuntu/20_04/k8s/1_22 --env BUILD_ONLY=1 build-push-bundle +``` + +## CLI +The installer CLI exposes the installer package as a command line tool. For a list of all commands, run + +```shell +./cli --help +``` + +Some examples: +```shell +#Will return if/how the current OS is detected +./cli --detect +``` + +```shell +#Will return tuples of OS, K8S Version, BYOH Bundle Name. Installer will use this bundle for these OS-es and k8s versions. +./cli --list-supported +``` + +```shell +#Will return the OS changes that installer will make during install and uninstall without actually doing them. +./cli --preview-os-changes --os Ubuntu_20.04.*_x86-64 --k8s v1.22.3 +``` + +```shell +#Will detect the current OS and install BYOH bundle with k8s v1.22.3 from the default repo +sudo ./cli --install --k8s v1.22.3 +``` + +```shell +#Will override the OS detection and will use custom repo +sudo ./cli --install --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 +``` From da936b4e1fc684a0a196f1bd4e539e611ed9a750 Mon Sep 17 00:00:00 2001 From: ratanasovvmw <86951923+ratanasovvmw@users.noreply.github.com> Date: Thu, 11 Nov 2021 08:46:33 +0200 Subject: [PATCH 2/8] Address review comments --- docs/{local_dev.md => k8s} | 45 ++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 19 deletions(-) rename docs/{local_dev.md => k8s} (82%) diff --git a/docs/local_dev.md b/docs/k8s similarity index 82% rename from docs/local_dev.md rename to docs/k8s index e47845561..6bcf02607 100644 --- a/docs/local_dev.md +++ b/docs/k8s @@ -183,18 +183,24 @@ kind delete cluster # Host Agent Installer The installer is responsible for detecting the BYOH OS, downloading a BYOH bundle and installing/uninstalling it. +## Supported OS and kubernetes +The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name can be retrieved like this: +```shell +./cli --list-supported +``` + ## Creating a BYOH Bundle -### Upstream Ingredients -Optional. This step describes downloading upstream k8s host components for Debian. +### Kubernetes Ingredients +Optional. This step describes downloading upstream kubernetes host components for Debian. ```shell -#Build docker image +# Build docker image (cd agent/installer/bundle_builder/ingredients/deb/ && docker build -t byoh-ingredients-deb .) -#Create a directory for the ingredients and download to it +# Create a directory for the ingredients and download to it (mkdir -p byoh-ingredients-download && docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients byoh-ingredients-deb) ``` -### Downstream Ingredients -This step describes providing custom k8s host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: +### Custom Ingredients +This step describes providing custom kubernetes host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: ```shell *containerd*.tar *kubeadm*.deb @@ -211,19 +217,20 @@ This step describes providing custom k8s host components. They can be copied to ``` ```shell -#Build a BYOH bundle and publish it to an OCI-compliant repo +# Build a BYOH bundle and publish it to an OCI-compliant repo docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients --env BUILD_ONLY=0 build-push-bundle / ``` -The bundle name must match one reported by ./cli --list-supported. +The bundle name must match one reported by ./cli --list-supported. [Custom foo description](## Supported OS and kubernetes) ```shell -#You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory +# You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory +# This can be used for custom pushing docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle --env BUILD_ONLY=1 build-push-bundle ``` ```shell -#Optionally, additional configuration can be included in the bundle by mounting a local path under /config of the container. It will be placed on top of any drop-in configuration created by the packages and tars in the bundle +# Optionally, additional configuration can be included in the bundle by mounting a local path under /config of the container. It will be placed on top of any drop-in configuration created by the packages and tars in the bundle docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle -v`pwd`/agent/installer/bundle_builder/config/ubuntu/20_04/k8s/1_22 --env BUILD_ONLY=1 build-push-bundle ``` @@ -236,26 +243,26 @@ The installer CLI exposes the installer package as a command line tool. For a li Some examples: ```shell -#Will return if/how the current OS is detected +# Will return if/how the current OS is detected ./cli --detect ``` ```shell -#Will return tuples of OS, K8S Version, BYOH Bundle Name. Installer will use this bundle for these OS-es and k8s versions. -./cli --list-supported -``` - -```shell -#Will return the OS changes that installer will make during install and uninstall without actually doing them. +# Will return the OS changes that installer will make during install and uninstall without actually doing them. ./cli --preview-os-changes --os Ubuntu_20.04.*_x86-64 --k8s v1.22.3 ``` ```shell -#Will detect the current OS and install BYOH bundle with k8s v1.22.3 from the default repo +# Will detect the current OS and install BYOH bundle with kubernetes v1.22.3 from the default repo sudo ./cli --install --k8s v1.22.3 ``` ```shell -#Will override the OS detection and will use custom repo +# Will override the OS detection and will use custom repo sudo ./cli --install --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 ``` + +```shell +# Will override the OS detection, use custom repo and uninstall +sudo ./cli --uninstall --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 +``` From 91599bc744c75ba17387f7a4169ceb780b8f3c14 Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 08:28:31 +0100 Subject: [PATCH 3/8] address changes --- docs/local_dev.md | 269 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 docs/local_dev.md diff --git a/docs/local_dev.md b/docs/local_dev.md new file mode 100644 index 000000000..be33e03bf --- /dev/null +++ b/docs/local_dev.md @@ -0,0 +1,269 @@ +# How to test the Bring Your Own Host Provider locally + +This doc provides instructions about how to test Bring Your Own Host Provider on a local workstation using: + +- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) for provisioning a management cluster +- [Docker](https://docs.docker.com/engine/install/) run for creating hosts to be used as a capacity for BYO Host machines +- [BYOH](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost) provider to add the above hosts to the aforemention workload cluster +- [Tilt](https://docs.tilt.dev/install.html) for faster iterative development + +## Pre-requisites + +It is required to have a docker image to be used when doing docker run for creating hosts + +__Clone BYOH Repo__ +```shell +git clone git@github.com:vmware-tanzu/cluster-api-provider-bringyourownhost.git +``` + +## Setting up the management cluster + +### Creates the Kubernetes cluster + +We are using [kind](https://kind.sigs.k8s.io/) to create the Kubernetes cluster that will be turned into a Cluster API management cluster later in this doc. + +```shell +cat > kind-cluster.yaml < tilt-settings.json <1``` +```shell +for i in {1..n} +do +echo "Creating docker container host $i" +docker run --detach --tty --hostname host$i --name host$i --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run --volume /var --volume /lib/modules:/lib/modules:ro --network kind byoh/node:v1.22.0 +echo "Copy agent binary to host $i" +docker cp bin/byoh-hostagent-linux-amd64 host$i:/byoh-hostagent +echo "Copy kubeconfig to host $i" +docker cp ~/.kube/management-cluster.conf host$i:/management-cluster.conf +done +``` + +Start the host agent on the host and keep it running + +```shell +docker exec -it $HOST_NAME bin/bash + +./byoh-hostagent --kubeconfig management-cluster.conf +``` + +Repeat the same steps with by changing the `HOST_NAME` env variable for all the hosts that you created. + +Check if the hosts registered itself into the management cluster. + +Open another shell and run +```shell +kubectl get byohosts +``` + +Open a new shell and change directory to `cluster-api-provider-bringyourownhost` repository. Run below commands + +```shell +export CLUSTER_NAME="test1" +export NAMESPACE="default" +export KUBERNETES_VERSION="v1.22.0" +export CONTROL_PLANE_MACHINE_COUNT=1 +export WORKER_MACHINE_COUNT=1 +export CONTROL_PLANE_ENDPOINT_IP= +``` + +From ```cluster-api-provider-bringyourownhost``` folder + +```shell +cat test/e2e/data/infrastructure-provider-bringyourownhost/v1beta1/cluster-template-byoh.yaml | envsubst | kubectl apply -f - +``` + +```shell +kubectl get machines +``` + +Dig into host when machine gets provisioned. + +```shell +kubectl get kubeadmconfig + +kubectl get BYOmachines + +kubectl get BYOhost +``` + +Deploy a CNI solution + +```shell +kubectl get secret $CLUSTER_NAME-kubeconfig -o jsonpath='{.data.value}' | base64 -d > $CLUSTER_NAME-kubeconfig +kubectl --kubeconfig $CLUSTER_NAME-kubeconfig apply -f test/e2e/data/cni/kindnet/kindnet.yaml +``` + +After a short while, our nodes should be running and in Ready state. +Check the workload cluster + +```shell +kubectl --kubeconfig $CLUSTER_NAME-kubeconfig get nodes +``` + +Or peek at the host agent logs. +## Cleanup + +```shell +kubectl delete cluster $CLUSTER_NAME +docker rm -f $HOST_NAME +kind delete cluster +``` + +# Host Agent Installer +The installer is responsible for detecting the BYOH OS, downloading a BYOH bundle and installing/uninstalling it. + +## Supported OS and kubernetes +The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name can be retrieved like this: +```shell +./cli --list-supported +``` + +## Creating a BYOH Bundle +### Kubernetes Ingredients +Optional. This step describes downloading upstream kubernetes host components for Debian. +```shell +# Build docker image +(cd agent/installer/bundle_builder/ingredients/deb/ && docker build -t byoh-ingredients-deb .) + +# Create a directory for the ingredients and download to it +(mkdir -p byoh-ingredients-download && docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients byoh-ingredients-deb) +``` +### Custom Ingredients +This step describes providing custom kubernetes host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: +```shell +*containerd*.tar +*kubeadm*.deb +*kubelet*.deb +*kubectl*.deb +*cri-tools*.deb +*kubernetes-cni*.deb +``` + +## Building a BYOH Bundle +```shell +#Build docker image +(cd agent/installer/bundle_builder/ && docker build -t byoh-build-push-bundle .) +``` + +```shell +# Build a BYOH bundle and publish it to an OCI-compliant repo +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients --env BUILD_ONLY=0 build-push-bundle / +``` + +The bundle name must match one reported by ./cli --list-supported. +[Custom foo description](## Supported OS and kubernetes) + +```shell +# You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory +# This can be used for custom pushing +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle --env BUILD_ONLY=1 build-push-bundle +``` + +```shell +# Optionally, additional configuration can be included in the bundle by mounting a local path under /config of the container. It will be placed on top of any drop-in configuration created by the packages and tars in the bundle +docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle -v`pwd`/agent/installer/bundle_builder/config/ubuntu/20_04/k8s/1_22 --env BUILD_ONLY=1 build-push-bundle +``` + +## CLI +The installer CLI exposes the installer package as a command line tool. For a list of all commands, run + +```shell +./cli --help +``` + +Some examples: +```shell +# Will return if/how the current OS is detected +./cli --detect +``` + +```shell +# Will return the OS changes that installer will make during install and uninstall without actually doing them. +./cli --preview-os-changes --os Ubuntu_20.04.*_x86-64 --k8s v1.22.3 +``` + +```shell +# Will detect the current OS and install BYOH bundle with kubernetes v1.22.3 from the default repo +sudo ./cli --install --k8s v1.22.3 +``` + +```shell +# Will override the OS detection and will use custom repo +sudo ./cli --install --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 +``` + +```shell +# Will override the OS detection, use custom repo and uninstall +sudo ./cli --uninstall --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 +``` From bbb9cff8e771b83d1bf43a0e1ea7a25d799813b3 Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 08:30:06 +0100 Subject: [PATCH 4/8] del k8s --- docs/k8s | 268 ------------------------------------------------------- 1 file changed, 268 deletions(-) delete mode 100644 docs/k8s diff --git a/docs/k8s b/docs/k8s deleted file mode 100644 index 6bcf02607..000000000 --- a/docs/k8s +++ /dev/null @@ -1,268 +0,0 @@ -# How to test the Bring Your Own Host Provider locally - -This doc provides instructions about how to test Bring Your Own Host Provider on a local workstation using: - -- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) for provisioning a management cluster -- [Docker](https://docs.docker.com/engine/install/) run for creating hosts to be used as a capacity for BYO Host machines -- [BYOH](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost) provider to add the above hosts to the aforemention workload cluster -- [Tilt](https://docs.tilt.dev/install.html) for faster iterative development - -## Pre-requisites - -It is required to have a docker image to be used when doing docker run for creating hosts - -__Clone BYOH Repo__ -```shell -git clone git@github.com:vmware-tanzu/cluster-api-provider-bringyourownhost.git -``` - -## Setting up the management cluster - -### Creates the Kubernetes cluster - -We are using [kind](https://kind.sigs.k8s.io/) to create the Kubernetes cluster that will be turned into a Cluster API management cluster later in this doc. - -```shell -cat > kind-cluster.yaml < tilt-settings.json <1``` -```shell -for i in {1..n} -do -echo "Creating docker container host $i" -docker run --detach --tty --hostname host$i --name host$i --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run --volume /var --volume /lib/modules:/lib/modules:ro --network kind byoh/node:v1.22.0 -echo "Copy agent binary to host $i" -docker cp bin/byoh-hostagent-linux-amd64 host$i:/byoh-hostagent -echo "Copy kubeconfig to host $i" -docker cp ~/.kube/management-cluster.conf host$i:/management-cluster.conf -done -``` - -Start the host agent on the host and keep it running - -```shell -docker exec -it $HOST_NAME bin/bash - -./byoh-hostagent --kubeconfig management-cluster.conf -``` - -Repeat the same steps with by changing the `HOST_NAME` env variable for all the hosts that you created. - -Check if the hosts registered itself into the management cluster. - -Open another shell and run -```shell -kubectl get byohosts -``` - -Open a new shell and change directory to `cluster-api-provider-bringyourownhost` repository. Run below commands - -```shell -export CLUSTER_NAME="test1" -export NAMESPACE="default" -export KUBERNETES_VERSION="v1.22.0" -export CONTROL_PLANE_MACHINE_COUNT=1 -export WORKER_MACHINE_COUNT=1 -export CONTROL_PLANE_ENDPOINT_IP= -``` - -From ```cluster-api-provider-bringyourownhost``` folder - -```shell -cat test/e2e/data/infrastructure-provider-bringyourownhost/v1beta1/cluster-template-byoh.yaml | envsubst | kubectl apply -f - -``` - -```shell -kubectl get machines -``` - -Dig into host when machine gets provisioned. - -```shell -kubectl get kubeadmconfig - -kubectl get BYOmachines - -kubectl get BYOhost -``` - -Deploy a CNI solution - -```shell -kubectl get secret $CLUSTER_NAME-kubeconfig -o jsonpath='{.data.value}' | base64 -d > $CLUSTER_NAME-kubeconfig -kubectl --kubeconfig $CLUSTER_NAME-kubeconfig apply -f test/e2e/data/cni/kindnet/kindnet.yaml -``` - -After a short while, our nodes should be running and in Ready state. -Check the workload cluster - -```shell -kubectl --kubeconfig $CLUSTER_NAME-kubeconfig get nodes -``` - -Or peek at the host agent logs. -## Cleanup - -```shell -kubectl delete cluster $CLUSTER_NAME -docker rm -f $HOST_NAME -kind delete cluster -``` - -# Host Agent Installer -The installer is responsible for detecting the BYOH OS, downloading a BYOH bundle and installing/uninstalling it. - -## Supported OS and kubernetes -The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name can be retrieved like this: -```shell -./cli --list-supported -``` - -## Creating a BYOH Bundle -### Kubernetes Ingredients -Optional. This step describes downloading upstream kubernetes host components for Debian. -```shell -# Build docker image -(cd agent/installer/bundle_builder/ingredients/deb/ && docker build -t byoh-ingredients-deb .) - -# Create a directory for the ingredients and download to it -(mkdir -p byoh-ingredients-download && docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients byoh-ingredients-deb) -``` -### Custom Ingredients -This step describes providing custom kubernetes host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: -```shell -*containerd*.tar -*kubeadm*.deb -*kubelet*.deb -*kubectl*.deb -*cri-tools*.deb -*kubernetes-cni*.deb -``` - -## Building a BYOH Bundle -```shell -#Build docker image -(cd agent/installer/bundle_builder/ && docker build -t byoh-build-push-bundle .) -``` - -```shell -# Build a BYOH bundle and publish it to an OCI-compliant repo -docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients --env BUILD_ONLY=0 build-push-bundle / -``` - -The bundle name must match one reported by ./cli --list-supported. [Custom foo description](## Supported OS and kubernetes) - -```shell -# You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory -# This can be used for custom pushing -docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle --env BUILD_ONLY=1 build-push-bundle -``` - -```shell -# Optionally, additional configuration can be included in the bundle by mounting a local path under /config of the container. It will be placed on top of any drop-in configuration created by the packages and tars in the bundle -docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle -v`pwd`/agent/installer/bundle_builder/config/ubuntu/20_04/k8s/1_22 --env BUILD_ONLY=1 build-push-bundle -``` - -## CLI -The installer CLI exposes the installer package as a command line tool. For a list of all commands, run - -```shell -./cli --help -``` - -Some examples: -```shell -# Will return if/how the current OS is detected -./cli --detect -``` - -```shell -# Will return the OS changes that installer will make during install and uninstall without actually doing them. -./cli --preview-os-changes --os Ubuntu_20.04.*_x86-64 --k8s v1.22.3 -``` - -```shell -# Will detect the current OS and install BYOH bundle with kubernetes v1.22.3 from the default repo -sudo ./cli --install --k8s v1.22.3 -``` - -```shell -# Will override the OS detection and will use custom repo -sudo ./cli --install --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 -``` - -```shell -# Will override the OS detection, use custom repo and uninstall -sudo ./cli --uninstall --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 -``` From cea297fceb3fe3bbecc1cb03dd5e807d4b643230 Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 08:33:42 +0100 Subject: [PATCH 5/8] fix comments --- docs/local_dev.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/local_dev.md b/docs/local_dev.md index be33e03bf..01f2a715c 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -183,15 +183,21 @@ kind delete cluster # Host Agent Installer The installer is responsible for detecting the BYOH OS, downloading a BYOH bundle and installing/uninstalling it. -## Supported OS and kubernetes -The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name can be retrieved like this: +## Supported OS and Kubernetes +The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name can be retrieved with: ```shell ./cli --list-supported ``` +An example output looks like: +``` +OS K8S Version BYOH Bundle Name +--- ----------- ---------------- +Ubuntu_20.04.*_x86-64 v1.22.3 byoh-bundle-ubuntu_20.04.1_x86-64_k8s_v1.22.3 +``` ## Creating a BYOH Bundle ### Kubernetes Ingredients -Optional. This step describes downloading upstream kubernetes host components for Debian. +Optional. This step describes downloading kubernetes host components for Debian. ```shell # Build docker image (cd agent/installer/bundle_builder/ingredients/deb/ && docker build -t byoh-ingredients-deb .) @@ -221,12 +227,10 @@ This step describes providing custom kubernetes host components. They can be cop docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients --env BUILD_ONLY=0 build-push-bundle / ``` -The bundle name must match one reported by ./cli --list-supported. -[Custom foo description](## Supported OS and kubernetes) +The specified above BYOH Bundle name must match one of the [Supported OS and kubernetes BYOH bundle names](##supported-OS-and-kubernetes) ```shell -# You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory -# This can be used for custom pushing +# You can also build a tarball of the bundle without publishing. This will create a bundler.tar in the current directory and can be used for custom pushing docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients -v`pwd`:/bundle --env BUILD_ONLY=1 build-push-bundle ``` @@ -249,7 +253,7 @@ Some examples: ``` ```shell -# Will return the OS changes that installer will make during install and uninstall without actually doing them. +# Will return the OS changes that installer will make during install and uninstall without actually doing them ./cli --preview-os-changes --os Ubuntu_20.04.*_x86-64 --k8s v1.22.3 ``` @@ -259,11 +263,11 @@ sudo ./cli --install --k8s v1.22.3 ``` ```shell -# Will override the OS detection and will use custom repo +# Will override the OS detection and will use the specified repo sudo ./cli --install --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 ``` ```shell -# Will override the OS detection, use custom repo and uninstall +# Will override the OS detection, use the specified repo and uninstall sudo ./cli --uninstall --os Ubuntu_20.04.1_x86-64 --bundle-repo 10.26.226.219:5000/repo --k8s v1.22.3 ``` From b2befd99124a25e6fb9a83903208b867bf846cbd Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 08:45:32 +0100 Subject: [PATCH 6/8] html table --- docs/local_dev.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/local_dev.md b/docs/local_dev.md index 01f2a715c..23ff32e5f 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -189,11 +189,19 @@ The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name ./cli --list-supported ``` An example output looks like: -``` -OS K8S Version BYOH Bundle Name ---- ----------- ---------------- -Ubuntu_20.04.*_x86-64 v1.22.3 byoh-bundle-ubuntu_20.04.1_x86-64_k8s_v1.22.3 -``` + + + + + + + + + + + +
OSK8S VersionBYOH Bundle Name
Ubuntu_20.04.*_x86-64v1.22.3byoh-bundle-ubuntu_20.04.1_x86-64_k8s_v1.22.3
+The '*' in OS means that all Ubuntu 20.04 patches will be handled by this BYOH bundle. ## Creating a BYOH Bundle ### Kubernetes Ingredients @@ -246,7 +254,9 @@ The installer CLI exposes the installer package as a command line tool. For a li ./cli --help ``` -Some examples: +In the following examples, the os and k8s flags, must match one of the [Supported OS and kubernetes BYOH bundle names](##supported-OS-and-kubernetes) + +Examples: ```shell # Will return if/how the current OS is detected ./cli --detect From 34d5be5e5f21acac4b128206a242b8a0de352176 Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 14:07:57 +0100 Subject: [PATCH 7/8] pre-reqs --- docs/local_dev.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/local_dev.md b/docs/local_dev.md index 23ff32e5f..a73cf2939 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -203,6 +203,16 @@ An example output looks like: The '*' in OS means that all Ubuntu 20.04 patches will be handled by this BYOH bundle. +## Pre-requisites +As of writing this, the following packages must be pre-installed on the BYOH host: +- socat +- ebtables +- ethtool +- conntrack +```shell +sudo apt-get install socat ebtables ethtool conntrack +``` + ## Creating a BYOH Bundle ### Kubernetes Ingredients Optional. This step describes downloading kubernetes host components for Debian. From c6b823f83e962b6ffb8d2659db05c2d4ecc1c70b Mon Sep 17 00:00:00 2001 From: ratanasov Date: Thu, 11 Nov 2021 14:16:59 +0100 Subject: [PATCH 8/8] address comments --- docs/local_dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/local_dev.md b/docs/local_dev.md index a73cf2939..d50284be0 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -224,7 +224,7 @@ Optional. This step describes downloading kubernetes host components for Debian. (mkdir -p byoh-ingredients-download && docker run --rm -v `pwd`/byoh-ingredients-download:/ingredients byoh-ingredients-deb) ``` ### Custom Ingredients -This step describes providing custom kubernetes host components. They can be copied to to byoh-ingredients-download. Files must match the following globs: +This step describes providing custom kubernetes host components. They can be copied to `byoh-ingredients-download`. Files must match the following globs: ```shell *containerd*.tar *kubeadm*.deb