Skip to content

Commit

Permalink
Merge pull request #107 from fidelity/move-kraan-namespace
Browse files Browse the repository at this point in the history
Move Kraan Controller to gotk-system namespace
  • Loading branch information
Paul Carlton authored Oct 14, 2020
2 parents b85d577 + aeccf6c commit 9b3eb7b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
7 changes: 3 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function toolkit_refresh() {
gitops_proxy_url="${HTTPS_PROXY}"
fi
cp "${work_dir}"/gitops/gitops.yaml "${work_dir}"/gitops/gitops-orignal.yaml
awk '/env:/{ print;print " - name: HTTPS_PROXY\n value: gitops_proxy_url\n - name: NO_PROXY\n value: 10.0.0.0/8";next}1' \
awk '/env:/{ print;print " - name: HTTPS_PROXY\n value: gitops_proxy_url\n - name: NO_PROXY\n value: 10.0.0.0/8,172.0.0.0/8";next}1' \
"${work_dir}"/gitops/gitops-orignal.yaml > "${work_dir}"/gitops/gitops.yaml
sed -i "s#gitops_proxy_url#${gitops_proxy_url}#" "${work_dir}"/gitops/gitops.yaml
fi
Expand Down Expand Up @@ -239,7 +239,7 @@ function create_regcred() {

function deploy_kraan_mgr() {
if [ -n "${kraan_regcred}" ] ; then
create_regcred kraan "${kraan_regcred}"
create_regcred gotk-system "${kraan_regcred}"
fi
cp -rf "${base_dir}"/testdata/addons/kraan/manager "${work_dir}"
if [ -n "${kraan_repo}" ] ; then
Expand Down Expand Up @@ -292,9 +292,8 @@ if [ $deploy_gitops -gt 0 ] ; then
fi
fi

kubectl apply ${dry_run} -f "${base_dir}"/testdata/addons/kraan/namespace.yaml

kubectl apply ${dry_run} -k "${base_dir}"/config/crd
kubectl apply ${dry_run} -f "${base_dir}"/testdata/addons/kraan/rbac/serviceaccount.yaml
kubectl apply ${dry_run} -f "${base_dir}"/testdata/addons/kraan/rbac/leader_election_role.yaml
kubectl apply ${dry_run} -f "${base_dir}"/testdata/addons/kraan/rbac/leader_election_role_binding.yaml
kubectl apply ${dry_run} -f "${base_dir}"/testdata/addons/kraan/rbac/role.yaml
Expand Down
5 changes: 3 additions & 2 deletions testdata/addons/kraan/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: kraan-controller
namespace: kraan
namespace: gotk-system
labels:
control-plane: controller
spec:
Expand All @@ -18,6 +18,7 @@ spec:
prometheus.io/scrape: "true"
prometheus.io/port: "9090"
spec:
serviceAccountName: kraan
terminationGracePeriodSeconds: 10
containers:
- name: manager
Expand All @@ -33,7 +34,7 @@ spec:
name: tmp
args:
- --enable-leader-election
- --zap-log-level=2
- --zap-log-level=1
- --zap-encoder=json
env:
- name: DATA_PATH
Expand Down
4 changes: 0 additions & 4 deletions testdata/addons/kraan/namespace.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions testdata/addons/kraan/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
namespace: kraan
name: kraan-leader-election-role
namespace: gotk-system
rules:
- apiGroups:
- ""
Expand Down
10 changes: 5 additions & 5 deletions testdata/addons/kraan/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
namespace: kraan
name: kraan-leader-election-rolebinding
namespace: gotk-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
name: kraan-leader-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: kraan
name: kraan
namespace: gotk-system
16 changes: 8 additions & 8 deletions testdata/addons/kraan/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ roleRef:
name: kraan-manager
subjects:
- kind: ServiceAccount
name: default
namespace: kraan
name: kraan
namespace: gotk-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -21,8 +21,8 @@ roleRef:
name: kraan-gitops-source
subjects:
- kind: ServiceAccount
name: default
namespace: kraan
name: kraan
namespace: gotk-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -34,8 +34,8 @@ roleRef:
name: kraan-helm-release
subjects:
- kind: ServiceAccount
name: default
namespace: kraan
name: kraan
namespace: gotk-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -47,5 +47,5 @@ roleRef:
name: cluster-admin
subjects:
- kind: ServiceAccount
name: default
namespace: kraan
name: kraan
namespace: gotk-system
5 changes: 5 additions & 0 deletions testdata/addons/kraan/rbac/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kraan
namespace: gotk-system

0 comments on commit 9b3eb7b

Please sign in to comment.