Skip to content

Commit 300a4db

Browse files
authored
agent: remove agent ns and add env var handling (#2)
* agent: remove agent ns and add env var handling * agent: bump version
1 parent 8404f1a commit 300a4db

File tree

5 files changed

+42
-33
lines changed

5 files changed

+42
-33
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.1
18+
version: 0.2.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/agent/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If you had already added this repo earlier, run `helm repo update` to retrieve t
1818

1919
To install the agent chart:
2020

21-
helm upgrade --install my-agent checkly/agent --set agent.apiKeySecret.apiKey=pl_...
21+
helm upgrade --install my-agent checkly/agent --set apiKeySecret.apiKey=pl_...
2222

2323
To uninstall the chart:
2424

@@ -28,22 +28,20 @@ See [https://github.com/checkly/helm-charts](https://github.com/checkly/helm-cha
2828

2929
## Alternative ways to set the agent API Key
3030

31-
Instead of setting `agent.apiKeySecret.apiKey` you can also choose an existing secret with the following options
31+
Instead of setting `apiKeySecret.apiKey` you can also choose an existing secret with the following options
3232

3333
```
34-
agent:
35-
apiKeySecret:
36-
create: false
37-
name: <NAME_OF_EXISTING_SECRET>
34+
apiKeySecret:
35+
create: false
36+
name: <NAME_OF_EXISTING_SECRET>
3837
```
3938

4039
or create the secret with `extraManifests`
4140

4241
```
43-
agent:
44-
apiKeySecret:
45-
create: false
46-
name: checkly-agent-secret
42+
apiKeySecret:
43+
create: false
44+
name: checkly-agent-secret
4745
4846
extraManifests:
4947
- apiVersion: external-secrets.io/v1beta1

charts/agent/templates/deployment.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
{{- toYaml . | nindent 8 }}
3232
{{- end }}
3333
shareProcessNamespace: false
34-
terminationGracePeriodSeconds: {{ .Values.agent.terminationGracePeriodSeconds | default 300 }}
34+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds | default 300 }}
3535
containers:
3636
- name: {{ .Chart.Name }}
3737
{{- with .Values.securityContext }}
@@ -41,14 +41,18 @@ spec:
4141
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4242
imagePullPolicy: {{ .Values.image.pullPolicy }}
4343
env:
44+
{{- range $key, $value := .Values.env }}
45+
- name: "{{ tpl $key $ }}"
46+
value: "{{ tpl (print $value) $ }}"
47+
{{- end }}
4448
- name: "API_KEY"
4549
valueFrom:
4650
secretKeyRef:
4751
key: apiKey
48-
{{- if .Values.agent.apiKeySecret.create }}
52+
{{- if .Values.apiKeySecret.create }}
4953
name: {{ .Release.Name }}-auth
50-
{{- else if and .Values.agent.apiKeySecret.name (not .Values.agent.apiKeySecret.create) }}
51-
name: {{ .Values.agent.apiKeySecret.name }}
54+
{{- else if and .Values.apiKeySecret.name (not .Values.apiKeySecret.create) }}
55+
name: {{ .Values.apiKeySecret.name }}
5256
{{- end }}
5357
{{- with .Values.livenessProbe }}
5458
livenessProbe:

charts/agent/templates/secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{{- if .Values.agent.apiKeySecret.create }}
1+
{{- if .Values.apiKeySecret.create }}
22
apiVersion: v1
33
kind: Secret
44
metadata:
55
name: {{ .Release.Name }}-auth
66
namespace: {{ .Release.Namespace }}
77
data:
8-
apiKey: {{ .Values.agent.apiKeySecret.apiKey | b64enc }}
8+
apiKey: {{ .Values.apiKeySecret.apiKey | b64enc }}
99
{{- end}}

charts/agent/values.yaml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,29 @@ imagePullSecrets: []
1717
nameOverride: ""
1818
fullnameOverride: ""
1919

20-
agent:
21-
# -- Configures secret for agent API Key
22-
#
23-
# -- If you already have a secret with the Key, set `create` to
24-
# -- false and set the `name`` value to the name of your secret.
25-
#
26-
# -- If you don't have a secret, set `create` to true
27-
# -- and set the `apiKey`` value to your Key.
28-
#
29-
# -- You can also create a secret yourself via extraManifests[].
30-
# -- Set `create` to false and set `name` to the name of
31-
# -- your secret defined in your extraManifests.
32-
apiKeySecret:
33-
create: true
34-
apiKey: ""
35-
terminationGracePeriodSeconds: # default 300
20+
# Configures secret for agent API Key
21+
#
22+
# If you already have a secret with the Key, set `create` to
23+
# false and set the `name`` value to the name of your secret.
24+
#
25+
# If you don't have a secret, set `create` to true
26+
# and set the `apiKey`` value to your Key.
27+
#
28+
# You can also create a secret yourself via extraManifests[].
29+
# Set `create` to false and set `name` to the name of
30+
# your secret defined in your extraManifests.
31+
apiKeySecret:
32+
create: true
33+
apiKey: ""
34+
35+
terminationGracePeriodSeconds: # default 300
36+
37+
# Extra environment variables to be passed to agent pods
38+
#
39+
# env:
40+
# MY_ENV_VAR: myvalue
41+
# ANOTHER_VAR: anothervalue
42+
env: {}
3643

3744
# This is for setting Kubernetes Annotations to a Pod.
3845
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

0 commit comments

Comments
 (0)