Skip to content

Commit

Permalink
Merge pull request #188 from stakater/task/update-docs-with-capacity-…
Browse files Browse the repository at this point in the history
…planning-and-hibernation-sa-6432

[Task] Update docs with capacity planning and hibernation SA 6432
  • Loading branch information
RSAK56 authored Oct 29, 2024
2 parents 1190c71 + b20e0c9 commit 086f100
Show file tree
Hide file tree
Showing 25 changed files with 167 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/closed_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
push:
uses: stakater/.github/.github/workflows/pull_request_closed.yaml@v0.0.91
uses: stakater/.github/.github/workflows/pull_request_closed.yaml@v0.0.97
secrets:
GH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/delete_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ on: delete

jobs:
delete:
uses: stakater/.github/.github/workflows/branch_deleted.yaml@v0.0.91
uses: stakater/.github/.github/workflows/branch_deleted.yaml@v0.0.97
secrets:
GH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:

jobs:
doc_qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.91
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.97
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: content
MD_LINT_CONFIG: .markdownlint.yaml
build_container:
if: ${{ github.base_ref == 'main' }}
uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.91
uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.97
with:
DOCKER_BUILD_CONTEXTS: content=https://github.com/stakater/mto-docs.git#pull-request-deployments
DOCKER_FILE_PATH: Dockerfile
Expand All @@ -27,6 +27,6 @@ jobs:
DOCKER_SECRETS: GIT_AUTH_TOKEN=${{ secrets.PUBLISH_TOKEN }}

deploy_doc:
uses: stakater/.github/.github/workflows/pull_request_versioned_doc.yaml@v0.0.91
uses: stakater/.github/.github/workflows/pull_request_versioned_doc.yaml@v0.0.97
secrets:
GH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ on:

jobs:
push:
uses: stakater/.github/.github/workflows/push_versioned_doc.yaml@v0.0.91
uses: stakater/.github/.github/workflows/push_versioned_doc.yaml@v0.0.97
secrets:
GH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:

jobs:
create_release:
uses: stakater/.github/.github/workflows/release_template.yaml@v0.0.91
uses: stakater/.github/.github/workflows/release_template.yaml@v0.0.97
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
build_container:
uses: stakater/.github/.github/workflows/push_container_only.yaml@v0.0.91
uses: stakater/.github/.github/workflows/push_container_only.yaml@v0.0.97
with:
DOCKER_BUILD_CONTEXTS: content=https://github.com/stakater/mto-docs.git#gh-pages
DOCKER_FILE_PATH: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
StylesPath = styles
MinAlertLevel = warning

Packages = https://github.com/stakater/vale-package/releases/download/v0.0.37/Stakater.zip
Packages = https://github.com/stakater/vale-package/releases/download/v0.0.40/Stakater.zip
Vocab = Stakater

# Only check MarkDown files
Expand Down
2 changes: 1 addition & 1 deletion DockerfileLocal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FROM python:3.12-alpine as builder
FROM python:3.13-alpine as builder

# set workdir
RUN mkdir -p $HOME/application
Expand Down
59 changes: 59 additions & 0 deletions content/explanation/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,65 @@ The Showback feature is an essential financial governance tool, providing detail

![showback](../images/showback.png)

### Hibernation

The Hibernation feature in the app allows managing the resource states for different namespaces by setting sleep and hibernation schedules. It is helpful for optimizing resource usage by temporarily putting certain namespaces into a sleep or hibernated state during off-peak hours as intended.

#### Namespace List

Displays a list of namespaces associated with a selected tenant. The tenant filter allows users to view namespaces relevant to a specific tenant.

#### Status Columns

- Sleeping: Indicates whether a namespace is currently in a "sleep" state, with a checkmark appearing for namespaces that are set to sleep.
- Hibernated: Shows whether a namespace is in a "hibernated" state, marked similarly to the sleeping state.
- Hibernation Interval: Provides details about the schedule for sleep and wake intervals for specific namespaces. The schedule is represented in a format like "Sleep Schedule: At 11 minutes past the hour, Wake Schedule: At 15 minutes past the hour."

#### Actions and Filters

- APPLY SLEEP / HIBERNATE: A button to initiate the sleep or hibernation action based on the selected namespaces and applied filters.
- Schedule Filters: Allows filtering namespaces by their hibernation schedule.

![hibernation-table](../images/hibernation_table.png)

You can find more detail on how Hibernation works here: [Hibernation Workflow](../how-to-guides/hibernation-workflow.md)

