Skip to content

Commit

Permalink
Add documentation for topology garbage collector
Browse files Browse the repository at this point in the history
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
  • Loading branch information
PiotrProkop committed Jan 10, 2023
1 parent 4dbb03c commit daf8440
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/deployment/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,24 @@ We have introduced the following Chart parameters.
| `topologyUpdater.affinity` | dict | {} | Topology updater pod [affinity](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
| `topologyUpdater.config` | dict | | [configuration](../reference/topology-updater-configuration-reference) |

### Topology garbage collector parameters

| Name | Type | Default | description |
|-----------------------------------------------|--------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `topologyGC.*` | dict | | NFD Topology Garbage Collector configuration |
| `topologyGC.enable` | bool | false | Specifies whether the NFD Topology Garbage Collector should be created |
| `topologyGC.serviceAccount.create` | bool | true | Specifies whether the service account for topology garbage collector should be created |
| `topologyGC.serviceAccount.annotations` | dict | {} | Annotations to add to the service account for topology garbage collector |
| `topologyGC.serviceAccount.name` | string | | The name of the service account for topology garbage collector to use. If not set and create is true, a name is generated using the fullname template and `-topology-gc` suffix |
| `topologyGC.rbac.create` | bool | false | Specifies whether to create [RBAC][rbac] configuration for topology garbage collector |
| `topologyGC.interval` | string | 1h | Time between periodic garbage collector runs |
| `topologyGC.podSecurityContext` | dict | {} | [PodSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) holds pod-level security attributes and common container settings |
| `topologyGC.securityContext` | dict | {} | Container [security settings](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) |
| `topologyGC.resources` | dict | {} | Topology garbage collector pod [resources management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
| `topologyGC.nodeSelector` | dict | {} | Topology garbage collector pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
| `topologyGC.tolerations` | dict | {} | Topology garbage collector pod [node tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
| `topologyGC.annotations` | dict | {} | Topology garbage collector pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
| `topologyGC.affinity` | dict | {} | Topology garbage collector pod [affinity](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |

<!-- Links -->
[rbac]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
8 changes: 8 additions & 0 deletions docs/get-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ creates or updates a
resource object specific to this node. One instance of nfd-topology-updater is
supposed to be running on each node of the cluster.

## NFD-Topology-Garbage-Collector

NFD-Topology-Garbage-Collector is a daemon responsible for cleaning obsolete
[NodeResourceTopology](../usage/custom-resources#noderesourcetopology) objects,
obsolete means that there is no corresponding worker node.

One instance of nfd-topology-gc is supposed to be running in the cluster.

## Feature Discovery

Feature discovery is divided into domain-specific feature sources:
Expand Down
46 changes: 46 additions & 0 deletions docs/reference/topology-gc-commandline-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Topology Garbage Collector Cmdline Reference"
layout: default
sort: 4
---

# NFD-Topology-Garbage-Collector Commandline Flags

{: .no_toc }

## Table of Contents

{: .no_toc .text-delta }

1. TOC
{:toc}

---

To quickly view available command line flags execute `nfd-topology-gc -help`.
In a docker container:

```bash
docker run {{ site.container_image }} \
nfd-topology-gc -help
```

### -h, -help

Print usage and exit.

### -version

Print version and exit.

### -gc-interval

The `-gc-interval` specifies the interval between periodic garbage collector runs.

Default: 1h

Example:

```bash
nfd-topology-gc -gc-interval=1h
```
26 changes: 26 additions & 0 deletions docs/usage/nfd-topology-gc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "NFD-Topology-Garbage-Collector"
layout: default
sort: 5
---

# NFD-Topology-Garbage-Collector
{: .no_toc}

---

NFD-Topology-Garbage-Collector is preferably run as a Kubernetes deployment with one replica.
It makes sure that all [NodeResourceTopology](custom-resources#noderesourcetopology)
have corresponding worker nodes and removes stale objects for worker nodes which are no longer
part of Kubernetes cluster.

This service watches for Node deletion events and removes NodeResourceTopology objects upon them.
It is also running periodically to make sure no event was missed or NodeResourceTopology object
was created without corresponding worker node. The default garbage collector interval is set to 1h
which is the value when no -gc-interval is specified.

## Topology-Garbage-Collector Configuration

In Helm deployments,
[Topology Garbage Collector parameters](../deployment/helm.md#topology-garbage-collector-parameters)
NFD-Topology-Garbage-Collector will only be deployed when topologyUpdater.enable is set to true.

0 comments on commit daf8440

Please sign in to comment.