diff --git a/Makefile b/Makefile index 8cab68548..daafbe1a8 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ module-template-push: ## Pushes the ModuleTemplate referencing the Image on MODU .PHONY: module-default module-default: - cp operator/config/samples/* default.yaml + cp operator/config/samples/* examples/btp-operator.yaml ##@ Tools diff --git a/README.md b/README.md index 549cbad47..02b88b0ed 100644 --- a/README.md +++ b/README.md @@ -10,27 +10,49 @@ BTP Manager is an operator for [SAP BTP Service Operator](https://github.com/SAP - Kubernetes cluster (you can use [k3d](https://k3d.io)) ## Installation -The following steps describe how to run BTP Manager. All `make` commands are referring to [Makefile](./operator/Makefile) in `operator` directory. +The following commands describe how to run BTP Manager locally. All `make` commands are referring to [Makefile](./operator/Makefile) in `operator` directory. -1. Install [BtpOperator CRD](./operator/config/crd/bases/operator.kyma-project.io_btpoperators.yaml) by running `make install`. -2. Run `make run` to start BTP Manager locally. +```sh +cd operator +make install +make run +``` ## Usage -Create `BtpOperator` CR to provision SAP BTP Service Operator. You can use [sample CR](./default.yaml): +#### The following commands describe how to install SAP BTP Service Operator. ```sh -kubectl apply -f $BTPOPERATOR_CR_MANIFEST_PATH +kubectl apply -f deployments/prerequisites.yaml +kubectl apply -f examples/btp-manager-secret.yaml +kubectl apply -f examples/btp-operator.yaml ``` -e.g.: -```sh -kubectl apply -f default.yaml +``` +namespace/kyma-system created +priorityclass.scheduling.k8s.io/kyma-system created +secret/sap-btp-manager created +btpoperator.operator.kyma-project.io/btpoperator-sample created ``` -Delete `BtpOperator` CR to remove SAP BTP Service Operator instance: +Check `BtpOperator` CR status. ```sh -kubectl delete btpoperators.operator.kyma-project.io $NAME_OF_BTPOPERATOR_CR +kubectl get btpoperators btpoperator-sample +``` + +Expected result. +``` +NAME STATE +btpoperator-sample Ready ``` -e.g.: + +#### The following commands describe how to uninstall SAP BTP Service Operator. ```sh -kubectl delete btpoperators.operator.kyma-project.io btpoperator +kubectl delete -f examples/btp-operator.yaml +kubectl delete -f examples/btp-manager-secret.yaml +kubectl delete -f deployments/prerequisites.yaml +``` +``` +btpoperator.operator.kyma-project.io "btpoperator-sample" deleted +secret "sap-btp-manager" deleted +namespace "kyma-system" deleted +priorityclass.scheduling.k8s.io "kyma-system" deleted ``` \ No newline at end of file diff --git a/deployments/prerequisites.yaml b/deployments/prerequisites.yaml new file mode 100644 index 000000000..9a1eecdf4 --- /dev/null +++ b/deployments/prerequisites.yaml @@ -0,0 +1,12 @@ +kind: Namespace +apiVersion: v1 +metadata: + name: kyma-system +--- +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: kyma-system +value: 99 +globalDefault: false +description: "This priority class should be used for Kyma pods only." diff --git a/examples/btp-manager-secret.yaml b/examples/btp-manager-secret.yaml new file mode 100644 index 000000000..efe57dbfc --- /dev/null +++ b/examples/btp-manager-secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: sap-btp-manager + namespace: kyma-system +data: + clientid: dGVzdF9jbGllbnRpZA== + clientsecret: dGVzdF9jbGllbnRzZWNyZXQ= + sm_url: dGVzdF9zbV91cmw= + tokenurl: dGVzdF90b2tlbnVybA== + cluster_id: dGVzdF9jbHVzdGVyX2lk diff --git a/default.yaml b/examples/btp-operator.yaml similarity index 79% rename from default.yaml rename to examples/btp-operator.yaml index 30119839c..d24222b6f 100644 --- a/default.yaml +++ b/examples/btp-operator.yaml @@ -3,10 +3,10 @@ kind: BtpOperator metadata: labels: app.kubernetes.io/name: btpoperator - app.kubernetes.io/instance: btpoperator + app.kubernetes.io/instance: btpoperator-sample app.kubernetes.io/part-of: btp-manager app.kuberentes.io/managed-by: kustomize app.kubernetes.io/created-by: btp-manager - name: btpoperator + name: btpoperator-sample spec: # TODO(user): Add fields here diff --git a/operator/.gitignore b/operator/.gitignore index e917e5cef..6b4ad50d9 100644 --- a/operator/.gitignore +++ b/operator/.gitignore @@ -24,3 +24,4 @@ Dockerfile.cross *.swp *.swo *~ +/module-chart/manifest/