Skip to content

Commit

Permalink
Merge pull request #10 from stakater/docs-update
Browse files Browse the repository at this point in the history
Updated docs and logo
  • Loading branch information
hussnain612 authored Aug 3, 2022
2 parents c474657 + d5085f7 commit c243e07
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 23 deletions.
4 changes: 2 additions & 2 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineUserConfig({

// configure default theme
theme: defaultTheme({
logo: '/favicon.png',
logo: '/favicon.svg',
docsDir: 'docs',

repo: "stakater/stakater-cloud-docs-2.0",
Expand Down Expand Up @@ -95,7 +95,7 @@ export default defineUserConfig({
}),
seoPlugin({
hostname: 'stakater',
fallBackImage: '/stakater.png',
fallBackImage: '/stakater.svg',
autoDescription: true,
})
],
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/configs/head.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HeadConfig } from '@vuepress/core'

export const head: HeadConfig[] = [
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: `/favicon.png` }],
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: `/favicon.svg` }],
['link', { rel: 'manifest', href: '/manifest.webmanifest' }],
]
Binary file removed docs/.vuepress/public/favicon.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/.vuepress/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/.vuepress/public/stakater.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/.vuepress/public/stakater.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
home: true
title: Home
heroImage: /stakater.png
heroImage: /stakater.svg
actions:
- text: Docs Home
link: /content/sre/introduction/introduction.md
Expand Down
4 changes: 2 additions & 2 deletions docs/content/sre/tenant-operator/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

**v0.5.0**

- 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 docs/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
Binary file modified docs/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 docs/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.
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 docs/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
77 changes: 71 additions & 6 deletions docs/content/sre/tenant-operator/usecases/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ bluesky-prod Active 5d5h

### Distributing common labels and annotations to tenant namespaces via Tenant Custom Resource

Bill now wants to add labels/annotations to all the namespaces for a tenant. To create those labels/annotations Bill will just add them into `namespaceLabels`/`namespaceAnnotations` field in the tenant CR.
Bill now wants to add labels/annotations to all the namespaces for a tenant. To create those labels/annotations Bill will just add them into `commonMetadata.labels`/`commonMetadata.annotations` field in the tenant CR.

```yaml
kubectl apply -f - << EOF
Expand All @@ -186,16 +186,81 @@ spec:
- dev
- build
- prod
namespaceLabels:
app.kubernetes.io/managed-by: tenant-operator
app.kubernetes.io/part-of: tenant-alpha
namespaceAnnotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=
commonMetadata:
labels:
app.kubernetes.io/managed-by: tenant-operator
app.kubernetes.io/part-of: tenant-alpha
annotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=
EOF
```

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

### Distributing specific labels and annotations to tenant namespaces via Tenant Custom Resource

Bill now wants to add labels/annotations to specific namespaces for a tenant. To create those labels/annotations Bill will just add them into `specificMetadata.labels`/`commonMetadata.annotations` and specific namespaces in `specificMetadata.namespaces` field in the tenant CR.

```yaml
kubectl apply -f - << EOF
apiVersion: tenantoperator.stakater.com/v1beta1
kind: Tenant
metadata:
name: bluesky
spec:
owners:
users:
- [email protected]
- [email protected]
editors:
users:
- [email protected]
groups:
- alpha
quota: small
sandbox: true
namespaces:
- dev
- build
- prod
specificMetadata:
- namespaces:
- bluesky-anna-aurora-sandbox
labels:
app.kubernetes.io/is-sandbox: true
annotations:
openshift.io/node-selector: node-role.kubernetes.io/worker=
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:
- [email protected]
- [email protected]
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 c243e07

Please sign in to comment.