-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy1.yaml
42 lines (41 loc) · 1.24 KB
/
deploy1.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- hosts: localhost
connection: local
vars:
helm_chart_url: "https://charts.bitnami.com/bitnami"
deployment_name: "apache-server"
service_name: "apache-server"
tasks:
- name: Add Helm repo
kubernetes.core.helm_repository:
name: bitnami
repo_url: "{{ helm_chart_url }}"
- name: Install Nginx Chart
kubernetes.core.helm:
name: nginx-server
namespace: abhilash
create_namespace: true
chart_ref: bitnami/nginx
values:
replicaCount: 2
- name: Deploy Busbox to Kubernetes using Kubectl
kubernetes.core.k8s:
src: /home/abhilash/abhi/ansible/k8-yamls/busy.yaml
state: present
- name: Install Apache chart
kubernetes.core.helm:
name: "{{ deployment_name }}"
namespace: default
chart_ref: bitnami/apache
values:
replicaCount: 2
register: helm_output
- name: Retrieve service IP for Apache
kubernetes.core.k8s_info:
api_version: v1
kind: Service
name: "{{ service_name }}"
namespace: default
register: web_service
- name: Print service URL for Apache
debug:
msg: "http://{{ web_service.resources[0].spec.clusterIP }}:80"