Skip to content

Commit 8ab06cd

Browse files
committed
matomo sidecar
1 parent 72ea625 commit 8ab06cd

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

examples/matomo/README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,36 @@ The [Helm CLI](https://helm.sh/docs/intro/install/#through-package-managers) and
1414
- `matomo-password`: Set this to your desired Matomo password.
1515
- `db-password`: Set this to your desired database password.
1616

17-
3. From this directory, run the following command to install the Helm chart:
17+
3. **Optional:** If you need to enable a sidecar, follow these steps:
18+
19+
3.1 **Enable Sidecar:** Update the `sidecars` section in the [values.yaml](./values.yaml) file to include the sidecar configuration. Below is an example configuration for a cloud-sql-proxy sidecar:
20+
21+
Example:
22+
```yaml
23+
sidecars:
24+
- name: cloud-sql-proxy
25+
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.1
26+
args:
27+
- --structured-logs
28+
- --port=3306
29+
- mydb-dev:us-central1:matomo
30+
- --credentials-file=/secrets/credentials.json
31+
cpu: "500m"
32+
memory: 1Gi
33+
volumes:
34+
- uri: 'cpln://secret/matomo-dev-cloud-sql-secret'
35+
path: /secrets/credentials.json
36+
```
37+
38+
3.2 **Create Secrets for Sidecar:** If your sidecar requires additional secrets, create them in Control Plane and update the `extraSecrets` section in the [values.yaml](./values.yaml) file. Each secret should be listed under the `extraSecrets` array. Be sure to use the [correct type of secret](https://docs.controlplane.com/reference/secret), such as Opaque, Dictionary, or others.
39+
40+
Example:
41+
```yaml
42+
extraSecrets:
43+
- matomo-dev-cloud-sql-secret
44+
```
45+
46+
4. From this directory, run the following command to install the Helm chart:
1847

1948
```bash
2049
cpln helm install matomo-dev --gvc <YOUR_GVC_NAME>

examples/matomo/templates/policy.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ bindings:
99
- //gvc/{{ .Values.cpln.gvc }}/identity/{{ .Values.name }}
1010
targetKind: secret
1111
targetLinks:
12-
- //secret/{{ .Values.existingSecret }}
12+
- //secret/{{ .Values.existingSecret }}
13+
{{- if .Values.extraSecrets }}
14+
{{- range .Values.extraSecrets }}
15+
- //secret/{{ . }}
16+
{{- end }}
17+
{{- end }}

examples/matomo/templates/workload.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ spec:
6868
path: /matomo.php
6969
port: 8080
7070
scheme: HTTP
71+
{{- if .Values.sidecars }}
72+
{{- toYaml .Values.sidecars | nindent 4 }}
73+
{{- end }}
7174
defaultOptions:
7275
autoscaling:
7376
minScale: '{{ .Values.replicaCount }}'

examples/matomo/values.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ timeoutSeconds: 30
2020

2121
# Matomo configurations
2222
replicaCount: 3
23-
matomoUsername: am_matomo
23+
matomoUsername: matomo_admin
2424
existingSecret: matomo-dev-secret
2525
matomoEmail: myemail@domain.com
2626
matomoWebsiteName: Website1
2727
matomoWebsiteHost: https://website.com
28-
resourcesPreset: "medium"
2928

3029
externalDatabase:
3130
host: "mysql.matomo.cpln.local"
@@ -57,6 +56,23 @@ cron:
5756
memory: 128Mi
5857
historyLimit: 5
5958

59+
# Add sidecar container configuration
60+
sidecars: []
61+
# - name: cloud-sql-proxy
62+
# image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.14.1
63+
# args:
64+
# - --structured-logs
65+
# - --port=3306
66+
# - mydb-dev:us-central1:matomo
67+
# - --credentials-file=/secrets/credentials.json
68+
# cpu: "500m"
69+
# memory: 1Gi
70+
# volumes:
71+
# - uri: 'cpln://secret/matomo-dev-cloud-sql-secret'
72+
# path: /secrets/credentials.json
6073

74+
# Add the additional secret for the sidecar to the policy
75+
extraSecrets: []
76+
# - matomo-dev-cloud-sql-secret
6177

6278

0 commit comments

Comments
 (0)