Skip to content

fabiocruzcoelho/kubernetes

Repository files navigation

Welcome to kubernetes 👋

pipeline status Version Documentation License: MIT Twitter: fcruzcoelho

Deploy a simple cluster Kubernetes with kubeadm on instances GCP, AWS, and On-Premises for studies.

Table of contents

Install

The playbook deploy um cluster Kubernetes on version 1.18

Hardware requirements instances/VM's

Provider Master/Worker Instance Type Linux OS
Amazon Web Services t2.large/t3.large (2 vCPU, 4GB) Ubuntu 18.04
Google Cloud Platform custom (2 vCPU, 4GB) Ubuntu 18.04
On-Premises 2 vCPU, 5GB Ubuntu 18.04
git clone https://gitlab.com/estudosdevops/kubernetes.git

Usage

With the instances or VMs created and properly configured, and the inventory configured according to the sample.yml

# Example of usage with instance GCP, AWS
make run playbook=cluster  env=inventory/sample.yml args='-e "kube_master_ip=<ipaddress>"' tag=kubeadm,cluster
# Example of usage with VM's (In test)
make run playbook=cluster  env=inventory/sample.yml args='-e "kube_master_ip=<ipaddress>"' tag=kubeadm,cluster

Run tests

To test the playbook you can run a dry-run first.

make dry-run playbook=cluster  env=inventory/sample.yml args='-e "kube_master_ip=<ipaddress>"' tag=kubeadm,cluster
kubectl get nodes
NAME          STATUS   ROLES    AGE    VERSION
kube-master   Ready    master   157m   v1.18.6
kube-node1    Ready    <none>   157m   v1.18.6
kube-node2    Ready    <none>   157m   v1.18.6
kube-node3    Ready    <none>   157m   v1.18.6
kubectl get po --all-namespaces -o wide
NAMESPACE     NAME                                  READY   STATUS    RESTARTS   AGE    IP              NODE          NOMINATED NODE   READINESS GATES
kube-system   coredns-66bff467f8-bt98x              1/1     Running   0          160m   10.244.1.2      kube-node3    <none>           <none>
kube-system   coredns-66bff467f8-wqfkj              1/1     Running   0          160m   10.244.0.2      kube-master   <none>           <none>
kube-system   etcd-kube-master                      1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>
kube-system   kube-apiserver-kube-master            1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>
kube-system   kube-controller-manager-kube-master   1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>
kube-system   kube-flannel-ds-amd64-cvnqw           1/1     Running   0          160m   10.158.15.204   kube-node3    <none>           <none>
kube-system   kube-flannel-ds-amd64-gxjkz           1/1     Running   0          159m   10.158.15.202   kube-node1    <none>           <none>
kube-system   kube-flannel-ds-amd64-jck9l           1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>
kube-system   kube-flannel-ds-amd64-sb4fq           1/1     Running   0          159m   10.158.15.203   kube-node2    <none>           <none>
kube-system   kube-proxy-czjhn                      1/1     Running   0          159m   10.158.15.202   kube-node1    <none>           <none>
kube-system   kube-proxy-f8qx7                      1/1     Running   0          160m   10.158.15.204   kube-node3    <none>           <none>
kube-system   kube-proxy-m8kzz                      1/1     Running   0          159m   10.158.15.203   kube-node2    <none>           <none>
kube-system   kube-proxy-t9gvf                      1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>
kube-system   kube-scheduler-kube-master            1/1     Running   0          160m   10.158.15.200   kube-master   <none>           <none>

Author

👤 Fabio Coelho

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Fabio Coelho.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator