Skip to content

Commit f6e22bd

Browse files
author
Debakel Orakel
committed
Force instantiating component
This PR will force the configuration of this component as an instance. It also changes the naming of the namespace it depoyes to.
1 parent b8ac826 commit f6e22bd

236 files changed

Lines changed: 1774 additions & 1745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SHELL := bash
66
.SUFFIXES:
77

88
include Makefile.vars.mk
9+
include Makefile.custom.mk
910

1011
.PHONY: help
1112
help: ## Show this help

Makefile.custom.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Configure instance alias for commodore component compile
2+
commodore_args += --alias $(instance)

class/defaults.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ parameters:
44
multi_instance: true
55
multi_tenant: true
66

7-
name: ${_instance}
87
namespace:
9-
name: syn-loki
8+
name: ${_instance}
109
create: true
1110
metadata: {}
1211

component/main.jsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ local prom =
4747
// The hiera parameters for the component
4848
local params = inv.parameters.loki;
4949

50+
// Prevent using non-instantiated configuration of this component
51+
assert inv.parameters._instance != 'loki' : "configuring non-instantiated component isn't allowed";
5052

5153
local secrets = com.generateResources(
5254
{

docs/modules/ROOT/pages/how-tos/upgrade-loki-v0-v1.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,39 @@ helm_values:
4141

4242
Remove the parameters from "Step 1" and deploy again.
4343

44+
=== New Namespace Naming
45+
46+
[IMPORTANT]
47+
====
48+
This component will change the default name of the namespace to the instance name.
49+
It is also no longer allowed to configure an non-instantiated version.
50+
====
51+
52+
If you have configured a namespace name that is different than the instance name, then change the namespace name here:
53+
54+
[source,yaml]
55+
----
56+
namespace:
57+
name: ${_instance} <1>
58+
----
59+
<1> Overwrite the default namespace name.
60+
61+
If you have configured the component in a non-instantiated version, then change the following:
62+
63+
[source,yaml]
64+
----
65+
applications:
66+
- loki as your-new-instance-name <1>
67+
68+
parameters:
69+
your_new_instance_name: <2>
70+
namespace:
71+
name: ${_instance} <3>
72+
----
73+
<1> Redefine the component include in `applications`.
74+
<2> Rename the component configuration as your new instance name.
75+
<3> Overwrite the default namespace name.
76+
4477
=== (Optional) Consider disabling Zone Aware Replication
4578

4679
[IMPORTANT]

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
The parent key for all of the following parameters is `loki`.
44

5-
== `name`
6-
7-
[horizontal]
8-
type:: string
9-
default:: `${_instance}`
10-
11-
The name of the instance.
12-
135

146
== `namespace`
157

@@ -20,7 +12,7 @@ default::
2012
[source,yaml]
2113
----
2214
namespace:
23-
name: syn-loki <1>
15+
name: ${_instance} <1>
2416
create: true <2>
2517
metadata: {} <3>
2618
----
File renamed without changes.

tests/golden/defaults/loki/loki/00_namespace.yaml renamed to tests/golden/defaults/defaults/defaults/00_namespace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ kind: Namespace
33
metadata:
44
annotations: {}
55
labels:
6-
name: syn-loki
7-
name: syn-loki
6+
name: defaults
7+
name: defaults
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
data: {}
3+
kind: Secret
4+
metadata:
5+
annotations: {}
6+
labels:
7+
app.kubernetes.io/managed-by: commodore
8+
app.kubernetes.io/name: defaults-bucket-secret
9+
name: defaults-bucket-secret
10+
name: defaults-bucket-secret
11+
namespace: defaults
12+
stringData:
13+
S3_ACCESS_KEY_ID: t-silent-test-1234/c-green-test-1234/defaults/s3_access_key
14+
S3_SECRET_ACCESS_KEY: t-silent-test-1234/c-green-test-1234/defaults/s3_secret_key
15+
type: Opaque

tests/golden/legacy/loki/loki/10_helm_loki/loki/templates/backend/clusterrole.yaml renamed to tests/golden/defaults/defaults/defaults/10_helm_loki/loki/templates/backend/clusterrole.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
44
labels:
5-
app.kubernetes.io/instance: loki
5+
app.kubernetes.io/instance: defaults
66
app.kubernetes.io/name: loki
77
app.kubernetes.io/version: 3.7.2
88
helm.sh/chart: loki-17.4.11
9-
name: loki-clusterrole
9+
name: defaults-loki-clusterrole
1010
rules:
1111
- apiGroups:
1212
- ''

0 commit comments

Comments
 (0)