Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GCP PubSub configuration #34

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions charts/fleet-telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ helm upgrade fleet-telemetry teslamotors/fleet-telemetry -n fleet-telemetry
| `replicas` | Number of pods | `1` |
| `service.annotations` | Service Annotations | {} |
| `service.type` | Service Type | ClusterIP |
| `gcpSecret` | Name of existing secret if you use GCP PubSub (SA key must be set in the key.json) | `nil` |

## Example
* Set `config.data` in `values.yaml`
Expand Down
15 changes: 15 additions & 0 deletions charts/fleet-telemetry/templates/2-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
env:
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
{{- if .Values.gcpSecret }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /etc/gcp/key.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be /etc/gcp/{{.Values.gcpSecret}}
I dont know the proper syntax for it

{{- end}}
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -61,6 +65,10 @@ spec:
name: config
- mountPath: /etc/certs/server
name: server-certs
{{ if .Values.gcpSecret }}
- mountPath: /etc/gcp
name: gcp-secret
{{ end }}
nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }}
tolerations: {{- toYaml .Values.tolerations | nindent 8 }}
volumes:
Expand All @@ -74,3 +82,10 @@ spec:
sources:
- secret:
name: {{ .Values.tlsSecret.name | default (printf "%s" (include "fleet-telemetry.fullname" .)) }}
{{ if .Values.gcpSecret }}
- name: gcp-secret
projected:
sources:
- secret:
name: {{ .Values.gcpSecret }}
{{ end }}
1 change: 1 addition & 0 deletions charts/fleet-telemetry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ config:
profile:
port: 4269
kubernetesClusterDomain: cluster.local
gcpSecret: null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed. only setting GOOGLE_APPLICATION_CREDENTIALS should be fine?