### Capacity Planning

The Capacity Planning feature in the app provides insights into resource usage and allocation across the cluster to help manage computing resources efficiently. It consists of three main sections:

#### 1. Graphical Representation

##### a. Tenant Requests vs. Cluster Capacity

This section displays bar charts that compare the current resource requests from tenants (like CPU and memory) with the total available cluster capacity. The charts visually represent how much of the cluster’s resources are currently being utilized versus what is available, helping identify over-utilization or under-utilization scenarios.

##### b. Quota Requests vs. Cluster Capacity

Similar to the tenant requests, this section compares the quota requests against the total cluster capacity. It allows administrators to see if the quota assigned is in line with the cluster's actual capacity.

![capacity-planning](../images/capacity_planning.png)

#### 3. Worker-pool Details

A detailed table lists the worker nodes in the cluster, displaying each node’s CPU and memory capacity along with various labels that indicate the node’s configuration and role (e.g., worker, infra). This information helps in identifying resource distribution across nodes and managing workloads accordingly.

![worker-pool](../images/worker_pool.png)

The worker-pool labels dropdown is used to filter the table data and graph based on the selected labels. If the selected label is common amongst the worker nodes, the filtered result is a list of all the worker nodes that contain the selected labels and update graph for filtered worker nodes.

If the label is specific for any worker node, selecting the label will filter the specific worker nodes containing the label and update the graph based on the filtered results.

To clear the filter you can remove applied labels and choose **Apply Filter** action. If no label is selected, it will ask you to **PROCEED** or **CANCEL**. If you choose to proceed the filters will be cleared returing the table and graph to default view.

![worker-pool-filtered](../images/worker_pool_filtered.png)

#### 4. Request Details

This table provides a breakdown of the resource requests from different tenants, displaying both the requested resources (CPU and memory) and the allocated quotas. It helps to monitor if tenant requests align with the quotas set for each tenant, ensuring optimal resource management.

![request-details](../images/request_details.png)

## User Roles and Permissions

### Administrators
Expand Down
94 changes: 94 additions & 0 deletions content/how-to-guides/hibernation-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Hibernation Workflow

The main purpose of the Hibernation workflow is, controlling resource consumption dynamically while enabling efficient management of namespaces based on their usage patterns and requirements.

## Sleep Tab

The "SLEEP" tab is active, indicating that namespaces can be put into sleep mode based on certain criteria.

### Sleep Namespace by Labels

- The interface allows namespaces to be put to sleep based on "LABELS". In this view, the "LABELS" option is selected.
- This approach allows filtering of namespaces using Kubernetes labels. Users can input label selectors in the text box to search amongst the available labels and target specific namespaces based on the unique labels.
- In the example below are the selected labels:
- ```text kubernetes.io/metadata.name:stakater-tronador```
- ```text stakater.com/quota:saap-quota-large```

- After applying the label filters, ```stakater-tronador``` appears in the list of matching namespaces. The "Sleeping" column shows no indication of sleep state, suggesting it isn't yet asleep.
- Users can click on the **Update** button to put the filtered namespace rows to sleep based on labels selected. As this will then be reflected in the table below and the main table.

![sleepByLabels](../images/sleepByLabels.png)

### Sleep Namespace by Name

- The interface shows the "NAME" option selected instead of "LABELS".
- Labels selection here will act as a filter for the table rows and allow user to filter the namespaces based on the applied/selected labels.
- This allows users to select the namespaces by their names individually, after being filtered based on the labels filter.
- The filter input accepts namespace names or partial matches to narrow down the list. Here, two filters are applied:
- ```text stakater.com/kind:flux-system```
- ```text stakater.com/quota:saap-quota-large```
- The filtered result displays ```flux-system``` as a match. A checkbox is provided next to the namespace, likely allowing selection for sleep actions.
- Users can click on the **Update** button to put the filtered namespace rows to sleep based on namespaces selected by name. As this will then be reflected in the table below and the main Hibernation table.

![sleepByName](../images/sleepByName.png)

- Another example can be seen where the ```stakater.com/tenant:alpha``` is selected and rows based on the selected labels are filtered.
- User can select the namespaces individually by name to put them to sleep.

![sleepByNameSelection](../images/sleepByNameSelection.png)

## Hibernation Tab

The "HIBERNATE" tab is active, indicating that namespaces can be put into hibernation mode based on selected schedule.

Unlike "SLEEP" tab, hibernate requires an interval to be selected in order to do any action on the tab.

