Skip to content

Commit 5cc61a4

Browse files
authored
Merge pull request #99 from stefanprodan/pod-security-profile
Allow setting the pod security labels on the Flux namespace
2 parents b8661d4 + f1ac6d4 commit 5cc61a4

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ see [timoni.sh](https://timoni.sh/install/).
4646
### Install Flux on self-managed clusters
4747

4848
To deploy Flux AIO on a cluster without a CNI, create a Timoni Bundle file
49-
named `flux-aio.cue` with the following content:
49+
named `flux-aio.cue` with the following content:
5050

5151
```cue
5252
bundle: {
@@ -85,6 +85,16 @@ values: env: {
8585
}
8686
```
8787

88+
Note that on [Talos](https://github.com/siderolabs/talos) clusters, you'll have to set the pod security profile to
89+
`privileged`:
90+
91+
```cue
92+
values: {
93+
hostNetwork: true
94+
podSecurityProfile: "privileged"
95+
}
96+
```
97+
8898
You can fine tune the Flux installation using various options, for more information see
8999
the [installation guide](https://timoni.sh/flux-aio/#flux-installation).
90100

modules/flux-aio/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ flux -n flux-system uninstall
8888
| `imagePullSecret: username:` | `string` | `null` | Registry username for the generated image pull secret |
8989
| `imagePullSecret: password:` | `string` | `null` | Registry password for the generated image pull secret |
9090
| `compatibility:` | `string` | `kubernetes` | Can be set to `openshift` to make the security context compatible with RedHat OpenShift | |
91+
| `podSecurityProfile:` | `string` | `""` | Can be `privileged` or `restricted`, used for setting the `pod-security.kubernetes.io` labels on the namespace |
9192

9293
### Controllers
9394

modules/flux-aio/debug_values.cue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ values: {
6363
identity: "arn:aws:iam::111122223333:role/my-role"
6464
provider: "aws"
6565
}
66-
hostNetwork: true
67-
securityProfile: "privileged"
66+
hostNetwork: true
67+
podSecurityProfile: "privileged"
68+
securityProfile: "privileged"
6869
resources: {
6970
requests: {
7071
cpu: "250m"

modules/flux-aio/templates/config.cue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ import (
6464

6565
securityProfile: "restricted" | "privileged"
6666

67+
podSecurityProfile: *"" | "restricted" | "privileged"
68+
6769
logLevel: *"info" | string
6870

6971
hostNetwork: *true | bool

modules/flux-aio/templates/namespace.cue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ import (
1010
kind: "Namespace"
1111
metadata: {
1212
name: #config.metadata.namespace
13-
labels: #config.metadata.labels
1413
annotations: #config.metadata.annotations
14+
labels: #config.metadata.labels
15+
if #config.podSecurityProfile != "" {
16+
labels: {
17+
"pod-security.kubernetes.io/enforce": #config.podSecurityProfile
18+
"pod-security.kubernetes.io/warn": #config.podSecurityProfile
19+
"pod-security.kubernetes.io/audit": #config.podSecurityProfile
20+
}
21+
}
1522
}
1623
}

0 commit comments

Comments
 (0)