Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update make uninstall #191

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,9 @@ docker-push: ## Push docker image with the manager.

##@ Deployment

install: manifests kustomize install-authorino ## Install CRDs into the K8s cluster specified in ~/.kube/config.
kubectl apply -f $(OPERATOR_MANIFESTS)
install: install-authorino install-operator ## Install CRDs into the K8s cluster specified in ~/.kube/config.

uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
kubectl delete -f $(OPERATOR_MANIFESTS)
uninstall: uninstall-operator uninstall-authorino ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${OPERATOR_IMAGE}
Expand All @@ -219,15 +217,33 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${DEFAULT_OPERATOR_IMAGE}

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
$(KUSTOMIZE) build config/default | kubectl delete -f - --ignore-not-found

install-operator: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
kubectl apply -f $(OPERATOR_MANIFESTS)

uninstall-operator: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
kubectl delete -f $(OPERATOR_MANIFESTS) --ignore-not-found

install-authorino: install-cert-manager ## install RBAC and CRD for authorino
install-authorino: create-namespace install-cert-manager ## install RBAC and CRD for authorino
$(KUSTOMIZE) build config/authorino | kubectl apply -f -

uninstall-authorino: ## uninstall RBAC and CRD for authorino
$(KUSTOMIZE) build config/authorino | kubectl delete -f - --ignore-not-found

install-cert-manager: ## install the cert manager need for the web hooks
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml
kubectl -n cert-manager wait --timeout=300s --for=condition=Available deployments --all

uninstall-cert-manager: ## uninstall the cert manager need for the web hooks
kubectl delete -f https://github.com/cert-manager/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml --ignore-not-found

create-namespace:
kubectl create namespace authorino-operator --dry-run=client -o yaml | kubectl apply -f - ## handle namespace already existing.

delete-namespace:
kubectl delete namespace authorino-operator --ignore-not-found

# go-get-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ The Operator can be installed by applying the manifests to the Kubernetes cluste

### Applying the manifests to the cluster

1. Create the namespace for the Operator

```sh
kubectl create namespace authorino-operator
```

2. Install the Operator manifests
1. Install the Operator manifests

```sh
make install
```

3. Deploy the Operator
2. Deploy the Operator

```sh
make deploy
Expand Down Expand Up @@ -278,3 +272,30 @@ spec:
path: keycloak.crt
defaultMode: 420
```
## Removal

### Removing the operator installed via manifests

1. Undeploy the Operator

```sh
make undeploy
```

2. Remove the Operator manifests

```sh
make uninstall
```

#### Remove dependencies (Optional)

1. Remove operator namespace
```sh
make delete-namespace
```

2. Uninstall cert manager
```sh
make uninstall-cert-manager
```
Loading