-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Distinct CS namespace for Cloud Paks
Signed-off-by: Denilson Nastacio <[email protected]>
- Loading branch information
Showing
34 changed files
with
197 additions
and
89 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
64 changes: 64 additions & 0 deletions
64
config/argocd-cloudpaks/cp-shared/templates/0050-sync-common-service-maps.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,64 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: sync-common-service-maps | ||
annotations: | ||
argocd.argoproj.io/hook: Sync | ||
argocd.argoproj.io/sync-wave: "50" | ||
namespace: openshift-gitops | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: config | ||
image: quay.io/openshift/origin-cli:latest | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: ARGOCD_NAMESPACE | ||
value: "openshift-gitops" | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
set -eou pipefail | ||
set -x | ||
# https://www.ibm.com/docs/en/cloud-paks/1.0?topic=cfs-installing-cloud-pak-foundational-services-in-multiple-namespaces#cli | ||
if ! oc get ConfigMap common-service-maps -n kube-public 2>/dev/null | ||
then | ||
echo "INFO: ConfigMap common-service-maps needs to be created." | ||
cat <<EOF | oc apply -f - | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: common-service-maps | ||
namespace: kube-public | ||
data: | ||
common-service-maps.yaml: | | ||
controlNamespace: cs-control | ||
namespaceMapping: | ||
- map-to-common-service-namespace: {{.Values.namespace_mapping.cp4a}} | ||
requested-from-namespace: | ||
- {{.Values.namespace_mapping.cp4a}} | ||
- map-to-common-service-namespace: {{.Values.namespace_mapping.cp4d}} | ||
requested-from-namespace: | ||
- {{.Values.namespace_mapping.cp4d}} | ||
- map-to-common-service-namespace: {{.Values.namespace_mapping.cp4i}} | ||
requested-from-namespace: | ||
- {{.Values.namespace_mapping.cp4i}} | ||
- map-to-common-service-namespace: {{.Values.namespace_mapping.cp4s}}-cs | ||
requested-from-namespace: | ||
- {{.Values.namespace_mapping.cp4s}} | ||
- map-to-common-service-namespace: {{.Values.namespace_mapping.cp4waiops}} | ||
requested-from-namespace: | ||
- {{.Values.namespace_mapping.cp4waiops}} | ||
- {{.Values.namespace_mapping.cp4waiops}}-emgr | ||
EOF | ||
else | ||
echo "INFO: ConfigMap common-service-maps already exists." | ||
fi | ||
restartPolicy: Never | ||
|
||
serviceAccountName: {{.Values.serviceaccount.ibm_cloudpaks_installer}} | ||
backoffLimit: 2 |
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
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
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
10 changes: 0 additions & 10 deletions
10
config/cloudpaks/cp4s/templates/prereqs/001-cp4s-namespace.yaml
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
config/cloudpaks/cp4s/templates/prereqs/001-cp4s-namespaces.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 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
creationTimestamp: null | ||
name: {{.Values.metadata.argocd_app_namespace}} | ||
spec: {} | ||
status: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
creationTimestamp: null | ||
name: "{{.Values.metadata.argocd_app_namespace}}-cs" | ||
spec: {} | ||
status: {} |
13 changes: 0 additions & 13 deletions
13
config/cloudpaks/cp4s/templates/prereqs/020-cloudpaks-role.yaml
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
config/cloudpaks/cp4s/templates/prereqs/020-cloudpaks-roles.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,26 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "21" | ||
creationTimestamp: null | ||
name: ibm-cp4s-role | ||
namespace: "{{.Values.metadata.argocd_app_namespace}}" | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "21" | ||
creationTimestamp: null | ||
name: ibm-cp4s-role | ||
namespace: "{{.Values.metadata.argocd_app_namespace}}-cs" | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] |
17 changes: 0 additions & 17 deletions
17
config/cloudpaks/cp4s/templates/prereqs/030-cloudpaks-role-binding.yaml
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
config/cloudpaks/cp4s/templates/prereqs/030-cloudpaks-role-bindings.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,34 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "30" | ||
creationTimestamp: null | ||
name: ibm-cp4s-binding | ||
namespace: "{{.Values.metadata.argocd_app_namespace}}" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: ibm-cp4s-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "{{.Values.serviceaccount.ibm_cloudpaks_installer}}" | ||
namespace: "{{.Values.metadata.argocd_namespace}}" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "30" | ||
creationTimestamp: null | ||
name: ibm-cp4s-binding | ||
namespace: "{{.Values.metadata.argocd_app_namespace}}-cs" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: ibm-cp4s-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "{{.Values.serviceaccount.ibm_cloudpaks_installer}}" | ||
namespace: "{{.Values.metadata.argocd_namespace}}" |
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
Oops, something went wrong.