{"id":20381540,"url":"https://github.com/snowdrop/k8s-infra","last_synced_at":"2025-04-12T08:53:26.806Z","repository":{"id":37395758,"uuid":"125180845","full_name":"snowdrop/k8s-infra","owner":"snowdrop","description":"Information to bootstrap vms using dedicated server, local machine and setup using Ansible Playbooks","archived":false,"fork":false,"pushed_at":"2024-04-22T10:39:09.000Z","size":14447,"stargazers_count":29,"open_issues_count":28,"forks_count":14,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-12T08:53:20.332Z","etag":null,"topics":["ansible","ansible-playbooks","cloud","infrastructure-as-code","kind","kubernetes","minikube","openshift","utilities"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snowdrop.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-14T08:36:23.000Z","updated_at":"2023-10-04T23:06:30.000Z","dependencies_parsed_at":"2023-12-14T12:07:01.450Z","dependency_job_id":null,"html_url":"https://github.com/snowdrop/k8s-infra","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowdrop%2Fk8s-infra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowdrop%2Fk8s-infra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowdrop%2Fk8s-infra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowdrop%2Fk8s-infra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snowdrop","download_url":"https://codeload.github.com/snowdrop/k8s-infra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543882,"owners_count":21121838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-playbooks","cloud","infrastructure-as-code","kind","kubernetes","minikube","openshift","utilities"],"created_at":"2024-11-15T02:14:14.695Z","updated_at":"2025-04-12T08:53:26.780Z","avatar_url":"https://github.com/snowdrop.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Automating the deployment of a kubernetes/ocp cluster\nSnowdrop Team (Charles Moulliard, Antonio Costa)\n:icons: font\n:revdate: {docdate}\n:toc: left\n:toclevels: 3\nifdef::env-github[]\n:tip-caption: :bulb:\n:note-caption: :information_source:\n:important-caption: :heavy_exclamation_mark:\n:caution-caption: :fire:\n:warning-caption: :warning:\nendif::[]\n\n== Introduction\n\n[.lead]\nThis project details the `prerequisites` and `steps` necessary to automate the installation of a Kubernetes (aka k8s) cluster or Openshift 4 top of one of the following cloud provider:\n\n* Red Hat https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/[OpenStack] (RHOS-PSI)\n* Red Hat https://github.com/resource-hub-dev[ResourceHub] - Work in progress\n* IBM Cloud\n* Hetzner\n* Kind**\n\nNOTE: kind is not a cloud provider but a tool able to run a k8s cluster on a container engine\n\n== Before you start\n\n[WARNING]\n====\nAll the commands mentioned on this project are to be executed at the root folder of the repository, except if stated otherwise.\n====\n\n== Prerequisites\n\nThis project uses Ansible. Check the link:ansible/README.adoc[Ansible Document] for the\ninstallation and usage instructions.\n\nTo use the scripts, playbooks, part of this project, some prerequisites are needed. It is not mandatory to install\nall of them and the following chapters will mention which ones are needed. \n\n* https://kind.sigs.k8s.io/docs/user/quick-start/#installation[kind]\n* https://docs.docker.com/engine/install/[Docker] or https://podman.io/docs/installation[podman]\n* https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-and-upgrading-ansible[Ansible]. Version \u003e= 2.14\n* https://www.python.org/downloads/[Python]. Version \u003e= 3.11\n* https://www.passwordstore.org/[passwordstore]\n* https://github.com/hetznercloud/cli[hcloud] (optional)\n* \n\n=== Python\n\nSeveral requirements are provided as Python libraries, including Ansible, \n and are identified on the link:requirements.txt[] file.\n\nUsing a Python Virtual Environment is recommended and can be created using \n the following command:\n\n[source,bash]\n----\npython3 -m venv .snowdrop-venv\n----\n\nAfter creating the virtual environment start using it with the following command:\n\n[source,bash]\n----\nsource .snowdrop-venv/bin/activate\n----\n\nThe venv will be in use when the `(.snowdrop-venv)` prefix is shown on the bash prompt.\n\nThe python requirements can be installed by executing:\n\n[source,bash]\n----\npip3 install -r requirements.txt\n----\n\n[NOTE]\n====\nFor more information check the link:ansible/README.adoc#python-venv[Python Virtual Env] section on our Ansible README. \n====\n\n=== Ansible\n\nSeveral Ansible Galaxy collections are used as part of this project and \n are listed in the link:collections/requirements.yml[] file. \n To install them execute the following command.\n\n[source,bash]\n----\nansible-galaxy collection install -r ./collections/requirements.yml --upgrade\n----\n\n=== Kind\n\n_Tools: docker (or podman), kind_\n\nTo automate the installation of a k8s \"kind\" cluster locally like also to set up an ingress controller or a docker container registry,\nuse our opinionated xref:kind/README.adoc[bash scripts] :-).\n\nYou can find more information about kind tool using the official documentation - https://kind.sigs.k8s.io/docs/user/quick-start/\n\n=== Minikube\n\n_Tools: docker (or podman), minikube_\n\nSee the https://kubernetes.io/docs/tasks/tools/install-minikube/[official documentation] to install `minikube` on Macos, Linux or Windows\n\n== Cloud provider\n\nThe provisioning process towards the cloud providers relies on the following assumptions:\n\n- Password store is installed/configured and needed k/v created\n- Flavor, volume, capacity (cpu/ram/volume) and OS can be mapped with the playbook of the target cloud provider\n- Permissions have been set to allow to provision a VM top of the target cloud provider\n- SSH key exist and has been imported (or could be created during provisioning process)\n\nand will include the following basic steps:\n\n- Create a VM, mount a volume and import the SSH key\n- Execute a pos installation script to install some needed services\n- Register the Hostnames against the domain name (using Lets'encrypt and DNS provider)\n- Deploy an ocp4 cluster and configure the different ingress routes to access the console, API, registry, etc\n\nNOTE: Optionally, we could also install different kubernetes tools if we would like to access/use the VM\n(e.g. kubectl, oc, helm, k9s, konfig, ect - see tooling section).\n\n=== Red Hat\n\nThis section details how to provision an Openshift 4 cluster using one of Red Hat environments available such as:\n\n==== OpenStack - RHOS PSI\n\n_Tools: password store, ansible_\n\nThe link:openstack/README.adoc[OpenStack] page explains the process using \n the RHOS cloud provider.\n\n==== https://resourcehub.redhat.com/[Resource Hub]\n\n_Tools: password store, ansible_\n\nWork in progress\n\n=== IBM Cloud\n\n_Tools: password store, ansible_\n\nSee xref:ibm-cloud/README.adoc[ibm-cloud]\n\n=== Hetzner\n\n==== Bare metal\n\n_Tools: password store, ansible, hcloud_\n\nSee xref:hetzner/README.adoc[hetzner] page explaining how to create a vm.\n\n==== Virtualized machine\n\n_Tools: password store, ansible, hcloud_\n\nSee xref:hetzner/README-cloud.adoc[hetzner-cloud] page explaining how to create a cloud vm.\n\n== Cluster Deployment\n\nAs the vm is now running and the docker daemon is up, you can install your `k8s` distribution using either one of the following approaches :\n\n=== Kubernetes\n\nYou can then use the following instructions to install a Kubernetes cluster with the help of Ansible and the xref:doc/k8s.adoc[roles we created]\n\n=== OpenShift\n\n* Simple using the `oc` binary tool and the command https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md[oc cluster up] within the vm\n* More elaborated using `Ansible` tool and one of the following playbook/role:\n ** `oc cluster up` xref:doc/oc.adoc[role]\n ** `openshift-ansible` all-in-one playbook as described xref:doc/cloud.adoc[here]\n\n== Sandbox\n\nxref:sandbox/sandbox.adoc[Material] not actively maintained to create a VM, run on your desktop a k8s cluster or provision it with Istio, Jaeger, Fabric8 launcher, Ansible Broker catalog, etc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowdrop%2Fk8s-infra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnowdrop%2Fk8s-infra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowdrop%2Fk8s-infra/lists"}