Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #334 from stakater/update-docs
Browse files Browse the repository at this point in the history
Update TO docs
  • Loading branch information
abdulhaseeb2 authored Jul 27, 2022
2 parents a286046 + bb5c29a commit 55a54cb
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 14 deletions.
4 changes: 2 additions & 2 deletions content/sre/tenant-operator/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

### Changes

- feat: Add support for tenant namespaces off-boarding. For more details check out [onDelete](./customresources.html#_2-tenant)
- feat: Add support for tenant namespaces off-boarding. For more details check out [onDelete](./usecases/tenant.html#retaining-tenant-namespaces-when-a-tenant-is-being-deleted)
- feat: Add tenant webhook for spec validation

- fix: TemplateGroupInstance now cleans up leftover Template resources from namespaces that are no longer part of TGI namespace selector
- fix: Fixed hibernation sync issue

- enhance: Update tenant spec for applying common/specific namespace labels/annotations. For more details check out [commonMetadata & SpecificMetadata](./customresources.html#_2-tenant)
- enhance: Update tenant spec for applying common/specific namespace labels/annotations. For more details check out [commonMetadata & SpecificMetadata](./usecases/tenant.html#distributing-common-labels-and-annotations-to-tenant-namespaces-via-tenant-custom-resource)
- enhance: Add support for multi-pod architecture for Operator-Hub

- chore: Remove conversion webhook for Quota and Tenant
Expand Down
12 changes: 6 additions & 6 deletions content/sre/tenant-operator/customresources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Tenant Operator defines following 5 custom resources:

1. Quota
2. Tenant
3. Template
4. TemplateInstance
5. TemplateGroupInstance
6. ResourceSupervisor
1. [Quota](./customresources.html#_1-quota)
2. [Tenant](./customresources.html#_2-tenant)
3. [Template](./customresources.html#_3-template)
4. [TemplateInstance](./customresources.html#_4-templateinstance)
5. [TemplateGroupInstance](./customresources.html#_5-templategroupinstance)
6. [ResourceSupervisor](./customresources.html#_6-resourcesupervisor)

## 1. Quota

Expand Down
2 changes: 1 addition & 1 deletion content/sre/tenant-operator/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# FAQs

## Q. Error received while performing Create, Update or Delete action on namespace `"Cannot CREATE namespace test-john without label stakater.com/tenant"`
### Q. Error received while performing Create, Update or Delete action on namespace `"Cannot CREATE namespace test-john without label stakater.com/tenant"`

**A.** Error occurs when a user is trying to perform create, update, delete action on a namespace without the required label `stakater.com/tenant` which is used by the operator to see that authorized users can performing the action on namespace. Just add the label with the tenant name so that Tenant-Operator knows which tenant the namespace belongs to and who is authorized to perform create/update/delete operations. Fore more details please refer [Namespace usecase](./usecases/namespace.html).
Binary file modified content/sre/tenant-operator/images/to_install_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/sre/tenant-operator/images/to_install_wait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/sre/tenant-operator/images/to_installed_successful.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 48 additions & 5 deletions content/sre/tenant-operator/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,28 @@ For more details and configurations check out [IntegrationConfig](https://docs.c
::: warning Note:
* IntegrationConfig with the name `tenant-operator-config` should be present in Tenant-Operators installed namespace
* A default IntegrationConfig with the name `tenant-operator-config` will be present in Tenant-Operators installed namespace

:::

### Uninstall

You can uninstall Tenant-Operator by following these steps

* Decide on whether you want to retain tenant namespaces or not. If yes, please set `spec.onDelete.cleanNamespaces` to `false` for all those tenants whose namespaces you want to retain. For more details check out [onDelete](./usecases/tenant.html#retaining-tenant-namespaces-when-a-tenant-is-being-deleted)

* After making the required changes open OpenShift console and click on `Operators`, followed by `Installed Operators` from the side menu

![image](./images/installed-operators.png)

* Now click on uninstall and confirm uninstall.

![image](./images/uninstall-from-ui.jpg)

* Now the operator has been uninstalled.

* `Optional:` you can also manually remove tenant operators CRDs and it's resources from the cluster.

## Installing via Subscription

* Create a subscription YAML for tenant-operator and apply it in `openshift-operators` namespace
Expand All @@ -99,7 +117,7 @@ spec:
name: tenant-operator
source: certified-operators
sourceNamespace: openshift-marketplace
startingCSV: tenant-operator.v0.3.33
startingCSV: tenant-operator.v0.5.2
EOF
subscription.operators.coreos.com/tenant-operator created
```
Expand Down Expand Up @@ -158,10 +176,35 @@ For more details and configurations check out [IntegrationConfig](https://docs.c

::: warning Note:

* IntegrationConfig with the name `tenant-operator-config` should be present in Tenant-Operators installed namespace
* A default IntegrationConfig with the name `tenant-operator-config` will be present in Tenant-Operators installed namespace

:::

### Uninstall

You can uninstall Tenant-Operator by following these steps

* Decide on whether you want to retain tenant namespaces or not. If yes, please set `spec.onDelete.cleanNamespaces` to `false` for all those tenants whose namespaces you want to retain. For more details check out [onDelete](./usecases/tenant.html#retaining-tenant-namespaces-when-a-tenant-is-being-deleted)

* Delete the subscription resource

```bash
haseeb:~$ oc delete subscription tenant-operator -n openshift-operators
subscription.operators.coreos.com "tenant-operator" deleted
```

* Now open OpenShift console and click on `Operators`, followed by `Installed Operators` from the side menu

![image](./images/installed-operators.png)

* Now click on delete ClusterServiceVersion and confirm delete.

![image](./images/uninstall-from-ui-csv.png)

* Now the operator has been uninstalled.

* `Optional:` you can also manually remove tenant operators CRDs and it's resources from the cluster.

## Installing via Helm

### 1. Create Namespace
Expand Down Expand Up @@ -250,13 +293,13 @@ spec:
chart:
repository: https://stakater.github.io/stakater-charts
name: tenant-operator
version: 0.2.24
version: 0.5.2
values:
integrationConfig:
create: true
image:
repository: stakaterdockerhubpullroot/tenant-operator
tag: v0.2.24
tag: v0.5.2
pullPolicy: IfNotPresent
imagePullSecrets:
- name: stakater-docker-secret
Expand Down
26 changes: 26 additions & 0 deletions content/sre/tenant-operator/usecases/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,32 @@ EOF

With the above configuration all tenant namespaces will now contain the mentioned labels and annotations.

### Retaining tenant namespaces when a tenant is being deleted

Bill now wants to delete tenant `bluesky` and wants to retain all namespaces of the tenant. To retain the namespaces Bill will set `spec.onDelete.cleanNamespaces` to `false`.

```yaml
apiVersion: tenantoperator.stakater.com/v1beta1
kind: Tenant
metadata:
name: bluesky
spec:
owners:
users:
- anna@aurora.org
- anthony@aurora.org
quota: small
sandbox: true
namespaces:
- dev
- build
- prod
onDelete:
cleanNamespaces: false
```
With the above configuration all tenant namespaces will not be deleted when tenant `bluesky` is deleted. By default the value of `spec.onDelete.cleanNamespaces` is also `false`.

### What’s next

See how Anna can create [namespaces](./namespace.html)

0 comments on commit 55a54cb

Please sign in to comment.