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

chore: add support for adding manually created secrets and sentry #7

Merged
merged 6 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions charts/runner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.2
version: 1.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v1.0.0-beta.2"
appVersion: "v1.0.0-beta.3"
4 changes: 3 additions & 1 deletion charts/runner/templates/artifact-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{ if .Values.config.objectStorage.createSecret }}
apiVersion: v1
kind: Secret
metadata:
name: "artifacts-credentials"
name: {{ include "runner.fullname" . }}-object-storage
namespace: {{ .Release.Namespace }}
type: Opaque
data:
credentials: {{ .Values.config.objectStorage.credential | b64enc | indent 2 }}
{{ end }}
20 changes: 19 additions & 1 deletion charts/runner/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ spec:
{{- include "runner.selectorLabels" . | nindent 8 }}
spec:
imagePullSecrets:
{{- if .Values.imageRegistry.createSecret }}
- name: {{ include "runner.fullname" . }}-image-registry
{{- else }}
- name: {{ .Values.imageRegistry.secretName }}
{{- end }}
serviceAccountName: {{ include "runner.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand All @@ -39,13 +43,23 @@ spec:
- name: RQLITE_PORT
value: "4001"
- name: TASK_IMAGE_PULL_SECRET_NAME
{{- if .Values.imageRegistry.createSecret }}
value: {{ include "runner.fullname" . }}-image-registry
{{- else }}
value: {{ .Values.imageRegistry.secretName }}
{{- end }}
- name: TASK_IMAGE_REGISTRY_URL
value: {{ .Values.imageRegistry.registryUrl }}
- name: TASK_NAMESPACE
value: {{ .Release.Namespace }}
- name: TASK_NODE_SELECTOR
value: {{ .Values.nodeSelector | toYaml | toString | quote }}
- name: TASK_ARTIFACT_SECRET_NAME
{{- if .Values.config.objectStorage.createSecret }}
value: {{ include "runner.fullname" . }}-object-storage
{{- else }}
value: {{ .Values.config.objectStorage.secretName }}
{{- end }}
ports:
- name: http
containerPort: 8080
Expand All @@ -71,7 +85,11 @@ spec:
volumes:
- name: secret
secret:
{{- if .Values.config.createSecret}}
secretName: {{ include "runner.fullname" . }}
{{- else }}
secretName: {{ .Values.config.secretName }}
{{- end }}
items:
- key: config
path: config.yaml
path: config.yaml
6 changes: 4 additions & 2 deletions charts/runner/templates/image-pull-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{ if .Values.imageRegistry.createSecret }}
apiVersion: v1
kind: Secret
metadata:
metadata:
name: {{ include "runner.fullname" . }}-image-registry
namespace: {{ .Release.Namespace }}
type: kubernetes.io/dockerconfigjson
Expand All @@ -9,10 +10,11 @@ stringData:
{{- $auth := printf "%s:%s" .Values.imageRegistry.username .Values.imageRegistry.password | b64enc }}
{
"auths": {
"{{ .Values.imageRegistry.registryUrl }}": {
"proxy.deepsource.com": {
"username": "{{ .Values.imageRegistry.username }}",
"password": "{{ .Values.imageRegistry.password }}",
"auth": "{{ $auth }}"
}
}
}
{{ end }}
2 changes: 2 additions & 0 deletions charts/runner/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.config.createSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ type: Generic
data:
config: |
{{ .Values.config | toYaml | toString | b64enc | indent 4 }}
{{ end }}
10 changes: 9 additions & 1 deletion charts/runner/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"objectStorage": {
"type": "object",
"properties": {
"backend": {
"provider": {
"type": "string"
},
"bucket": {
Expand All @@ -72,6 +72,14 @@
"type": "string"
}
}
},
"sentry": {
"type": "object",
"properties": {
"dsn": {
"type": "string"
}
}
}
}
},
Expand Down
10 changes: 8 additions & 2 deletions charts/runner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
## The configuration values for deepsource runner, this will create a secret to be used by the runner
##
config:
createSecret: true
secretName: ""
## @param config.apps Configuration values for the VCS apps to be used by the runner
## apps:
## - id: app1
Expand All @@ -29,9 +31,11 @@ config:
## Configuration values for the object storage to use for the runner
##
objectStorage:
## @param config.objectStorage.backend The backend to use for the object storage (e.g gcs)
createSecret: true
secretName: ""
## @param config.objectStorage.provider The provider to use for the object storage (e.g gcs, s3)
##
backend: ""
provider: ""
## @param config.objectStorage.bucket The bucket to use for the object storage
##
bucket: ""
Expand Down Expand Up @@ -96,6 +100,8 @@ image:
## @param imageRegistry.username The username to use for the image registry
## @param imageRegistry.password The password to use for the image registry
imageRegistry:
createSecret: true
secretName: ""
registryUrl: ""
username: ""
password: ""
Expand Down
Loading