• Stars
    star
    713
  • Rank 63,511 (Top 2 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vagrantfile & Scripts to setup Kubernetes Cluster using Kubeadm for CKA, CKAD and CKS practice environment

Vagrantfile and Scripts to Automate Kubernetes Setup using Kubeadm [Practice Environment for CKA/CKAD and CKS Exams]

Documentation

Current k8s version for CKA, CKAD, and CKS exam: 1.27

Refer to this link for documentation: https://devopscube.com/kubernetes-cluster-vagrant/

๐Ÿš€ CKA, CKAD, CKS, or KCNA Coupon Codes

๐Ÿš€ CKA, CKAD, CKS, or KCNA exam aspirants can save $80 today using code DCUBE20 atย https://kube.promo/devops. It is a limited-time offer from the Linux Foundation.

For the best savings, opt for the CKA + CKS bundle ($210 Savings). Use code DCUBE20 at https://kube.promo/bundle

Note: You have one year of validity to appear for the certification exam after registration

Prerequisites

  1. Working Vagrant setup
  2. 8 Gig + RAM workstation as the Vms use 3 vCPUS and 4+ GB RAM

For MAC/Linux Users

The latest version of Virtualbox for Mac/Linux can cause issues.

Create/edit the /etc/vbox/networks.conf file and add the following to avoid any network related issues.

* 0.0.0.0/0 ::/0

or run below commands

sudo mkdir -p /etc/vbox/
echo "* 0.0.0.0/0 ::/0" | sudo tee -a /etc/vbox/networks.conf

So that the host only networks can be in any range, not just 192.168.56.0/21 as described here: https://discuss.hashicorp.com/t/vagrant-2-2-18-osx-11-6-cannot-create-private-network/30984/23

Bring Up the Cluster

To provision the cluster, execute the following commands.

git clone https://github.com/scriptcamp/vagrant-kubeadm-kubernetes.git
cd vagrant-kubeadm-kubernetes
vagrant up

Set Kubeconfig file variable

cd vagrant-kubeadm-kubernetes
cd configs
export KUBECONFIG=$(pwd)/config

or you can copy the config file to .kube directory.

cp config ~/.kube/

Install Kubernetes Dashboard

The dashboard is automatically installed by default, but it can be skipped by commenting out the dashboard version in settings.yaml before running vagrant up.

If you skip the dashboard installation, you can deploy it later by enabling it in settings.yaml and running the following:

vagrant ssh -c "/vagrant/scripts/dashboard.sh" master

Kubernetes Dashboard Access

To get the login token, copy it from config/token or run the following command:

kubectl -n kubernetes-dashboard get secret/admin-user -o go-template="{{.data.token | base64decode}}"

Proxy the dashboard:

kubectl proxy

Open the site in your browser:

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/overview?namespace=kubernetes-dashboard

To shutdown the cluster,

vagrant halt

To restart the cluster,

vagrant up

To destroy the cluster,

vagrant destroy -f

More Repositories

1

kubernetes-learning-path

A roadmap to learn Kubernetes from scratch (Beginner to Advanced level)
6,775
star
2

kubernetes-prometheus

Kubernetes Manifest files for setting up Prometheus monitoring on the Kubernetes cluster.
377
star
3

python-for-devops

Python for DevOps repo with useful python scripts to learn and implement in your day-to-day devops automation tasks.
Python
277
star
4

devops-projects

DevOps Real World Projects for Aspiring DevOps Engineers [Beginner to Advanced]
HCL
219
star
5

devops-tools

Curated List of Best DevOps Tools
136
star
6

how-to-mlops

Curated list of resources to learn MLOPS
75
star
7

kubeadm-scripts

Scripts & Kubernetes manifests for Kubeadm Kubernetes cluster setup
Shell
52
star
8

jenkins-shared-library

A Jenkins shared library code examples with Jenkinfiles
Groovy
35
star
9

packer-templates

Hashicorp packer Tempaltes for learning
HCL
15
star
10

podman

Podman examples
HTML
12
star
11

pipeline-as-code-demo

demo for pipeline as code
10
star
12

helm-tutorial

helm Chart examples and tutorial resoruces
9
star
13

kubernetes-certification-guide

CKA, CKAD, CKS & KCNA Free Certification Guides
Shell
9
star
14

docker-image-examples

Dockerfile examples for different applications.
HTML
7
star
15

eksctl

AWS EKS example cluster configurations using eksctl
5
star
16

devops-kit

Essential Tool Kit for DevOps
4
star
17

java-demo

Java Spring Boot Demo Application To Learn Java CI/CD
3
star
18

aws-cli

AWS CLI examples for ec2, IAM, s3, EKS and Other Services
3
star
19

ansible-playbook-examples

3
star
20

techiescamp

Config files for my GitHub profile.
3
star
21

aws-cloudwatch-agent

Configurations for Custom application logs and metrics using cloudwatch agent
2
star
22

consul-demo

Service Discovery demo using Consul
2
star
23

gitlab-tutorial

HCL
1
star
24

kubernetes-projects

Practical real-world hands-on projects to practice and learn Kubernetes implementations
1
star
25

aws-devops

Tasks to Learn DevOps With AWS Cloud
1
star
26

argocd-guide

Resources & examples to master ArgoCD
1
star