Skip to content

Commit ea7be5a

Browse files
authored
Add roles for supply chains (#2)
1 parent 77bfa73 commit ea7be5a

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

package/config/kapp-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
1+
---
12
apiVersion: kapp.k14s.io/v1alpha1
23
kind: Config
34

45
minimumRequiredVersion: 0.50.0
56

7+
#! Rebase rules explicitly define how kapp should merge resources during an update.
8+
#! See more about the resource merge method: https://carvel.dev/kapp/docs/latest/merge-method.
69
rebaseRules:
10+
11+
#! Kubernetes automatically fills in the rules of aggregated ClusterRoles.
12+
#! We want to keep that configuration between upgrades.
13+
- path: [rules]
14+
type: copy
15+
sources: [existing]
16+
resourceMatchers:
17+
- apiVersionKindMatcher:
18+
apiVersion: rbac.authorization.k8s.io/v1
19+
kind: ClusterRole
20+
21+
#! If the synchronization of a PackageInstall or App resource has been manually paused.
722
- path: [spec, paused]
823
type: copy
924
sources: [new, existing]
1025
resourceMatchers:
1126
- apiVersionKindMatcher: {apiVersion: packaging.carvel.dev/v1alpha1, kind: PackageInstall}
1227
- apiVersionKindMatcher: {apiVersion: kappctrl.k14s.io/v1alpha1, kind: App}
28+
29+
#! These rules define which fields should be removed before kapp performs a diff against the last applied resource.
30+
diffAgainstLastAppliedFieldExclusionRules:
31+
32+
- path: [metadata, annotations]
33+
type: copy
34+
sources: [existing]
35+
resourceMatchers:
36+
- apiVersionKindMatcher:
37+
apiVersion: rbac.authorization.k8s.io/v1
38+
kind: ClusterRole
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: deliverable
6+
aggregationRule:
7+
clusterRoleSelectors:
8+
- matchLabels:
9+
apps.kadras.io/aggregate-to-deliverable: "true"
10+
rules: []

package/config/roles/workload.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: workload
6+
aggregationRule:
7+
clusterRoleSelectors:
8+
- matchLabels:
9+
apps.kadras.io/aggregate-to-workload: "true"
10+
rules: []

0 commit comments

Comments
 (0)