-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'open-cluster-management-io:main' into main
- Loading branch information
Showing
14 changed files
with
242 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
charts/managed-serviceaccount/templates/addon-manager-clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# grant permission to addon-manager-controller-sa to create rolebindings | ||
# in the managed cluster for the managed-serviceaccount addon agent | ||
{{- if eq .Values.hubDeployMode "AddOnTemplate" }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: open-cluster-management-addon-manager-managed-serviceaccount | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: managed-serviceaccount-addon-agent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: addon-manager-controller-sa | ||
namespace: open-cluster-management-hub | ||
{{- end }} |
10 changes: 10 additions & 0 deletions
10
charts/managed-serviceaccount/templates/addondeploymentconfig.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# TODO: uncomment when the agentInstallNamespace field is added to the ocm repo | ||
# {{- if eq .Values.hubDeployMode "AddOnTemplate" }} | ||
# apiVersion: addon.open-cluster-management.io/v1alpha1 | ||
# kind: AddOnDeploymentConfig | ||
# metadata: | ||
# name: managed-serviceaccount-addon-deploy-config | ||
# namespace: {{ .Release.Namespace }} | ||
# spec: | ||
# agentInstallNamespace: open-cluster-management-agent-addon | ||
# {{- end }} |
137 changes: 137 additions & 0 deletions
137
charts/managed-serviceaccount/templates/addontemplate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{{- if eq .Values.hubDeployMode "AddOnTemplate" }} | ||
apiVersion: addon.open-cluster-management.io/v1alpha1 | ||
kind: AddOnTemplate | ||
metadata: | ||
name: {{ .Values.addOnTemplateName | default (print "managed-serviceaccount-" .Chart.Version) }} | ||
spec: | ||
addonName: managed-serviceaccount | ||
agentSpec: | ||
workload: | ||
manifests: | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
rules: | ||
- apiGroups: | ||
- authentication.k8s.io | ||
resources: | ||
- tokenreviews | ||
verbs: | ||
- create | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: managed-serviceaccount | ||
namespace: open-cluster-management-agent-addon | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: managed-serviceaccount-addon-agent | ||
namespace: open-cluster-management-agent-addon | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
addon-agent: managed-serviceaccount | ||
template: | ||
metadata: | ||
labels: | ||
addon-agent: managed-serviceaccount | ||
spec: | ||
containers: | ||
- args: | ||
- --leader-elect=true | ||
- --cluster-name={{ `{{CLUSTER_NAME}}` }} # escape double curly brackets, option 1 | ||
- --kubeconfig={{ "{{" }}HUB_KUBECONFIG{{ "}}" }} # escape double curly brackets, option 2 | ||
- --feature-gates=EphemeralIdentity=true | ||
command: | ||
- /agent | ||
image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8000 | ||
initialDelaySeconds: 2 | ||
periodSeconds: 10 | ||
name: addon-agent | ||
serviceAccount: managed-serviceaccount | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
namespace: open-cluster-management-agent-addon | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- serviceaccounts | ||
- serviceaccounts/token | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- create | ||
- delete | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- create | ||
- update | ||
- patch | ||
- apiGroups: | ||
- authentication.k8s.io | ||
resources: | ||
- tokenrequests | ||
verbs: | ||
- get | ||
- create | ||
- update | ||
- patch | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
namespace: open-cluster-management-agent-addon | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: open-cluster-management:managed-serviceaccount:addon-agent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: managed-serviceaccount | ||
namespace: open-cluster-management-agent-addon | ||
- apiVersion: v1 | ||
imagePullSecrets: | ||
- name: open-cluster-management-image-pull-credentials | ||
kind: ServiceAccount | ||
metadata: | ||
name: managed-serviceaccount | ||
namespace: open-cluster-management-agent-addon | ||
registration: | ||
- kubeClient: | ||
hubPermissions: | ||
- roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: managed-serviceaccount-addon-agent | ||
type: CurrentCluster | ||
type: KubeClient | ||
{{- end }} |
36 changes: 36 additions & 0 deletions
36
charts/managed-serviceaccount/templates/agent-registration-clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{- if eq .Values.hubDeployMode "AddOnTemplate" }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: managed-serviceaccount-addon-agent | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- secrets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- apiGroups: | ||
- authentication.open-cluster-management.io | ||
resources: | ||
- managedserviceaccounts | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- authentication.open-cluster-management.io | ||
resources: | ||
- managedserviceaccounts/status | ||
verbs: | ||
- get | ||
- update | ||
- patch | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{{- if ne .Values.hubDeployMode "AddOnTemplate" }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: managed-serviceaccount | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters