Skip to content

Commit

Permalink
Merge pull request #39 from kyma-project/prerequisites
Browse files Browse the repository at this point in the history
Installation and uninstallation guide improvement
  • Loading branch information
kyma-bot authored Nov 29, 2022
2 parents 102cf99 + 0ed18ce commit 76a423e
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
12 changes: 12 additions & 0 deletions deployments/prerequisites.yaml
Original file line number Diff line number Diff line change
@@ -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."
12 changes: 12 additions & 0 deletions examples/btp-manager-secret.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions default.yaml → examples/btp-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions operator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Dockerfile.cross
*.swp
*.swo
*~
/module-chart/manifest/

0 comments on commit 76a423e

Please sign in to comment.