-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-to-kubernetes.yml
More file actions
47 lines (47 loc) · 1.08 KB
/
deploy-to-kubernetes.yml
File metadata and controls
47 lines (47 loc) · 1.08 KB
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
42
43
44
45
46
47
- name: Deploy and expose application
hosts: localhost
gather_facts: no
vars:
animal: cow
tasks:
- name: Create a deployment
kubernetes.core.k8s:
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: animals
name: animals
namespace: default
spec:
replicas: 3
selector:
matchLabels:
app: animals
template:
metadata:
labels:
app: animals
spec:
containers:
- image: ghcr.io/cicd-tutorials/animals:{{ animal }}
name: animals
- name: Expose the deployment
kubernetes.core.k8s:
definition:
apiVersion: v1
kind: Service
metadata:
labels:
app: animals
name: animals
namespace: default
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: animals
type: LoadBalancer