Skip to content

Commit a2a4562

Browse files
Add pipeline setup docs for addon compatibility upgrade processes (#505)
* Add pipeline setup docs for addon compatibility upgrade processes This hopefully should make that more clear, we should also just make it the default setup from `plural up` * bring back png
1 parent 6bca833 commit a2a4562

File tree

1 file changed

+164
-1
lines changed

1 file changed

+164
-1
lines changed

pages/plural-features/k8s-upgrade-assistant/addon-compatibilities.md

Lines changed: 164 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,167 @@ spec:
5858
5959
This will scrape the tables for (Ingress NGINX)[https://github.com/kubernetes/ingress-nginx] that are compatible with all of kubernetes versions 1.28, 1.29, and 1.30 and create a pipeline context to bounce the pipeline we've defined to deploy it across dev and prod. This makes it very easy to trace an upgrade path across multiple versions with very little manual effort besides at most approving PRs.
6060
61-
Observers are a lot more flexible, and can also call PR automations that can trigger your own deployment automation on merge as well.
61+
Observers are a lot more flexible, and can also call PR automations that can trigger your own deployment automation on merge as well.
62+
63+
64+
## Pipeline Setup
65+
66+
If you want to setup the pipeline acted on above, here's a basic example of how it could be done.
67+
68+
First, we want a wrapper service to house the manifests for our cluster SBOM. Put it at `bootstrap/sbom.yaml` with contents:
69+
70+
```yaml
71+
apiVersion: deployments.plural.sh/v1alpha1
72+
kind: ServiceDeployment
73+
metadata:
74+
name: sbom
75+
namespace: infra
76+
spec:
77+
git:
78+
folder: services/sbom
79+
ref: main
80+
repositoryRef:
81+
kind: GitRepository
82+
name: infra
83+
namespace: infra
84+
clusterRef:
85+
kind: Cluster
86+
name: mgmt
87+
namespace: infra
88+
```
89+
90+
Then within `services/sbom` add the following:
91+
92+
`services/sbom/ingress-nginx/dev.yaml`:
93+
94+
```yaml
95+
apiVersion: deployments.plural.sh/v1alpha1
96+
kind: GlobalService
97+
metadata:
98+
name: ingress-nginx-dev
99+
namespace: infra
100+
spec:
101+
mgmt: false
102+
tags:
103+
tier: dev
104+
template:
105+
git:
106+
folder: helm
107+
ref: main
108+
helm:
109+
chart: ingress-nginx
110+
url: https://kubernetes.github.io/ingress-nginx
111+
valuesFiles:
112+
- ingress-nginx.yaml.liquid
113+
version: 4.12.0
114+
name: ingress-nginx
115+
namespace: ingress-nginx
116+
repositoryRef:
117+
name: infra
118+
namespace: infra
119+
```
120+
121+
`services/sbom/ingress-nginx/prod.yaml`:
122+
123+
```yaml
124+
apiVersion: deployments.plural.sh/v1alpha1
125+
kind: GlobalService
126+
metadata:
127+
name: ingress-nginx-prod
128+
namespace: infra
129+
spec:
130+
mgmt: false
131+
tags:
132+
tier: prod
133+
template:
134+
git:
135+
folder: helm
136+
ref: main
137+
helm:
138+
chart: ingress-nginx
139+
url: https://kubernetes.github.io/ingress-nginx
140+
valuesFiles:
141+
- ingress-nginx.yaml.liquid
142+
version: 4.12.0
143+
name: ingress-nginx
144+
namespace: ingress-nginx
145+
repositoryRef:
146+
name: infra
147+
namespace: infra
148+
```
149+
150+
`services/sbom/ingress-nginx/pipeline.yaml`:
151+
152+
```yaml
153+
apiVersion: deployments.plural.sh/v1alpha1
154+
kind: Pipeline
155+
metadata:
156+
name: ingress-nginx
157+
spec:
158+
stages:
159+
- name: dev
160+
services:
161+
- serviceRef:
162+
name: sbom # <-- notice this points to the wrapper service above
163+
namespace: infra
164+
criteria:
165+
prAutomationRef:
166+
name: sbom-upgrade-pra
167+
- name: prod
168+
services:
169+
- serviceRef:
170+
name: sbom
171+
namespace: infra
172+
criteria:
173+
prAutomationRef:
174+
name: sbom-upgrade-pra
175+
edges:
176+
- from: dev
177+
to: prod
178+
gates:
179+
- name: approval-gate
180+
type: APPROVAL
181+
```
182+
183+
`services/sbom/sbom-upgrade-pra.yaml`:
184+
185+
```yaml
186+
apiVersion: deployments.plural.sh/v1alpha1
187+
kind: PrAutomation
188+
metadata:
189+
name: sbom-upgrade-pra
190+
spec:
191+
documentation: Updates a specific sbom addon to a new chart version
192+
updates:
193+
yamlOverlays:
194+
- file: services/sbom/{{ context.name }}/{{ context.pipeline.stage.name }}.yaml
195+
yaml: |
196+
spec:
197+
template:
198+
helm:
199+
version: "{{ context.version }}"
200+
scmConnectionRef:
201+
name: plural
202+
title: "Update addon {{ context.name }} to chart version {{ context.version }}"
203+
message: "Update addon {{ context.name }} to chart version {{ context.version }}"
204+
identifier: mgmt # <-- can change it to the explicity name of your repo if you wish, or the mgmt identifier will use your management repo
205+
configuration:
206+
- name: name
207+
type: STRING
208+
documentation: the name of the addon
209+
- name: version
210+
type: STRING
211+
documentation: the version of the addon
212+
```
213+
214+
This setup also provides a flexible way to add other SBOM components (external-dns, cert-manager, etc) with the same dev/prod pipeline structure.
215+
216+
{% callout severity="info" %}
217+
Notice how the PR automation is parameterized by name, which allows it to find the appropriate file to update for each pipeline stage. If you maintain that file structure, you'll be able to reuse the same pattern for any set of global services/pipelines.
218+
{% /callout %}
219+
220+
This workflow will:
221+
222+
* For the dev stage, modify the `services/sbom/ingress-nginx/dev.yaml` file with the new version supplied to the pipeline by the observer and create a pull request to have the change reviewed and merged.
223+
* wait for manual approval in the Plural Console UI
224+
* Progress to the prod stage, issuing a similar PR for `services/sbom/ingress-nginx/prod.yaml`.

0 commit comments

Comments
 (0)