Skip to content

Commit

Permalink
Merge pull request #55 from projectsyn/allow-setting-ns-metadata
Browse files Browse the repository at this point in the history
Allow setting namespace metadata using `.namespaceMetadata`
  • Loading branch information
bastjan authored Feb 17, 2023
2 parents 54e0e8e + 8d1972a commit 6fc9ba5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
=_metadata:
multi_instance: true
namespace: syn-${_instance}
namespaceMetadata: {}

host_service_cidr: null

Expand Down
4 changes: 3 additions & 1 deletion component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ local instance = inv.parameters._instance;

// Define outputs below
{
'00_namespace': kube.Namespace(params.namespace),
'00_namespace': kube.Namespace(params.namespace) {
metadata+: com.makeMergeable(params.namespaceMetadata),
},
'10_cluster': cluster.Cluster(instance, params),
}
18 changes: 18 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ The namespace in which to deploy this component.

Deploying multiple vclusters in the same namespace isn't supported.


== `namespaceMetadata`

[horizontal]
type:: dictionary
default:: `{}`
example::
+
[source,yaml]
----
namespace:
annotations:
prometheus: infra
----

Additional metadata for the namespace.


== `host_service_cidr`

[horizontal]
Expand Down
3 changes: 2 additions & 1 deletion tests/golden/openshift/openshift/openshift/00_namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
annotations:
openshift.io/cluster-monitoring: 'true'
labels:
name: syn-openshift
name: syn-openshift
3 changes: 3 additions & 0 deletions tests/openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ parameters:
host_service_cidr: 172.30.0.0/16
ocp_route:
host: test.apps.local
namespaceMetadata:
annotations:
openshift.io/cluster-monitoring: "true"

facts:
distribution: openshift4

0 comments on commit 6fc9ba5

Please sign in to comment.