- .gitignore: from a Bolt project created following https://www.puppet.com/docs/bolt/latest/bolt_installing_modules.html.
- Provision 2 or more CentOS 9 machines.
- Configure
local.yaml
for your environment. - Install modules by running this command:
On Windows, you can run:
bolt module install --force
.\InstallModules.ps1
- Provision controller on desired machine by running this command:
On Windows, you can run:
bolt plan run test_voxpupuli_puppet_k8s::myplan --targets <ControllerFqdn> --user <ControllerUsername> --password <ControllerPassword> --inventory inventory.yaml node_type=controller control_plane_url=https://<ControllerFqdn>:6443 etcd_servers=https://<ControllerFqdn>:2379 secret_16_char=<Secret16Char>
It should fails with this error:.\Build.ps1 -Target <ControllerFqdn> -User <ControllerUsername> -Pass <ControllerPassword> -NodeType controller -ControlPlaneUrl https://<ControllerFqdn>:6443 -EtcdServer https://<ControllerFqdn>:2379 -Secret16Char <Secret16Char>
Run the same command a second time, and it should succeed.Err: /Stage[main]/K8s::Server::Resources::Bootstrap/Kubectl_apply[puppet:cluster-info:reader Role]: Could not evaluate: Execution of '/bin/kubectl --namespace kube-system --kubeconfig /root/.kube/config get Role puppet:cluster-info:reader --output json' returned 1: error: the server doesn't have a resource type "Role"
- On the controller machine, copy /root/.kube/config to ~/.kube/config. Eg:
mkdir --parents $HOME/.kube sudo cp --interactive /srv/kubernetes/kube-controller-manager.kubeconf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
- Check Kubernetes cluster by running this command:
It should list something like this:
kubectl cluster-info
Kubernetes control plane is running at https://<ControllerFqdn>:6443 CoreDNS is running at https://<ControllerFqdn>:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
- Check Kubernetes namespaces by running this commands:
It should list something like this:
kubectl get namespaces
NAME STATUS AGE default Active 20m kube-node-lease Active 20m kube-public Active 20m kube-system Active 20m
- Check Kubernetes cluster by running this command:
- Provision worker on desired machines by running this command:
On Windows, you can run:
bolt plan run test_voxpupuli_puppet_k8s::myplan --targets <WorkerFqdn> --user <WorkerUsername> --password <WorkerPassword> --inventory inventory.yaml node_type=worker control_plane_url=https://<ControllerFqdn>:6443 etcd_servers=https://<ControllerFqdn>:2379 secret_16_char=<Secret16Char>
.\Build.ps1 -Target <WorkerFqdn> -User <WorkerUsername> -Pass <WorkerPassword> -NodeType worker -ControlPlaneUrl https://<ControllerFqdn>:6443 -EtcdServer https://<ControllerFqdn>:2379 -Secret16Char <Secret16Char>
- On the same controller machine as above:
- Check Kubernetes nodes by running this commands:
It should list something like this:
kubectl get nodes
NAME STATUS ROLES AGE VERSION <workerFqdn> Ready <none> 5h29m v1.26.1
- List the certificate signing request from the workers:
and approve them:
kubectl get csr --sort-by=.metadata.creationTimestamp
TODO: is there a way to automate that step?kubectl certificate approve '<csr-id>'
- Check Kubernetes nodes by running this commands:
-
Notifications
You must be signed in to change notification settings - Fork 0
GMZwinge/test-voxpupuli-puppet-k8s
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published