Skip to content

Commit

Permalink
[stable/magic-namespace] Adding annotations and labels to namespaces (h…
Browse files Browse the repository at this point in the history
…elm#8324)

* Adding annotations and labels to namespaces

Signed-off-by: Garcia De La Villa, Alvaro <[email protected]>

* Reverting namespace object and adding namespaceAttributes

Signed-off-by: Garcia De La Villa, Alvaro <[email protected]>

* Commenting namespace value and deleting unused attributes

Signed-off-by: Garcia De La Villa, Alvaro <[email protected]>
  • Loading branch information
alvgarvilla authored and k8s-ci-robot committed Oct 25, 2018
1 parent d252c1d commit 5e00179
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion stable/magic-namespace/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: magic-namespace
version: 0.2.0
version: 0.3.0
appVersion: 2.8.1
home: https://github.com/kubernetes/charts/tree/master/stable/magic-namespace
description: Elegantly enables a Tiller per namespace in RBAC-enabled clusters
Expand Down
8 changes: 5 additions & 3 deletions stable/magic-namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ accounts and role bindings for use within the namespace. _Typically, it would
be a good idea to define at least one role binding that grants a user or group
administrative privileges in the namespace._ Absent this, the namespace's own
Tiller will function, but no user (other than the cluster operator) will be
capable of interacting with it via Helm.
capable of interacting with it via Helm.

## Prerequisites

Expand Down Expand Up @@ -104,13 +104,13 @@ $ helm install stable/magic-namespace \

## Uninstalling the Chart

Deleting a release of a Magic Namespace will _not_ delete the namespace,
Deleting a release of a Magic Namespace will _not_ delete the namespace,
unless you have used the optional ```namespace``` setting. It will
only delete the Tiller, service accounts, role bindings, etc. from that
namespace. This is actually desirable behavior, as anything the team has
deployed within that namespace is likely to be unaffected, though further
deployments to and management of that namespace will not be possible by anyone
other than the cluster operator.
other than the cluster operator.

If you have used the ```namespace``` setting, deleting the release will cleanup
all releases deployed with the tiller in the Magic Namespace, along with the
Expand Down Expand Up @@ -147,3 +147,5 @@ reference the default `values.yaml` to understand further options.
| `roleBindings[n].subject.kind` | Identify the kind of subject (`User`, `Group`, or `ServiceAccount` ) to be used in the role binding | |
| `roleBindings[n].subject.name` | Identify the name of the subject to be used in the role binding | |
| `namespace` | Specify a namespace to be created and used, overriding the one on the command line | |
| `namespaceAttributes.annotations` | Specify annotations to be attached to the namespace | |
| `namespaceAttributes.lables` | Specify labels to be attached to the namespace | |
5 changes: 4 additions & 1 deletion stable/magic-namespace/templates/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace }}
{{- end }}
{{- if hasKey .Values "namespaceAttributes" }}
{{ toYaml .Values.namespaceAttributes | indent 2 }}
{{ end -}}
{{- end }}
2 changes: 1 addition & 1 deletion stable/magic-namespace/templates/tiller-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ subjects:
{{- else }}
namespace: {{ .Release.Namespace }}
{{- end }}

{{- end }}
8 changes: 8 additions & 0 deletions stable/magic-namespace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# Uncomment and set to override the namespace that will be created.
# namespace: default

# Extra namespace attributes
# namespaceAttributes:
# Labels to be added to the namespace definition
# labels: {}

# Annotations to be added to the namespace definition
# annotations: {}

tiller:
enabled: true

Expand Down

0 comments on commit 5e00179

Please sign in to comment.