-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #793 from jlandowner/feature/required-addons
Feature required UserAddons and improve template validation
- Loading branch information
Showing
46 changed files
with
1,379 additions
and
433 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
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
2 changes: 1 addition & 1 deletion
2
hack/local-run-test/templates/dev-code-server/cosmo-template.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
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
10 changes: 10 additions & 0 deletions
10
hack/local-run-test/templates/dev-code-server/team-a/kustomization.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 @@ | ||
resources: | ||
- ../kubernetes | ||
|
||
patches: | ||
- target: | ||
kind: Deployment | ||
patch: | | ||
- op: replace | ||
path: /spec/template/spec/serviceAccountName | ||
value: iamserviceaccount |
92 changes: 0 additions & 92 deletions
92
hack/local-run-test/templates/dev-code-server/team-shared-template.yaml
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
all: template | ||
|
||
.PHONY: template | ||
template: | ||
kustomize build kubernetes | cosmoctl tmpl gen --useraddon \ | ||
--name team-a-serviceaccount \ | ||
--userroles=team-a-* \ | ||
--disable-nameprefix \ | ||
--cluster-scope \ | ||
--required-useraddons resource-limitter \ | ||
-o addon.yaml |
38 changes: 38 additions & 0 deletions
38
hack/local-run-test/templates/iamserviceaccount/addon.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,38 @@ | ||
# Generated by cosmoctl - cosmo v1.0.0-rc2 cosmo-workspace 2023 | ||
apiVersion: cosmo-workspace.github.io/v1alpha1 | ||
kind: ClusterTemplate | ||
metadata: | ||
annotations: | ||
cosmo-workspace.github.io/disable-nameprefix: "true" | ||
cosmo-workspace.github.io/required-useraddons: resource-limitter | ||
cosmo-workspace.github.io/userroles: team-a-* | ||
creationTimestamp: null | ||
labels: | ||
cosmo-workspace.github.io/type: useraddon | ||
name: team-a-serviceaccount | ||
spec: | ||
rawYaml: | | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
cosmo-workspace.github.io/instance: '{{INSTANCE}}' | ||
cosmo-workspace.github.io/template: '{{TEMPLATE}}' | ||
name: iamserviceaccount | ||
namespace: '{{NAMESPACE}}' | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
cosmo-workspace.github.io/instance: '{{INSTANCE}}' | ||
cosmo-workspace.github.io/template: '{{TEMPLATE}}' | ||
name: '{{USER_NAME}}-view' | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: view | ||
subjects: | ||
- kind: ServiceAccount | ||
name: iamserviceaccount | ||
namespace: '{{NAMESPACE}}' |
12 changes: 12 additions & 0 deletions
12
hack/local-run-test/templates/iamserviceaccount/kubernetes/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,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: "{{USER_NAME}}-view" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: view | ||
subjects: | ||
- kind: ServiceAccount | ||
name: iamserviceaccount | ||
namespace: "{{NAMESPACE}}" |
3 changes: 3 additions & 0 deletions
3
hack/local-run-test/templates/iamserviceaccount/kubernetes/kustomization.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,3 @@ | ||
resources: | ||
- clusterrolebinding.yaml | ||
- serviceaccount.yaml |
5 changes: 5 additions & 0 deletions
5
hack/local-run-test/templates/iamserviceaccount/kubernetes/serviceaccount.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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: iamserviceaccount | ||
namespace: "{{NAMESPACE}}" |
Oops, something went wrong.