-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathporter.yaml
248 lines (215 loc) · 8.24 KB
/
porter.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# This is the configuration for Porter
# You must define steps for each action, but the rest is optional
# See https://porter.sh/author-bundles for documentation on how to configure your bundle
# Uncomment out the sections below to take full advantage of what Porter can do!
name: cncf-projects-app
version: 0.1.8
description: "A bundle that installs and removes the CNCF demo project and its resources. This application installs ngnix ingresses, Harbor, cert-manager & letsencrypt, rook/ceph, openfaas, and jaeger and prometheus, mysql|vitess, Linkerd, and Tekton."
tag: ghcr.io/squillace/cncf-projects-app/cncf
# Moves mixins up to the top for faster bundle dev iteration
dockerfile: Dockerfile.tmpl
mixins:
- exec
- kubernetes
- helm3:
clientVersion: v3.3.4
repositories:
# Add the official stable repository
stable:
url: "https://kubernetes-charts.storage.googleapis.com"
# Install nginx ingress for Harbor
ingress-nginx:
url: "https://kubernetes.github.io/ingress-nginx"
# Add the Jetstack Helm repository
jetstack:
url: "https://charts.jetstack.io"
# Add the harbor helm repo
harbor:
url: "https://helm.goharbor.io"
# Add the OpenFaas helm repo
openfaas:
url: "https://openfaas.github.io/faas-netes/"
# Add the Jaeger helm repo
jaegertracing:
url: "https://jaegertracing.github.io/helm-charts"
install:
- exec:
command: bash
description: "Creating the ingress namespace."
flags:
c: '"kubectl create namespace {{bundle.parameters.ingress-namespace}}"'
- helm3:
description: "Use Helm to deploy an NGINX ingress controller."
upsert: true # uses "helm3 upgrade --install" instead of install. Can't use --replace.
name: nginx-ingress # parameterize
chart: stable/nginx-ingress
# version: CHART_VERSION
namespace: "{{bundle.parameters.ingress-namespace}}"
# replace: true # removed to enable upsert behavior
wait: true # default true
set:
controller.replicaCount: 2
controller.nodeSelector."beta\.kubernetes\.io/os": linux
defaultBackend.nodeSelector."beta\.kubernetes\.io/os": linux
- kubernetes:
description: "Installing Rook."
manifests:
- "yml/rook-common.yaml"
- "yml/rook-operator.yaml"
- "yml/rook-cluster.yaml"
- "yml/rook-storageclass.yaml"
validate: true
wait: true
- exec:
command: bash
description: "Creating the harbor system ingress namespace."
flags:
c: '"kubectl create namespace {{bundle.parameters.harbor-ingress-namespace}}"'
- helm3:
description: "Use Helm to deploy the Harbor nginx ingress controller."
upsert: true # uses "helm3 upgrade --install" instead of install. Can't use --replace.
name: harbor-nginx-ingress # parameterize
chart: ingress-nginx/ingress-nginx
# version: CHART_VERSION
namespace: "{{bundle.parameters.harbor-ingress-namespace}}"
# replace: true # removed to enable upsert behavior
wait: true # default true
set:
controller.replicaCount: 2
controller.nodeSelector."beta\.kubernetes\.io/os": linux
defaultBackend.nodeSelector."beta\.kubernetes\.io/os": linux
- exec:
command: bash
description: "Label harbor ingress namespace for cert-manager...."
flags:
c: '"kubectl label namespace {{bundle.parameters.harbor-ingress-namespace}} cert-manager.io/disable-validation=true"'
# kubectl label namespace harbor-ingress-system cert-manager.io/disable-validation=true
- exec:
command: bash
description: "Label ingress namespace for cert-manager...."
flags:
c: '"kubectl label namespace {{bundle.parameters.ingress-namespace}} cert-manager.io/disable-validation=true"'
# kubectl label namespace ingress-basic cert-manager.io/disable-validation=true
- helm3:
description: "Use Helm to deploy the Harbor nginx ingress controller."
upsert: true # uses "helm3 upgrade --install" instead of install. Can't use --replace.
name: cert-manager # parameterize
chart: jetstack/cert-manager
version: v0.16.1
namespace: "{{bundle.parameters.ingress-namespace}}"
# replace: true # removed to enable upsert behavior
wait: true
set:
installCRDs: true
nodeSelector."beta\.kubernetes\.io/os": linux
- exec:
command: bash
description: "Installing the cluster issuer to work with cert manager...."
arguments:
- "cluster-issuer.sh"
- "{{bundle.parameters.cert-email-address}}"
- exec:
description: "Getting the harbor system ingress IP address...."
command: "kubectl"
suppress-output: true
arguments:
- "get"
- "service"
- "harbor-nginx-ingress-ingress-nginx-controller"
flags:
o: "json"
namespace: "{{bundle.parameters.harbor-ingress-namespace}}"
outputs:
- name: "harbor-lb-ip"
jsonPath: "$.status.loadBalancer.ingress[0].ip"
# - kubernetes:
# description: "apply vitess"
# manifests:
# - "vitess/examples/operator/operator.yaml"
# - "vitess/examples/operator/101_initial_cluster.yaml"
# validate: true
# wait: true
upgrade:
- exec:
description: "TODO: understand what upgrade of this might mean."
command: bash
flags:
c: '"echo Not yet implemented."'
uninstall:
- exec:
command: bash
description: "Deleting the cluster issuer to work with cert manager...."
arguments:
- "delete-cluster-issuer.sh"
- "{{bundle.parameters.cert-email-address}}"
- helm3:
description: "Deleting the cert manager chart resources."
namespace: "{{bundle.parameters.ingress-namespace}}"
releases:
- "cert-manager" # parameterize?
- helm3:
description: "Deleting the harbor ingress Helm chart resources."
namespace: "{{bundle.parameters.harbor-ingress-namespace}}"
releases:
- "harbor-nginx-ingress" # parameterize?
- exec:
description: "Deleting the harbor ingress namespace... "
command: kubectl
arguments:
- delete
- namespace
- "{{bundle.parameters.harbor-ingress-namespace}}"
- kubernetes:
description: "Uninstalling Rook...."
manifests:
- "yml/rook-storageclass.yaml"
- "yml/rook-cluster.yaml"
- "yml/rook-operator.yaml"
# - "yml/rook-common.yaml"
wait: true
- helm3:
description: "Deleting the basic ingress Helm chart resources."
namespace: "{{bundle.parameters.ingress-namespace}}"
releases:
- "nginx-ingress" # parameterize?
- exec:
description: "Deleting the basic ingress namespace... "
command: kubectl
arguments:
- delete
- namespace
- "{{bundle.parameters.ingress-namespace}}"
# until we figure out the race condition here, this will be the last task to purge your cluster
- exec:
command: bash
description: '"Now run \"cat yml/rook-common.yaml | kubectl delete -f -\" to delete the remaining detritus."'
suppress-output: true
flags:
c: '"cat yml/rook-common.yaml | kubectl delete -f -"'
# Below is an example of how to define credentials
# See https://porter.sh/author-bundles/#credentials
credentials:
- name: kubeconfig
type: file
path: /root/.kube/config
# Below is an example of how to define parameters
# See https://porter.sh/author-bundles/#parameters
parameters:
- name: ingress-namespace
description: "The namespace given to the basic ingress."
type: string
default: ingress-basic
- name: harbor-ingress-namespace
description: "The harbor system namespace."
type: string
default: harbor-ingress-system
- name: cert-email-address
description: "The email address passed to letsencrypt for the cluster issuer."
type: string
default: [email protected]
outputs:
- name: harbor-lb-ip
description: "The IP address assigned to the harbor ingress load balancer."
type: string
applyTo:
- install