Skip to content

Commit c55ddeb

Browse files
committed
Move the ubbagent to inside the main cert-manager deployment
Signed-off-by: Maël Valais <mael@vls.dev>
1 parent 453da39 commit c55ddeb

File tree

7 files changed

+77
-94
lines changed

7 files changed

+77
-94
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ helm template "$APP_INSTANCE_NAME" chart/jetstack-secure-gcm \
494494
--set preflight.image.tag="$TAG" \
495495
--set preflight.serviceAccount.create=true \
496496
--set preflight.rbac.create=true \
497-
--set ubbagent.image.tag="$TAG" \
498-
--set ubbagent.reportingSecretName=$APP_INSTANCE_NAME-license \
497+
--set cert-manager.ubbagent.image.tag="$TAG" \
498+
--set cert-manager.ubbagent.reportingSecretName=$APP_INSTANCE_NAME-license \
499499
> "${APP_INSTANCE_NAME}_manifest.yaml"
500500
```
501501

@@ -508,7 +508,7 @@ helm template "$APP_INSTANCE_NAME" chart/jetstack-secure-gcm \
508508
> --set cert-manager.webhook.image.repository=marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/cert-manager-webhook
509509
> --set google-cas-issuer.image.repository=marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/cert-manager-google-cas-issuer
510510
> --set preflight.image.repository=marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/preflight
511-
> --set ubbagent.image.repository=marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/ubbagent
511+
> --set cert-manager.ubbagent.image.repository=marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/ubbagent
512512
> ```
513513
514514
#### Apply the manifest to your Kubernetes cluster

chart/jetstack-secure-gcm/charts/cert-manager/templates/_helpers.tpl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ Create the name of the service account to use
4545
Webhook templates
4646
*/}}
4747

48-
{{/*
49-
Expand the name of the chart.
50-
Manually fix the 'app' and 'name' labels to 'webhook' to maintain
51-
compatibility with the v0.9 deployment selector.
52-
*/}}
53-
{{- define "webhook.name" -}}
54-
{{- printf "webhook" -}}
55-
{{- end -}}
56-
5748
{{/*
5849
Create a default fully qualified app name.
5950
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
@@ -90,15 +81,6 @@ Create the name of the service account to use
9081
cainjector templates
9182
*/}}
9283

