diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 61e81426b..318acca1f 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -2136,6 +2136,14 @@ rules: - patch - update - watch +- apiGroups: + - networking.k8s.io + resources: + - networkpolicies + verbs: + - create + - get + - update - apiGroups: - operator.open-cluster-management.io resources: diff --git a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-deployment.yaml b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-deployment.yaml index 7f2623243..ac0ac4c63 100644 --- a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-deployment.yaml +++ b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-deployment.yaml @@ -85,6 +85,12 @@ spec: image: "{{ .Values.global.imageOverrides.managedcluster_import_controller }}" imagePullPolicy: {{ .Values.global.pullPolicy }} {{- if .Values.global.deployOnOCP }} + args: + - "managedcluster-import-controller" + - "--cluster-ingress-domain={{ .Values.hubconfig.clusterIngressDomain }}" + {{- if .Values.hubconfig.enableFlightCtl }} + - "--enable-flightctl=true" + {{- end }} volumeMounts: - name: agent-registration-server-tls mountPath: /server @@ -94,6 +100,10 @@ spec: - "managedcluster-import-controller" - "--feature-gates=AgentRegistration=false" - "--deploy-on-ocp=false" + - "--cluster-ingress-domain={{ .Values.hubconfig.clusterIngressDomain }}" + {{- if .Values.hubconfig.enableFlightCtl }} + - "--enable-flightctl=true" + {{- end }} {{- end }} ports: - containerPort: 9091 diff --git a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml index 1ea3238bb..6c6aaa93d 100644 --- a/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml +++ b/pkg/templates/charts/toggle/server-foundation/templates/managedcluster-import-role.yaml @@ -271,3 +271,17 @@ rules: - get - list - watch +- apiGroups: + - networking.k8s.io + resources: + - networkpolicies + verbs: + - create + - get + - update +- apiGroups: + - register.open-cluster-management.io + resources: + - managedclusters/accept + verbs: + - update diff --git a/pkg/templates/rbac_gen.go b/pkg/templates/rbac_gen.go index 7486b95cd..ea00719ae 100644 --- a/pkg/templates/rbac_gen.go +++ b/pkg/templates/rbac_gen.go @@ -317,6 +317,7 @@ package main //+kubebuilder:rbac:groups=multicluster.x-k8s.io,resources=clusterprofiles,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=multicluster.x-k8s.io,resources=clusterprofiles/status,verbs=update;patch //+kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=create;get;update //+kubebuilder:rbac:groups=operator.open-cluster-management.io,resources=clustermanagers,verbs=get;list;watch;update;delete;patch //+kubebuilder:rbac:groups=operator.open-cluster-management.io,resources=clustermanagers/status,verbs=update;patch //+kubebuilder:rbac:groups=operator.open-cluster-management.io,resources=klusterlets,verbs=create;delete;deletecollection;get;list;patch;update;watch;escalate