### Creating an Interval

- User can create a hibernation interval with custom schedules for when the namespace should enter sleep mode and when it should wake up.
- The schedules should be a cron value as it will be reflected below the input.
- The schedule name after creation will append the tenant name to it's end indicating the tenant it belongs to for clarification.
- Each interval is defined by a **Sleep Schedule** and a **Wake Schedule** in cron format (e.g., `"30 * * * *"` for 30 minutes past each hour).

![createInterval](../images/createInterval.png)

### Selecting an Interval

- Before applying hibernation to any namespace, an interval must be selected
- This selection is mandatory; without choosing an interval, the hibernation action cannot proceed, ensuring a clear and structured schedule is always in place.

![selectCreatedInterval](../images/selectCreatedInterval.png)

### Hibernate Namespace by Labels

- The interface allows namespaces to be put to hibernation state based on "LABELS". In this view, the "LABELS" option is selected.
- This approach allows filtering of namespaces using Kubernetes labels. Users can input label selectors in the text box to search amongst the available labels and target specific namespaces based on the unique labels.
- In the example below are the selected labels: ```text stakater.com/kind.stakater-forecastle```.
- After applying the label filters, ```stakater-forecastle``` appears in the list of matching namespaces. The "Hibernated" column shows no indication of hibernation state, suggesting it isn't yet hibernated.
- Users can click on the **Update** button to hibernate the namespace based on labels selected. As this will then be reflected in the table below and the main table.

![hibernateByLabels](../images/hibernateByLabels.png)

- After the filtered namespaces are hibernated the hibernation interval can be seen in the column and value can be read by hovering over the interval.

![hibernateByLabelsApplied](../images/hibernateByLabelsApplied.png)

### Hibernate Namespace by Name

- The interface shows the "NAME" option selected instead of "LABELS".
- Labels selection here will act as a filter for the table rows and allow user to filter the namespaces based on the applied/selected labels.
- The filter input accepts namespace names or partial matches to narrow down the list. Here, one filters are applied: ```text stakater.com/kind:flux-reloader```
- The filtered result displays ```stakater-reloader``` as a match. A checkbox is provided next to the namespace, likely allowing selection for hibernating the namespace.
- Users can click on the **Update** button to put the filtered namespace rows to sleep based on namespaces selected by name. As this will then be reflected in the table below and the main Hibernation table.

![hibernateByName](../images/hibernateByName.png)

- After the selected namespaces are hibernated the hibernation interval can be seen in the column and value can be read by hovering over the interval.

![hibernateByNameApplied](../images/hibernateByNameApplied.png)

## Common Elements for Both Tabs

- Sleep and Hibernate Tabs: Users can toggle between "SLEEP" and "HIBERNATE" actions, indicating separate states or behaviors for namespaces.
- Rows per page selection: Users can adjust how many namespaces are displayed on the page, with a default of 5 in this view.
- Update Button: Located at the bottom, allowing users to apply the changes made, such as putting the selected namespaces to sleep.
Binary file added content/images/capacity_planning.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 added content/images/createInterval.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 added content/images/hibernateByLabels.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 added content/images/hibernateByLabelsApplied.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 added content/images/hibernateByName.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 added content/images/hibernateByNameApplied.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 added content/images/hibernation_table.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 added content/images/noInterval.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 added content/images/request_details.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 added content/images/selectCreatedInterval.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 added content/images/sleepByLabels.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 added content/images/sleepByName.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 added content/images/sleepByNameSelection.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 added content/images/worker_pool.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 added content/images/worker_pool_filtered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions theme_override/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ nav:
- installation/kubernetes.md
- installation/helm-values.md
- Managed Kubernetes:
- installation/managed-kubernetes/overview.md
- installation/managed-kubernetes/azure-aks.md
- installation/managed-kubernetes/aws-eks.md
- installation/managed-kubernetes/overview.md
- installation/managed-kubernetes/azure-aks.md
- installation/managed-kubernetes/aws-eks.md
- pricing.md
- Tutorials:
- Configuring Tenants:
Expand Down Expand Up @@ -53,6 +53,7 @@ nav:
- how-to-guides/keycloak.md
- how-to-guides/custom-metrics.md
- how-to-guides/graph-visualization.md
- how-to-guides/hibernation-workflow.md
- Integrations:
- how-to-guides/enabling-multi-tenancy-argocd.md
- how-to-guides/enabling-multi-tenancy-vault.md
Expand Down

0 comments on commit 086f100

Please sign in to comment.