-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[teraslice, e2e] Add Kubernetes role restrictions to teraslice master (…
…#3817) This PR makes the following changes: - Assigns a new, dedicated and restricted kubernetes `role` to the Teraslice `master` pod, enhancing secure access control - Removes the default `ServiceAccount` usage, which granted all pods in the namespace full access to the Kubernetes API - Updated documentation to reflect changes Ref to issue #3251
- Loading branch information
Showing
7 changed files
with
56 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ spec: | |
type: Directory | ||
imagePullSecrets: | ||
- name: docker-tera1-secret | ||
serviceAccountName: master-service-account |
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: master-service-account | ||
namespace: ts-dev1 |
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,9 +1,15 @@ | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: teraslice-all-ts-dev1 | ||
name: teraslice-master-role-ts-dev1 | ||
namespace: ts-dev1 | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
- apiGroups: [""] # Core API group for resources like pods, configmaps | ||
resources: ["pods", "configmaps", "services"] | ||
verbs: ["get", "create", "delete", "list", "update", "patch"] | ||
- apiGroups: ["apps"] # Apps API group for deployments and replica sets | ||
resources: ["deployments", "replicasets"] | ||
verbs: ["get", "create", "delete", "list", "update", "patch"] | ||
- apiGroups: ["batch"] # batch API group for jobs | ||
resources: ["jobs"] | ||
verbs: ["get", "create", "delete", "list", "update", "patch"] |
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,13 +1,13 @@ | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: teraslice-all-ts-dev1 | ||
name: teraslice-master-ts-dev1 | ||
namespace: ts-dev1 | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
name: master-service-account | ||
namespace: ts-dev1 | ||
roleRef: | ||
kind: Role | ||
name: teraslice-all-ts-dev1 | ||
apiGroup: "rbac.authorization.k8s.io" | ||
name: teraslice-master-role-ts-dev1 | ||
apiGroup: "rbac.authorization.k8s.io" |
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