Skip to content

Commit 41d3af0

Browse files
Add nrr-controller Helm chart
1 parent 73c6fb5 commit 41d3af0

23 files changed

+1423
-0
lines changed

.github/ci/ct.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
chart-dirs:
2+
- charts
3+
helm-extra-args: "--timeout=5m"
4+
check-version-increment: false
5+
target-branch: master

.github/workflows/helm.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Helm
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release-*
8+
paths:
9+
- 'charts/**'
10+
- '.github/workflows/helm.yaml'
11+
- '.github/ci/ct.yaml'
12+
pull_request:
13+
paths:
14+
- 'charts/**'
15+
- '.github/workflows/helm.yaml'
16+
- '.github/ci/ct.yaml'
17+
18+
jobs:
19+
lint-and-test:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Helm
28+
uses: azure/setup-helm@v4.2.0
29+
with:
30+
version: v3.15.1
31+
32+
- uses: actions/setup-python@v5.1.1
33+
with:
34+
python-version: 3.12
35+
36+
- uses: actions/setup-go@v5
37+
with:
38+
go-version-file: 'go.mod'
39+
40+
- name: Set up chart-testing
41+
uses: helm/chart-testing-action@v2.8.0
42+
with:
43+
version: v3.11.0
44+
45+
- name: Install Helm Unit Test Plugin
46+
run: |
47+
helm plugin install --version 1.0.3 https://github.com/helm-unittest/helm-unittest
48+
49+
- name: Run Helm Unit Tests
50+
run: |
51+
helm unittest charts/nrr-controller --strict -d
52+
53+
- name: Run chart-testing (list-changed)
54+
id: list-changed
55+
run: |
56+
changed=$(ct list-changed --config=.github/ci/ct.yaml)
57+
if [[ -n "$changed" ]]; then
58+
echo "changed=true" >> $GITHUB_OUTPUT
59+
fi
60+
61+
- name: Run chart-testing (lint)
62+
run: ct lint --config=.github/ci/ct.yaml --validate-maintainers=false
63+
64+
# Need a multi node cluster so controller can run with leadership
65+
- name: Create multi node Kind cluster
66+
run: make kind-multi-node
67+
68+
# helm-extra-set-args only available after ct 3.6.0
69+
- name: Run chart-testing (install)
70+
run: ct install --config=.github/ci/ct.yaml --helm-extra-set-args='--set=kind=Deployment'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Node Readiness Controller for Kubernetes
2+
3+
[Node Readiness Controller](https://github.com/kubernetes-sigs/node-readiness-controller) for Kubernetes is a controller that manages node readiness rules and conditions. It allows you to define custom readiness conditions for nodes based on various criteria, enabling more sophisticated node lifecycle management and workload scheduling decisions.
4+
5+
## TL;DR:
6+
7+
```shell
8+
helm repo add node-readiness-controller https://kubernetes-sigs.github.io/node-readiness/
9+
helm install my-release --namespace kube-system node-readiness-controller/nrr-controller
10+
```
11+
12+
## Introduction
13+
14+
This chart bootstraps a [node-readiness-controller](https://github.com/kubernetes-sigs/node-readiness) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
15+
16+
## Prerequisites
17+
18+
- Kubernetes 1.25+
19+
20+
## Installing the Chart
21+
22+
To install the chart with the release name `my-release`:
23+
24+
```shell
25+
helm install --namespace kube-system my-release node-readiness-controller/nrr-controller
26+
```
27+
28+
The command deploys the _node-readiness-controller_ on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
29+
30+
> **Tip**: List all releases using `helm list`
31+
32+
## Uninstalling the Chart
33+
34+
To uninstall/delete the `my-release` deployment:
35+
36+
```shell
37+
helm delete my-release
38+
```
39+
40+
The command removes all the Kubernetes components associated with the chart and deletes the release.
41+
42+
## Configuration
43+
44+
The following table lists the configurable parameters of the _node-readiness-controller_ chart and their default values.
45+
46+
| Parameter | Description | Default |
47+
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
48+
| `image.repository` | Docker repository to use | `registry.k8s.io/node-readiness-controller/node-readiness-controller` |
49+
| `image.tag` | Docker tag to use | `v[chart appVersion]` |
50+
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
51+
| `imagePullSecrets` | Docker repository secrets | `[]` |
52+
| `nameOverride` | String to partially override `nrr-controller.fullname` template (will prepend the release name) | `""` |
53+
| `fullnameOverride` | String to fully override `nrr-controller.fullname` template | `""` |
54+
| `namespaceOverride` | Override the deployment namespace; defaults to .Release.Namespace | `""` |
55+
| `replicaCount` | The replica count for Deployment | `1` |
56+
| `leaderElection.enabled` | Enable leader election to support multiple replicas | `false` |
57+
| `priorityClassName` | The name of the priority class to add to pods | `system-cluster-critical` |
58+
| `rbac.create` | If `true`, create & use RBAC resources | `true` |
59+
| `resources` | Node Readiness Controller container CPU and memory requests/limits | _see values.yaml_ |
60+
| `serviceAccount.create` | If `true`, create a service account | `true` |
61+
| `serviceAccount.name` | The name of the service account to use, if not set and create is true a name is generated using the fullname template | `nil` |
62+
| `serviceAccount.annotations` | Specifies custom annotations for the serviceAccount | `{}` |
63+
| `podAnnotations` | Annotations to add to the node-readiness-controller Pods | `{}` |
64+
| `podLabels` | Labels to add to the node-readiness-controller Pods | `{}` |
65+
| `commonLabels` | Labels to apply to all resources | `{}` |
66+
| `podSecurityContext` | Security context for pod | _see values.yaml_ |
67+
| `securityContext` | Security context for container | _see values.yaml_ |
68+
| `terminationGracePeriodSeconds` | Time to wait before forcefully terminating the pod | `10` |
69+
| `healthProbeBindAddress` | The bind address for health probes | `:8081` |
70+
| `livenessProbe` | Liveness probe configuration for the node-readiness-controller container | _see values.yaml_ |
71+
| `readinessProbe` | Readiness probe configuration for the node-readiness-controller container | _see values.yaml_ |
72+
| `metrics.secure` | Enable secure metrics endpoint | `false` |
73+
| `metrics.bindAddress` | The bind address for metrics server | `:8443` |
74+
| `metrics.service.port` | The port exposed by the metrics service | `8443` |
75+
| `metrics.service.targetPort` | The target port for the metrics service | `8443` |
76+
| `metrics.certDir` | Directory for metrics server certificates | `/tmp/k8s-metrics-server/metrics-certs` |
77+
| `metrics.certSecretName` | Name of the secret containing metrics server certificates | `metrics-server-cert` |
78+
| `webhook.enabled` | Enable the webhook server | `false` |
79+
| `webhook.port` | The port for the webhook server | `9443` |
80+
| `webhook.service.port` | The port exposed by the webhook service | `8443` |
81+
| `webhook.service.targetPort` | The target port for the webhook service | `9443` |
82+
| `webhook.certDir` | Directory for webhook server certificates | `/tmp/k8s-webhook-server/serving-certs` |
83+
| `webhook.certSecretName` | Name of the secret containing webhook server certificates | `webhook-server-certs` |
84+
| `certManager.enabled` | Enable cert-manager integration for automatic TLS certificate generation | `false` |
85+
| `certManager.issuer.create` | Create a cert-manager issuer | `true` |
86+
| `certManager.issuer.name` | Name of the cert-manager issuer | `selfsigned-issuer` |
87+
| `certManager.metricsCertificate.create` | Create a cert-manager certificate for metrics server | `true` |
88+
| `certManager.metricsCertificate.name` | Name of the metrics certificate | `metrics-certs` |
89+
| `certManager.webhookCertificate.create` | Create a cert-manager certificate for webhook server | `true` |
90+
| `certManager.webhookCertificate.name` | Name of the webhook certificate | `serving-cert` |
91+
| `validatingWebhook.enabled` | Enable the validating webhook | `false` |
92+
| `validatingWebhook.name` | Name of the ValidatingWebhookConfiguration resource | `validating-webhook-configuration` |
93+
| `validatingWebhook.webhookName` | Name of the webhook | `vnodereadinessrule.kb.io` |
94+
| `validatingWebhook.failurePolicy` | Failure policy for the webhook | `Fail` |
95+
| `validatingWebhook.sideEffects` | Side effects for the webhook | `None` |
96+
| `validatingWebhook.path` | The path for the webhook | `/validate-readiness-node-x-k8s-io-v1alpha1-nodereadinessrule` |
97+
| `validatingWebhook.admissionReviewVersions` | Admission review versions supported by the webhook | `["v1"]` |
98+
| `nodeSelector` | Node selectors to run the controller on specific nodes | `nil` |
99+
| `tolerations` | Tolerations to run the controller on specific nodes | `nil` |
100+
| `affinity` | Node affinity to run the controller on specific nodes | `nil` |
101+
| `nodeReadinessRules` | Custom readiness rules to create as NodeReadinessRule resources. CRD must be preinstalled or installation will fail. | `[]` |

charts/nrr-controller/.helmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/

charts/nrr-controller/Chart.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v2
2+
name: nrr-controller
3+
description: A Helm chart for the Node Readiness Controller
4+
type: application
5+
version: 0.1.0
6+
appVersion: "v0.2.0"
7+
kubeVersion: ">=1.25.0-0"
8+
home: https://github.com/kubernetes-sigs/node-readiness-controller
9+
sources:
10+
- https://github.com/kubernetes-sigs/node-readiness-controller
11+
keywords:
12+
- kubernetes
13+
- controller
14+
- readiness
15+
- node

0 commit comments

Comments
 (0)