93-
{{/*
94-
Expand the name of the chart.
95-
Manually fix the 'app' and 'name' labels to 'cainjector' to maintain
96-
compatibility with the v0.9 deployment selector.
97-
*/}}
98-
{{- define "cainjector.name" -}}
99-
{{- printf "cainjector" -}}
100-
{{- end -}}
101-
10284
{{/*
10385
Create a default fully qualified app name.
10486
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).

chart/jetstack-secure-gcm/charts/cert-manager/templates/deployment.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ spec:
6969
{{- end }}
7070
{{- if .Values.volumes }}
7171
volumes:
72+
- name: ubbagent-config
73+
configMap:
74+
name: ubbagent-config
7275
{{ toYaml .Values.volumes | indent 8 }}
7376
{{- end }}
7477
containers:
@@ -137,6 +140,33 @@ spec:
137140
{{- end }}
138141
resources:
139142
{{ toYaml .Values.resources | indent 12 }}
143+
- name: ubbagent
144+
image: "{{ .Values.ubbagent.image.repository }}:{{ .Values.ubbagent.image.tag }}"
145+
env:
146+
- name: AGENT_CONFIG_FILE
147+
value: "/etc/ubbagent/config.yaml"
148+
- name: AGENT_LOCAL_PORT
149+
value: "4567"
150+
- name: AGENT_ENCODED_KEY
151+
valueFrom:
152+
secretKeyRef:
153+
name: {{ default (print (.Release.Name | trunc 63 | trimSuffix "-") "-license") .Values.ubbagent.reportingSecretName }}
154+
key: reporting-key
155+
- name: AGENT_CONSUMER_ID
156+
valueFrom:
157+
secretKeyRef:
158+
name: {{ default (print (.Release.Name | trunc 63 | trimSuffix "-") "-license") .Values.ubbagent.reportingSecretName }}
159+
key: consumer-id
160+
volumeMounts:
161+
- name: ubbagent-config
162+
mountPath: /etc/ubbagent
163+
resources:
164+
limits:
165+
cpu: 200m
166+
memory: 100Mi
167+
requests:
168+
cpu: 10m
169+
memory: 20Mi
140170
{{- with .Values.nodeSelector }}
141171
nodeSelector:
142172
{{ toYaml . | indent 8 }}

chart/jetstack-secure-gcm/charts/cert-manager/values.yaml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# GCM-specific Helm values added by Mael.
2+
ubbagent:
3+
# By default, the reportingSecretName will be set to
4+
# ${helm-release}-license.
5+
#
6+
# reportingSecretName: chartname-license
7+
image:
8+
repository: gcr.io/cloud-marketplace-tools/metering/ubbagent
9+
tag: latest
10+
111
# Default values for cert-manager.
212
# This is a YAML-formatted file.
313
# Declare variables to be passed into your templates.
@@ -28,7 +38,8 @@ installCRDs: false
2838

2939
replicaCount: 1
3040

31-
strategy: {}
41+
strategy:
42+
{}
3243
# type: RollingUpdate
3344
# rollingUpdate:
3445
# maxSurge: 0
@@ -67,7 +78,8 @@ serviceAccount:
6778
# annotations: {}
6879

6980
# Optional additional arguments
70-
extraArgs: []
81+
extraArgs:
82+
[]
7183
# Use this flag to set a namespace that cert-manager will use to store
7284
# supporting resources required for each ClusterIssuer (default is kube-system)
7385
# - --cluster-resource-namespace=kube-system
@@ -78,7 +90,8 @@ extraEnv: []
7890
# - name: SOME_VAR
7991
# value: 'some value'
8092

81-
resources: {}
93+
resources:
94+
{}
8295
# requests:
8396
# cpu: 10m
8497
# memory: 32Mi
@@ -100,14 +113,14 @@ securityContext: {}
100113

101114
# Container Security Context to be set on the controller component container
102115
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
103-
containerSecurityContext: {}
116+
containerSecurityContext:
117+
{}
104118
# capabilities:
105119
# drop:
106120
# - ALL
107121
# readOnlyRootFilesystem: true
108122
# runAsNonRoot: true
109123

110-
111124
volumes: []
112125

113126
volumeMounts: []
@@ -133,7 +146,8 @@ podLabels: {}
133146

134147
nodeSelector: {}
135148

136-
ingressShim: {}
149+
ingressShim:
150+
{}
137151
# defaultIssuerName: ""
138152
# defaultIssuerKind: ""
139153
# defaultIssuerGroup: ""
@@ -180,7 +194,8 @@ webhook:
180194
replicaCount: 1
181195
timeoutSeconds: 10
182196

183-
strategy: {}
197+
strategy:
198+
{}
184199
# type: RollingUpdate
185200
# rollingUpdate:
186201
# maxSurge: 0
@@ -190,7 +205,8 @@ webhook:
190205

191206
# Container Security Context to be set on the webhook component container
192207
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
193-
containerSecurityContext: {}
208+
containerSecurityContext:
209+
{}
194210
# capabilities:
195211
# drop:
196212
# - ALL
@@ -212,7 +228,8 @@ webhook:
212228
# Optional additional arguments for webhook
213229
extraArgs: []
214230

215-
resources: {}
231+
resources:
232+
{}
216233
# requests:
217234
# cpu: 10m
218235
# memory: 32Mi
@@ -288,7 +305,8 @@ cainjector:
288305
enabled: true
289306
replicaCount: 1
290307

291-
strategy: {}
308+
strategy:
309+
{}
292310
# type: RollingUpdate
293311
# rollingUpdate:
294312
# maxSurge: 0
@@ -298,14 +316,14 @@ cainjector:
298316

299317
# Container Security Context to be set on the cainjector component container
300318
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
301-
containerSecurityContext: {}
319+
containerSecurityContext:
320+
{}
302321
# capabilities:
303322
# drop:
304323
# - ALL
305324
# readOnlyRootFilesystem: true
306325
# runAsNonRoot: true
307326

308-
309327
# Optional additional annotations to add to the cainjector Deployment
310328
# deploymentAnnotations: {}
311329

@@ -315,7 +333,8 @@ cainjector:
315333
# Optional additional arguments for cainjector
316334
extraArgs: []
317335

318-
resources: {}
336+
resources:
337+
{}
319338
# requests:
320339
# cpu: 10m
321340
# memory: 32Mi

chart/jetstack-secure-gcm/templates/billing-agent-deployment.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

chart/jetstack-secure-gcm/values.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ cert-manager:
3535
repository: marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/cert-manager-cainjector
3636
tag: 1.1.0-gcm.1
3737

38+
ubbagent:
39+
# By default, the reportingSecretName will be set to
40+
# ${helm-release}-license.
41+
#
42+
# reportingSecretName: chartname-license
43+
image:
44+
repository: marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/ubbagent
45+
tag: 1.1.0-gcm.1
46+
3847
google-cas-issuer:
3948
nameOverride: jetstack-secure-gcm
4049
installCRDs: true
@@ -54,12 +63,3 @@ preflight:
5463
image:
5564
repository: marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/preflight
5665
tag: 1.1.0-gcm.1
57-
58-
ubbagent:
59-
# By default, the reportingSecretName will be set to
60-
# ${helm-release}-license.
61-
#
62-
# reportingSecretName: chartname-license
63-
image:
64-
repository: marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/ubbagent
65-
tag: 1.1.0-gcm.1

schema.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ x-google-marketplace:
7676
type: TAG
7777
ubbagent:
7878
properties:
79-
ubbagent.image.repository:
79+
cert-manager.ubbagent.image.repository:
8080
type: REPO_WITH_REGISTRY
81-
ubbagent.image.tag:
81+
cert-manager.ubbagent.image.tag:
8282
type: TAG
8383

8484
# Allow the deployer to create CRDs and webhook configurations. See:
@@ -388,7 +388,7 @@ properties:
388388
verbs: ["get", "list"]
389389

390390
# https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools/blob/64181be/docs/billing-integration.md
391-
ubbagent.reportingSecretName:
391+
cert-manager.ubbagent.reportingSecretName:
392392
type: string
393393
x-google-marketplace:
394394
type: REPORTING_SECRET

0 commit comments

Comments
 (0)