Skip to content

Commit

Permalink
Merge pull request #110 from projectsyn/prepare-egressgatewaypolicy-m…
Browse files Browse the repository at this point in the history
…igration

Prepare migration to `IsovalentEgressGatewayPolicy` resources
  • Loading branch information
simu authored Apr 25, 2024
2 parents d9692fd + 33db075 commit 21d4c79
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 6 deletions.
14 changes: 13 additions & 1 deletion component/aggregated-clusterroles.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ local ciliumRule(resources) =
],
};

local isovalentRule(resources) =
{
apiGroups: [ 'isovalent.com' ],
resources: resources,
verbs: [
'get',
'list',
'watch',
],
};

local view = kube.ClusterRole('syn-cilium-view') {
metadata+: {
labels+: {
Expand Down Expand Up @@ -58,8 +69,9 @@ local cluster_reader = kube.ClusterRole('syn-cilium-cluster-reader') {
rules: [
// We could explicitly list and maintain cluster-scoped resources here, but
// that's overhead we don't really need, so we just grant "view" permissions
// on all resources in `cilium.io` to `cluster-reader`.
// on all resources in `cilium.io` and `isovalent.com` to `cluster-reader`.
ciliumRule([ '*' ]),
isovalentRule([ '*' ]),
],
};

Expand Down
2 changes: 1 addition & 1 deletion component/egress-gateway-policies.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local CiliumEgressGatewayPolicy(name) =
kube._Object('cilium.io/v2', 'CiliumEgressGatewayPolicy', name) {
metadata+: {
annotations+: {
'argocd.argoproj.io/sync-options': 'SkipDryRunOnMissingResource=true',
'argocd.argoproj.io/sync-options': 'SkipDryRunOnMissingResource=true,Prune=false',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ rules:
- get
- list
- watch
- apiGroups:
- isovalent.com
resources:
- '*'
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ rules:
- get
- list
- watch
- apiGroups:
- isovalent.com
resources:
- '*'
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: cilium.io/v2
kind: CiliumEgressGatewayPolicy
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true,Prune=false
labels:
name: all-example-namespace
name: all-example-namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: cilium.io/v2
kind: CiliumEgressGatewayPolicy
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true,Prune=false
cilium.syn.tools/debug-interface-index: start=3221226016, end=3221226047, ip=3221226045
cilium.syn.tools/description: Generated policy to assign egress IP 192.0.2.61
in egress range "egress_a" (192.0.2.32 - 192.0.2.63) to namespace bar.
Expand Down Expand Up @@ -30,7 +30,7 @@ apiVersion: cilium.io/v2
kind: CiliumEgressGatewayPolicy
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true,Prune=false
cilium.syn.tools/debug-interface-index: start=3221226048, end=3221226079, ip=3221226077
cilium.syn.tools/description: Generated policy to assign egress IP 192.0.2.93
in egress range "egress_c" (192.0.2.64 - 192.0.2.95) to namespace baz.
Expand Down Expand Up @@ -58,7 +58,7 @@ apiVersion: cilium.io/v2
kind: CiliumEgressGatewayPolicy
metadata:
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true,Prune=false
cilium.syn.tools/debug-interface-index: start=3221226016, end=3221226047, ip=3221226016
cilium.syn.tools/description: Generated policy to assign egress IP 192.0.2.32
in egress range "egress_a" (192.0.2.32 - 192.0.2.63) to namespace foo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ rules:
- get
- list
- watch
- apiGroups:
- isovalent.com
resources:
- '*'
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ rules:
- get
- list
- watch
- apiGroups:
- isovalent.com
resources:
- '*'
verbs:
- get
- list
- watch

0 comments on commit 21d4c79

Please sign in to comment.