diff --git a/Makefile b/Makefile index f8e61ab7..b67e8a0b 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,10 @@ deploy: manifests kustomize cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} $(KUSTOMIZE) build config/default | kubectl apply -f - +# Remove controller in the configured Kubernetes cluster in ~/.kube/config +remove: manifests kustomize + $(KUSTOMIZE) build config/default | kubectl delete -f - + # Generate manifests e.g. CRD, RBAC etc. manifests: controller-gen $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases diff --git a/README.md b/README.md index bde078b6..d432d644 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This project aims to provide a custom operator for implementing a strong multi-tenant environment in _Kubernetes_, especially suited for public _Container-as-a-Service_ (CaaS) platforms. -# tl;dr; How to install +# Installation Ensure you have [`kustomize`](https://github.com/kubernetes-sigs/kustomize) installed in your `PATH`: @@ -123,6 +123,32 @@ Please refer to the corresponding [section](use_cases.md) Please refer to the corresponding [section](contributing.md) +# Removal + +Similar to `deploy`, you can get rid of Capsule using the `remove` target. + +``` +make remove +# /home/prometherion/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases +# /usr/local/bin/kustomize build config/default | kubectl delete -f - +# namespace "capsule-system" deleted +# customresourcedefinition.apiextensions.k8s.io "tenants.capsule.clastix.io" deleted +# clusterrole.rbac.authorization.k8s.io "capsule-namespace:deleter" deleted +# clusterrole.rbac.authorization.k8s.io "capsule-namespace:provisioner" deleted +# clusterrole.rbac.authorization.k8s.io "capsule-proxy-role" deleted +# clusterrole.rbac.authorization.k8s.io "capsule-metrics-reader" deleted +# clusterrolebinding.rbac.authorization.k8s.io "capsule-manager-rolebinding" deleted +# clusterrolebinding.rbac.authorization.k8s.io "capsule-namespace:provisioner" deleted +# clusterrolebinding.rbac.authorization.k8s.io "capsule-proxy-rolebinding" deleted +# secret "capsule-ca" deleted +# secret "capsule-tls" deleted +# service "capsule-controller-manager-metrics-service" deleted +# service "capsule-webhook-service" deleted +# deployment.apps "capsule-controller-manager" deleted +# mutatingwebhookconfiguration.admissionregistration.k8s.io "capsule-mutating-webhook-configuration" deleted +# validatingwebhookconfiguration.admissionregistration.k8s.io "capsule-validating-webhook-configuration" deleted +``` + # Production Grade status Capsule is still in an _alpha_ stage, so **don't use it in production**!