Skip to content

Commit

Permalink
added option to disable namespace creation
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhuth committed Oct 8, 2024
1 parent d6f4500 commit 30a9f62
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion charts/tenant-namespace/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: tenant-namespace
description: A Helm Chart to bootstrap a Namespace in a Multi-Tenancy setup
version: 1.0.3
version: 2.0.0
type: application
home: https://github.com/christianhuth/helm-charts
icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/png/resources/labeled/ns-256.png
Expand All @@ -12,6 +12,8 @@ annotations:
artifacthub.io/changes: |
- kind: changed
description: URL of Helm Repository in README
- kind: added
description: option to disable the creation of the namespace
artifacthub.io/signKey: |
fingerprint: EE24F8BB6D099E78FD704F83B5ECDBCDDD485D0E
url: https://charts.christianhuth.de/public.key
1 change: 1 addition & 0 deletions charts/tenant-namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The command removes all the Kubernetes components associated with the chart and
| namespace.annotations.scheduler.defaultTolerations | list | `[]` | This annotation requires the PodTolerationRestriction admission controller to be enabled. This annotation key allows assigning tolerations to a namespace and any new pods created in this namespace would get these tolerations added. |
| namespace.annotations.scheduler.nodeSelector | string | `""` | The PodNodeSelector uses this annotation key to assign node selectors to pods in namespaces. |
| namespace.annotations.scheduler.tolerationsWhitelist | list | `[]` | This annotation requires the PodTolerationRestriction admission controller to be enabled. The annotation value is a JSON document that defines a list of allowed tolerations for the namespace it annotates. When you create a Pod or modify its tolerations, the API server checks the tolerations to see if they are mentioned in the allow list. The pod is admitted only if the check succeeds. |
| namespace.enabled | bool | `false` | - create a Namespace resource |
| namespace.labels.additionalLabels | object | `{}` | Labels to be added to the Namespace |
| namespace.labels.podSecurityAdmission.audit.standard | string | `""` | Value must be one of privileged, baseline, or restricted which correspond to Pod Security Standard levels. |
| namespace.labels.podSecurityAdmission.audit.version | string | `""` | Version label that can be used to pin the policy to the version that shipped with a given Kubernetes minor version (for example v1.27). |
Expand Down
2 changes: 2 additions & 0 deletions charts/tenant-namespace/templates/namespace/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.namespace.enabled }}
apiVersion: v1
kind: Namespace
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
labels:
{{- include "tenant-namespace.namespace.labels" . | nindent 4 }}
name: {{ include "tenant-namespace.namespace.name" . | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/tenant-namespace/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
}
}
},
"enabled": {
"type": "boolean"
},
"labels": {
"type": "object",
"properties": {
Expand Down
2 changes: 2 additions & 0 deletions charts/tenant-namespace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ limitRange:
name: ""

namespace:
# --- create a Namespace resource
enabled: false
annotations:
# -- Annotations to be added to the Namespace
additionalAnnotations: {}
Expand Down

0 comments on commit 30a9f62

Please sign in to comment.