Skip to content

Commit 83d2494

Browse files
author
Sara Abdelmessih
authored
Merge pull request #212 from weaveworks/upgrade-policy-to-flux-2-rc-1
Upgrade flux resources to v1 in weave-policy-agent
2 parents 8069f63 + 8605911 commit 83d2494

File tree

6 files changed

+18
-22
lines changed

6 files changed

+18
-22
lines changed

charts/external-secrets/Bootstrapping-Guide.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ In Flux, we can't have dependencies between Flux Kustomization and HelmRelease,
1010

1111
Both controllers manage the resources independently, at different moments, with no possibility to wait for each other. This means that we have a wonderful race condition where sometimes the CRs (`SecretStore`,`ClusterSecretStore`...) tries to be deployed before than the CRDs needed to recognize them.
1212

13-
Reference: [https://external-secrets.io/v0.6.1/examples/gitops-using-fluxcd/](https://external-secrets.io/v0.6.1/examples/gitops-using-fluxcd/)
13+
Reference: [https://external-secrets.io/v0.6.1/examples/gitops-using-fluxcd/](https://external-secrets.io/v0.6.1/examples/gitops-using-fluxcd/)
14+
1415

15-
1616

1717
## The solution
1818

@@ -53,7 +53,7 @@ Let's see the conditions to start working on a solution:
5353

5454
- ***cluster-secrets/cluster-secrets.yaml***
5555

56-
This file will contain the main configurations and requirements to install secret management operator and all its dependencies
56+
This file will contain the main configurations and requirements to install secret management operator and all its dependencies
5757

5858
**Contents:**
5959

@@ -63,7 +63,7 @@ We will getting them from `external-secrets` repository
6363

6464
```yaml
6565
# GitRepository
66-
apiVersion: source.toolkit.fluxcd.io/v1beta1
66+
apiVersion: source.toolkit.fluxcd.io/v1
6767
kind: GitRepository
6868
metadata:
6969
name: external-secrets
@@ -93,7 +93,7 @@ We will getting them from `external-secrets` repository as well
9393
```yaml
9494
---
9595
# external secrets crds
96-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
96+
apiVersion: kustomize.toolkit.fluxcd.io/v1
9797
kind: Kustomization
9898
metadata:
9999
name: external-secrets-crds
@@ -144,14 +144,14 @@ spec:
144144
---
145145
```
146146

147-
4- External Secrets Secrets (CRs)
147+
4- External Secrets Secrets (CRs)
148148

149149
In this guide the secrets are in the same repository you can create as many CRs as you need, this is one secret for elaboration
150150

151151
```yaml
152152
---
153153
# external secrets secrets
154-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
154+
apiVersion: kustomize.toolkit.fluxcd.io/v1
155155
kind: Kustomization
156156
metadata:
157157
name: external-secrets-secrets
@@ -166,7 +166,6 @@ spec:
166166
name: flux-system
167167
path: ./secrets
168168
prune: true
169-
validation: client
170169
```
171170
172171
- ***clusters/my-cluster/cluster-secrets***
@@ -176,7 +175,7 @@ This is the Kustomization file, the manifest of external secrets resources
176175
**Contents:**
177176
178177
```yaml
179-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
178+
apiVersion: kustomize.toolkit.fluxcd.io/v1
180179
kind: Kustomization
181180
metadata:
182181
name: cluster-secrets
@@ -188,7 +187,6 @@ spec:
188187
name: flux-system
189188
path: ../cluster-secrets
190189
prune: true
191-
validation: client
192190
```
193191
194192
- ***secrets/aws-secret-store.yaml***
@@ -330,7 +328,7 @@ kubectl create secret generic ssh-credentials --from-file=./identity --from-file
330328
**Goal**: To bootstrap the leaf cluster with flux installed & secret to authenticate ESO
331329

332330

333-
**Structure**
331+
**Structure**
334332

335333
```yaml
336334
➜ wge-dev git:(main) tree
@@ -364,7 +362,7 @@ kubectl create secret generic ssh-credentials --from-file=./identity --from-file
364362
└── prod
365363
```
366364

367-
**1- How to create the secret**
365+
**1- How to create the secret**
368366

369367
- First when creating the management cluster we will need to create manually a secret for authenticating the SecretStore also we need to create`ClusterResourceSet` for the AWS secret to be able to bootstrap it to leaf cluster. This will be copied for bootstrap location as shown before.
370368

@@ -433,7 +431,7 @@ For the cluster template we will need to add 2 labels
433431
434432
i) `weave.works/flux: bootstrap` to match the booting clusters with the `**ClusterBootstrapConfig`** job
435433

436-
ii) `secretmanager: aws` to match the the booting clusters with the `ClusterResourceSet` for the AWS secret
434+
ii) `secretmanager: aws` to match the the booting clusters with the `ClusterResourceSet` for the AWS secret
437435

438436
Example for the template
439437

charts/external-secrets/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: external-secrets
33
icon: https://raw.githubusercontent.com/external-secrets/external-secrets/main/assets/eso-round-logo.svg
44
description: A Weaveworks Helm chart for the External Secrets Operator
55
type: application
6-
version: 0.6.1
6+
version: 1.0.0
77
dependencies:
88
- name: external-secrets
99
version: "0.6.1"

charts/external-secrets/templates/secret-stores-kustomization.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if .Values.secretStores.enabled }}
22
{{- if not .Values.secretStores.sourceRef }}
3-
apiVersion: source.toolkit.fluxcd.io/v1beta1
3+
apiVersion: source.toolkit.fluxcd.io/v1
44
kind: GitRepository
55
metadata:
66
name: external-secrets
@@ -23,7 +23,7 @@ spec:
2323
{{- end }}
2424
{{- end }}
2525
---
26-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
26+
apiVersion: kustomize.toolkit.fluxcd.io/v1
2727
kind: Kustomization
2828
metadata:
2929
name: external-secrets
@@ -41,5 +41,4 @@ spec:
4141
{{- end }}
4242
path: {{ .Values.secretStores.path }}
4343
prune: true
44-
validation: client
4544
{{- end }}

charts/weave-policy-agent/Chart.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dependencies:
33
repository: https://weaveworks.github.io/policy-agent
44
version: 2.5.0
55
digest: sha256:2c8e91250a08f5d899643aeead53548322fba11b526628a581d95c322e7fb2c7
6-
generated: "2023-06-26T14:28:27.694292969+03:00"
6+
generated: "2023-06-26T14:47:54.260827988+03:00"

charts/weave-policy-agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
description: A Weaveworks Helm chart for Kubernetes to configure the policy agent
33
name: weave-policy-agent
44
appVersion: "2.5.0"
5-
version: 1.0.0
5+
version: 2.0.0
66
kubeVersion: ">=1.16.0-0"
77
icon: https://www.magalix.com/hubfs/Imported%20images/logo-02.png%3Fwidth=560%26name=logo-02-Dec-18-2020-11-24-41-75-AM.png
88
type: application

charts/weave-policy-agent/templates/policy-library.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if .Values.policySource.enabled }}
22
{{- if not .Values.policySource.sourceRef }}
3-
apiVersion: source.toolkit.fluxcd.io/v1beta1
3+
apiVersion: source.toolkit.fluxcd.io/v1
44
kind: GitRepository
55
metadata:
66
name: policy-library
@@ -23,7 +23,7 @@ spec:
2323
{{- end }}
2424
{{- end }}
2525
---
26-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
26+
apiVersion: kustomize.toolkit.fluxcd.io/v1
2727
kind: Kustomization
2828
metadata:
2929
name: policy-library
@@ -41,5 +41,4 @@ spec:
4141
{{- end }}
4242
path: {{ .Values.policySource.path }}
4343
prune: true
44-
validation: client
4544
{{- end }}

0 commit comments

Comments
 (0)