From 0d287293894f0fc1a37ab6ad8463560ecdcffb14 Mon Sep 17 00:00:00 2001 From: Dimitri Saridakis Date: Mon, 26 Jun 2023 14:15:30 +0100 Subject: [PATCH] refactor: removal of deployment dir, and updating the readme to use make deploy cmd --- README.md | 11 +-- config/rbac/role.yaml | 15 ++++ deployment/deployment.yaml | 39 ----------- deployment/instascale-clusterrole.yaml | 69 ------------------- deployment/instascale-clusterrolebinding.yaml | 13 ---- deployment/instascale-configmap.yaml | 7 -- deployment/instascale-sa.yaml | 6 -- 7 files changed, 16 insertions(+), 144 deletions(-) delete mode 100644 deployment/deployment.yaml delete mode 100644 deployment/instascale-clusterrole.yaml delete mode 100644 deployment/instascale-clusterrolebinding.yaml delete mode 100644 deployment/instascale-configmap.yaml delete mode 100644 deployment/instascale-sa.yaml diff --git a/README.md b/README.md index 43380d4..88e2bfe 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,7 @@ Key features: - Note that the other contents of the Makefile (as well as the `config` and `bin` dirs) exist for future operator development, and are not currently utilized ## Deployment - Deploy MCAD using steps [here](https://github.com/project-codeflare/multi-cluster-app-dispatcher/blob/main/doc/deploy/deployment.md). -- Deploy InstaScale using commands below: -``` -git clone https://github.com/project-codeflare/instascale.git -cd deployment/ -oc apply -f instascale-configmap.yaml -oc apply -f instascale-sa.yaml -oc apply -f instascale-clusterrole.yaml -oc apply -f instascale-clusterrolebinding.yaml -oc apply -f deployment.yaml -``` +- Deploy InstaScale using: `make deploy` ## Testing diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 6eac591..ebe6d0c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -49,3 +49,18 @@ rules: - get - patch - update +- apiGroups: + - "" + resourceNames: + - instascale-ocm-secret + resources: + - secrets + verbs: + - get +- apiGroups: + - config.openshift.io + resources: + - clusterversions + verbs: + - get + - update \ No newline at end of file diff --git a/deployment/deployment.yaml b/deployment/deployment.yaml deleted file mode 100644 index b317195..0000000 --- a/deployment/deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: instascale - name: instascale - namespace: kube-system -spec: - replicas: 1 - selector: - matchLabels: - app: instascale - template: - metadata: - labels: - app: instascale - spec: - containers: - - image: quay.io/project-codeflare/instascale-controller:latest - name: instascale - resources: - limits: - cpu: "2" - memory: "2G" - requests: - cpu: "2" - memory: "2G" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - periodSeconds: 5 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - periodSeconds: 10 - serviceAccountName: instascale-sa diff --git a/deployment/instascale-clusterrole.yaml b/deployment/instascale-clusterrole.yaml deleted file mode 100644 index 498a02b..0000000 --- a/deployment/instascale-clusterrole.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: instascale-cr -rules: -- apiGroups: - - "" - resources: - - nodes - - configmaps - verbs: - - list - - watch - - get - - create - - update - - delete - - patch - -- apiGroups: - - apps - resources: - - deployments - verbs: - - list - - watch - - get -- apiGroups: - - machine.openshift.io - resources: - - "*" - verbs: - - list - - watch - - get - - create - - update - - delete - - patch - -- apiGroups: - - mcad.ibm.com - resources: - - appwrappers - verbs: - - list - - watch - - get - - create - - update - - delete - - patch - -- apiGroups: - - "" - resourceNames: - - instascale-ocm-secret - resources: - - secrets - verbs: - - get - -- apiGroups: - - config.openshift.io - resources: - - clusterversions - verbs: - - get - - list diff --git a/deployment/instascale-clusterrolebinding.yaml b/deployment/instascale-clusterrolebinding.yaml deleted file mode 100644 index 8f36d96..0000000 --- a/deployment/instascale-clusterrolebinding.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - creationTimestamp: null - name: instascale-crb -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: instascale-cr -subjects: -- kind: ServiceAccount - name: instascale-sa - namespace: kube-system diff --git a/deployment/instascale-configmap.yaml b/deployment/instascale-configmap.yaml deleted file mode 100644 index a16657e..0000000 --- a/deployment/instascale-configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: instascale-config - namespace: kube-system -data: - maxScaleoutAllowed: "15" diff --git a/deployment/instascale-sa.yaml b/deployment/instascale-sa.yaml deleted file mode 100644 index a18db55..0000000 --- a/deployment/instascale-sa.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - creationTimestamp: null - name: instascale-sa - namespace: kube-system