Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHELL := bash
.SUFFIXES:

include Makefile.vars.mk
include Makefile.custom.mk

.PHONY: help
help: ## Show this help
Expand Down
2 changes: 2 additions & 0 deletions Makefile.custom.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Configure instance alias for commodore component compile
commodore_args += --alias $(instance)
3 changes: 1 addition & 2 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ parameters:
multi_instance: true
multi_tenant: true

name: ${_instance}
namespace:
name: syn-loki
name: ${_instance}
create: true
metadata: {}

Expand Down
2 changes: 2 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ local prom =
// The hiera parameters for the component
local params = inv.parameters.loki;

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

local secrets = com.generateResources(
{
Expand Down
33 changes: 33 additions & 0 deletions docs/modules/ROOT/pages/how-tos/upgrade-loki-v0-v1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,39 @@ helm_values:

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

=== New Namespace Naming

[IMPORTANT]
====
This component will change the default name of the namespace to the instance name.
It is also no longer allowed to configure an non-instantiated version.
====

If you have configured a namespace name that is different than the instance name, then change the namespace name here:

[source,yaml]
----
namespace:
name: ${_instance} <1>
----
<1> Overwrite the default namespace name.

If you have configured the component in a non-instantiated version, then change the following:

[source,yaml]
----
applications:
- loki as your-new-instance-name <1>

parameters:
your_new_instance_name: <2>
namespace:
name: ${_instance} <3>
----
<1> Redefine the component include in `applications`.
<2> Rename the component configuration as your new instance name.
<3> Overwrite the default namespace name.

=== (Optional) Consider disabling Zone Aware Replication

[IMPORTANT]
Expand Down
10 changes: 1 addition & 9 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

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

== `name`

[horizontal]
type:: string
default:: `${_instance}`

The name of the instance.


== `namespace`

Expand All @@ -20,7 +12,7 @@ default::
[source,yaml]
----
namespace:
name: syn-loki <1>
name: ${_instance} <1>
create: true <2>
metadata: {} <3>
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: Namespace
metadata:
annotations: {}
labels:
name: syn-loki
name: syn-loki
name: defaults
name: defaults
15 changes: 15 additions & 0 deletions tests/golden/defaults/defaults/defaults/01_secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
data: {}
kind: Secret
metadata:
annotations: {}
labels:
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: defaults-bucket-secret
name: defaults-bucket-secret
name: defaults-bucket-secret
namespace: defaults
stringData:
S3_ACCESS_KEY_ID: t-silent-test-1234/c-green-test-1234/defaults/s3_access_key
S3_SECRET_ACCESS_KEY: t-silent-test-1234/c-green-test-1234/defaults/s3_secret_key
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: loki-clusterrole
name: defaults-loki-clusterrole
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: loki-clusterrolebinding
name: defaults-loki-clusterrolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: loki-clusterrole
name: defaults-loki-clusterrole
subjects:
- kind: ServiceAccount
name: loki
namespace: syn-loki
name: defaults-loki
namespace: defaults
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: PodDisruptionBudget
metadata:
labels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
name: loki-chunks-cache
namespace: syn-loki
name: defaults-loki-chunks-cache
namespace: defaults
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ metadata:
annotations: {}
labels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: loki-chunks-cache
namespace: syn-loki
name: defaults-loki-chunks-cache
namespace: defaults
spec:
clusterIP: None
ports:
Expand All @@ -21,6 +21,6 @@ spec:
targetPort: http-metrics
selector:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
type: ClusterIP
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ metadata:
annotations: {}
labels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: memcached-chunks-cache
name: loki-chunks-cache
namespace: syn-loki
name: defaults-loki-chunks-cache
namespace: defaults
spec:
podManagementPolicy: Parallel
replicas: 2
selector:
matchLabels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
name: memcached-chunks-cache
serviceName: loki-chunks-cache
serviceName: defaults-loki-chunks-cache
template:
metadata:
annotations:
bucketSecretVersion: '0'
labels:
app.kubernetes.io/component: memcached-chunks-cache
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
name: memcached-chunks-cache
spec:
Expand All @@ -43,7 +43,7 @@ spec:
env: null
envFrom:
- secretRef:
name: loki-bucket-secret
name: defaults-bucket-secret
image: docker.io/library/memcached:1.6.42-alpine
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -125,7 +125,7 @@ spec:
runAsUser: 11211
seccompProfile:
type: RuntimeDefault
serviceAccountName: loki-memcached
serviceAccountName: defaults-loki-memcached
terminationGracePeriodSeconds: 60
tolerations: []
topologySpreadConstraints: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ metadata:
annotations: null
labels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: loki-compactor
namespace: syn-loki
name: defaults-loki-compactor
namespace: defaults
spec:
ports:
- name: http-metrics
Expand All @@ -27,7 +27,7 @@ spec:
publishNotReadyAddresses: true
selector:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
type: ClusterIP
---
Expand All @@ -37,14 +37,14 @@ metadata:
annotations: null
labels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
prometheus.io/service-monitor: 'false'
variant: headless
name: loki-compactor-headless
namespace: syn-loki
name: defaults-loki-compactor-headless
namespace: defaults
spec:
clusterIP: None
ports:
Expand All @@ -63,6 +63,6 @@ spec:
publishNotReadyAddresses: true
selector:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
type: ClusterIP
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/version: 3.7.2
helm.sh/chart: loki-17.4.11
name: loki-compactor
namespace: syn-loki
name: defaults-loki-compactor
namespace: defaults
spec:
podManagementPolicy: Parallel
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
serviceName: loki-compactor-headless
serviceName: defaults-loki-compactor-headless
template:
metadata:
annotations:
checksum/config: 0d304c8e8cd773f042bee70064c291b099e0fbd43aff91917a59868f1e7ccb2c
checksum/config: deaa6a87d1aab9442e32ccf19a6b570a0e780f737f386704bbf5fd577a324749
kubectl.kubernetes.io/default-container: compactor
labels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
app.kubernetes.io/part-of: memberlist
app.kubernetes.io/version: 3.7.2
Expand All @@ -38,7 +38,7 @@ spec:
- labelSelector:
matchLabels:
app.kubernetes.io/component: compactor
app.kubernetes.io/instance: loki
app.kubernetes.io/instance: defaults
app.kubernetes.io/name: loki
topologyKey: kubernetes.io/hostname
automountServiceAccountToken: true
Expand All @@ -59,7 +59,7 @@ spec:
fieldPath: status.podIP
envFrom:
- secretRef:
name: loki-bucket-secret
name: defaults-bucket-secret
image: docker.io/docker.io/grafana/loki:3.7.2
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -122,7 +122,7 @@ spec:
runAsUser: 10001
seccompProfile:
type: RuntimeDefault
serviceAccountName: loki
serviceAccountName: defaults-loki
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
Expand Down
Loading
Loading