{"id":24468524,"url":"https://github.com/mlouguid/k8s-Ansible","last_synced_at":"2025-03-14T13:23:13.664Z","repository":{"id":273438938,"uuid":"901259888","full_name":"mlouguid/k8b-Ansible","owner":"mlouguid","description":"Install and configure k8b using Ansible.","archived":false,"fork":false,"pushed_at":"2025-01-20T22:38:34.000Z","size":469,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T23:24:19.938Z","etag":null,"topics":["ansible","k8s","kubernetes"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlouguid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T10:32:33.000Z","updated_at":"2025-01-20T22:39:36.000Z","dependencies_parsed_at":"2025-01-20T23:34:40.727Z","dependency_job_id":null,"html_url":"https://github.com/mlouguid/k8b-Ansible","commit_stats":null,"previous_names":["mlouguid/k8b-ansible"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlouguid%2Fk8b-Ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlouguid%2Fk8b-Ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlouguid%2Fk8b-Ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlouguid%2Fk8b-Ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlouguid","download_url":"https://codeload.github.com/mlouguid/k8b-Ansible/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234909107,"owners_count":18905505,"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","k8s","kubernetes"],"created_at":"2025-01-21T07:11:56.782Z","updated_at":"2025-03-14T13:23:12.821Z","avatar_url":"https://github.com/mlouguid.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"static/img/image.png\" width=\"600\"\u003e\n\u003c/p\u003e\n\n# Kubernetes Deployment Using Ansible\n\nThis guide outlines the steps to deploy Kubernetes on a target machine or cluster using Ansible. The playbook automates the installation and configuration of Kubernetes components on the target system.\n\n## Prerequisites\n\nBefore you begin, ensure the following prerequisites are met:\n\n- A **control machine** where Ansible is installed.  \n  You can install Ansible using the following commands:\n  - For Ubuntu/Debian:\n    ```bash\n    sudo apt update\n    sudo apt install ansible\n    ```\n\n- A **target machine** (or multiple nodes) where:\n  - Python 3 is installed and accessible.\n  - `sudo` privileges are available for the user running the Ansible playbook.\n\n## Step 1: Setting Up the Inventory File\n\nCreate an inventory file to define the hosts (target machine) for Kubernetes deployment. The following example shows how to configure the target machine IP:\n\n```yaml\nall:\n  children:\n    kubernetes:\n      hosts:\n        localhost:\n          ansible_connection: local\n          ansible_python_interpreter: /usr/bin/python3\n```\n## Step 2: Cloning the Project\n\nClone the Kubernetes deployment project from the repository (or use your own project):\n```\ngit clone https://github.com/mlouguid/k8b-Ansible.git\ncd k8b-Ansible\n```\n## Step 3: Kubernetes Role Structure\n\nEnsure your kubernetes role has the following directory structure:\n```\nroles/\n└── kubernetes/\n    ├── tasks/\n    │   ├── main.yml\n    │   ├── install_k8s.yml\n    │   ├── containerd.yml\n    │   └── kube_prereqs.yml\n    ├── handlers/\n      └── main.yml\n```\n## step 4: deploy the playbook\n```\nansible-playbook kubernetes_playbook.yml -i inventories/local/hosts --limit=kubernetes --ask-become-pass\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlouguid%2Fk8s-Ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlouguid%2Fk8s-Ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlouguid%2Fk8s-Ansible/lists"}