File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Integrating Kubernetes cluster with Ansible --- In progress
2+
3+ 1 . Log into ansible server and copy public key onto Kubernetes cluster master account
4+
5+ 1 . update hosts file with a new group called Kubernetes and add Kubernetes master in that.
6+
7+ 1 . write playbooks to create a pods and services
8+
9+ #### create-deployment.yml
10+ ``` sh
11+ ----
12+ - name: Create pods using deployment
13+ hosts: kubernetes
14+ become: true
15+ user: root
16+
17+ tasks:
18+ - name: pull latest docker image
19+ command: docker pull yankils/simple-devops-image
20+
21+ - name: create a deployment
22+ command: kubectl apply -f valaxy-deploy.yml
23+ ```
24+
25+ # ### create-service.yml
26+ ` ` ` sh
27+ ---
28+ - name: create service for deployment
29+ hosts: kubernetes
30+ become: true
31+ user: root
32+
33+ tasks
34+ - name: create a service
35+ command: kubectl apply -f valaxy-service.yml
36+
37+ 1. Check for pods, deployments and services on kubernetes master
38+ ` ` ` sh
39+ kubectl get pods
40+ kubectl get deploy
41+ kubectl get service
42+ ```
43+
44+ 1. Access application suing Loadbalancer URL
45+ ```
46+ wget <service_ip>:8080
47+ http://<LoadBalancerURL >
48+
You can’t perform that action at this time.
0 commit comments