File tree 13 files changed +45
-14
lines changed
13 files changed +45
-14
lines changed Original file line number Diff line number Diff line change
1
+ * .swp
Original file line number Diff line number Diff line change 1
- ansible_ssh_private_key_file : " ../terraform-prov-aws/K8S-DEMO-key.pem"
1
+ # ansible_ssh_private_key_file: "../terraform-prov-aws/K8S-DEMO-key.pem"
Original file line number Diff line number Diff line change
1
+ [tag_Role_master]
2
+ 200.137.215.86
3
+
4
+ [tag_Role_worker]
5
+ 200.137.215.87
6
+ 200.137.215.88
7
+ 200.137.215.89
8
+
9
+ [all:vars]
10
+ ansible_port =42112
Original file line number Diff line number Diff line change
1
+ ansible-playbook -u ${1:- default-user} -i hosts site.yml ${@: 2}
Original file line number Diff line number Diff line change 1
1
- name : Install k8s and docker packages
2
2
become : yes
3
- hosts : tag_Type_k8s
3
+ hosts : all
4
4
roles :
5
5
- k8s-all
6
6
Original file line number Diff line number Diff line change 1
-
2
1
# K8S Single Cluster spinup
3
2
This is a project willing to summarize some of the DevOps topics.
4
3
## Used Tools
5
4
The main idea was to use as much tools as I could:
6
5
7
- - Docker
8
6
- Ansible
9
- - Terraform
10
- - Drone CI
11
7
- AWS
12
8
- Kubernetes
13
9
14
10
## How does it work?
15
11
16
- - Terraform creates the 3 AWS instances, Security Group and a Keypair.
17
- - Ansible installs and configure Kubernetes.
18
- - They work together on a Drone CI pipeline.
19
- - The Drone CI uses a Docker container that I have created with Terraform and Ansible there.
12
+ - Ansible installs and configure Kubernetes over AWS env or local VMs env.
20
13
21
14
## The goal
22
- The goal is just to setup a Kubernetes cluster within 3 AWS instances.
15
+ The goal is just to setup a Kubernetes cluster within instances.
16
+
17
+ ## Run Local
18
+ Update variables ansible-k8s-KEY.perm @ groups_vars/all.yaml
19
+ Run the script run-local.sh
20
+
21
+ ## If nodes not connecting run
22
+
23
+ ``` bash
24
+ kubeadm join --token b0f7b8.8d1767876297d85c \
25
+ --discovery-token-unsafe-skip-ca-verification \
26
+ 200.137.215.86:6443
27
+ ```
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ kubeadm_opts: ""
7
7
8
8
master_ip : " {{ hostvars[groups['tag_Role_master'][0]]['ansible_default_ipv4'].address | default(groups['tag_Role_master'][0]) }}"
9
9
10
- ansible_ssh_private_key_file : " ../terraform-prov-aws/K8S-DEMO-key.pem"
10
+ # ansible_ssh_private_key_file: "../terraform-prov-aws/K8S-DEMO-key.pem"
Original file line number Diff line number Diff line change
1
+ [tag_Role_master]
2
+ 200.137.215.86
3
+
4
+ [tag_Role_worker]
5
+ 200.137.215.87
6
+ 200.137.215.88
7
+ 200.137.215.89
8
+
9
+ [all:vars]
10
+ ansible_port =42112
Original file line number Diff line number Diff line change 4
4
# rm -r ~/.kube/
5
5
6
6
- name : Initialize k8s cluster
7
+ tags : init
7
8
command :
8
9
kubeadm init --service-cidr {{ service_cidr }} \
9
10
--pod-network-cidr {{ pod_network_cidr }} \
20
21
KUBECONFIG : " /etc/kubernetes/admin.conf"
21
22
22
23
- name : Install Ingress pod
23
- shell : kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/f0f9b5262b993c4800726cb5d59f6da3b8a3dc4e/Documentation/kube-flannel.yml
24
+ shell : kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.2/deploy/static/provider/cloud/deploy.yaml
24
25
environment :
25
26
KUBECONFIG : " /etc/kubernetes/admin.conf"
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ ansible-playbook -u ${1:- default-user} -i hosts site.yml ${@: 2}
Original file line number Diff line number Diff line change 1
1
- name : Install k8s and docker packages
2
2
become : yes
3
- hosts : tag_Type_k8s
3
+ hosts : all
4
4
roles :
5
5
- docker
6
6
- k8s-all
Original file line number Diff line number Diff line change
1
+ U$XqlXM8Rfs8!UR0
2
+
You can’t perform that action at this time.
0 commit comments