-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathrg.yaml
114 lines (111 loc) · 3.35 KB
/
rg.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
apiVersion: kro.run/v1alpha1
kind: ResourceGraphDefinition
metadata:
name: webapp.kro.run
spec:
weight: 150
schema:
apiVersion: v1alpha1
kind: WebApp
spec:
name: string
namespace: string | default=default
image: string | default=nginx
port: integer | default=8080
replicas: integer | default=1
service:
enabled: boolean | default=true
ingress:
enabled: boolean | default=false
serviceAccount: string | default=default
s3bucketName: string | default=""
status:
deploymentConditions: ${deployment.status.conditions}
availableReplicas: ${deployment.status.availableReplicas}
url: ${ingress.status.loadBalancer.ingress[0].hostname}
resources:
- id: deployment
readyWhen:
- ${deployment.spec.replicas == deployment.status.availableReplicas}
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${schema.spec.name}
namespace: ${schema.spec.namespace}
labels:
app.kubernetes.io/name: ${schema.spec.name}
spec:
replicas: ${schema.spec.replicas}
selector:
matchLabels:
app.kubernetes.io/name: ${schema.spec.name}
app: ${schema.spec.name}
template:
metadata:
labels:
app.kubernetes.io/name: ${schema.spec.name}
app: ${schema.spec.name}
spec:
serviceAccountName: ${schema.spec.serviceAccount}
containers:
- name: s3-demo
image: ${schema.spec.image}
imagePullPolicy: Always
ports:
- containerPort: ${schema.spec.port}
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "1"
env:
- name: S3_BUCKET_NAME
value: ${schema.spec.s3bucketName}
restartPolicy: Always
- id: service
includeWhen:
- ${schema.spec.service.enabled}
template:
apiVersion: v1
kind: Service
metadata:
name: ${deployment.metadata.name}
namespace: ${deployment.metadata.namespace}
spec:
selector:
app: ${schema.spec.name}
ports:
- name: http
protocol: TCP
port: 80
targetPort: ${schema.spec.port}
- id: ingress
includeWhen:
- ${schema.spec.ingress.enabled}
template:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${deployment.metadata.name}
namespace: ${deployment.metadata.namespace}
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-path: /health
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60
spec:
rules:
- http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: ${service.metadata.name}
port:
number: 80