diff --git a/.gitignore b/.gitignore index 0ba45e5..e7aaf29 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ bin/** # Others .DS_Store .vscode/** - -helm/runner/values/ \ No newline at end of file diff --git a/helm/runner/.helmignore b/helm/runner/.helmignore deleted file mode 100644 index 47c3a48..0000000 --- a/helm/runner/.helmignore +++ /dev/null @@ -1,25 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ - -values/ diff --git a/helm/runner/Chart.yaml b/helm/runner/Chart.yaml deleted file mode 100644 index 28e04a1..0000000 --- a/helm/runner/Chart.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v2 -name: runner -description: Helm Chart for DeepSource Runner -maintainers: - - name: DeepSource - email: support@deepsource.io - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -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: 0.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: "1.16.0" diff --git a/helm/runner/README.md b/helm/runner/README.md deleted file mode 100644 index a2337a9..0000000 --- a/helm/runner/README.md +++ /dev/null @@ -1,77 +0,0 @@ -## Parameters - -### Runner configuration Parameters - -| Name | Description | Value | -| --------------------------------------------- | -------------------------------------------------------------- | ------- | -| `config.apps` | Configuration values for the VCS apps to be used by the runner | `[]` | -| `config.deepsource` | Configuration values for the deepsource remote host | `{}` | -| `config.kubernetes.namespace` | The namespace to schedule the tasks in | `""` | -| `config.kubernetes.nodeSelector` | The node selector to use for the tasks | `{}` | -| `config.kubernetes.imageRegistry.registryUrl` | The registry url to use for the task images | `""` | -| `config.kubernetes.imageRegistry.username` | The username to use for the image registry | `""` | -| `config.kubernetes.imageRegistry.password` | The password to use for the image registry | `""` | -| `config.objectStorage.backend` | The backend to use for the object storage (e.g gcs) | `""` | -| `config.objectStorage.bucket` | The bucket to use for the object storage | `""` | -| `config.objectStorage.credential` | The credentials value to use for the object storage | `""` | -| `config.runner.id` | The id of the runner | `""` | -| `config.runner.host` | The host of the runner to use | `""` | -| `config.runner.clientId` | The client id to use for the runner | `""` | -| `config.runner.clientSecret` | The client secret to use for the runner | `""` | -| `config.runner.privateKey` | The private key to use for the runner | `""` | -| `config.runner.webhookSecret` | The webhook secret to use for the runner | `""` | -| `config.saml.enabled` | Whether to enable SAML2.0 authentication | `false` | -| `config.saml.certificate` | The certificate to use for the runner as service provider | `""` | -| `config.saml.key` | The private key to use for the runner as service provider | `""` | -| `config.saml.metadataUrl` | The metadata url to use for the identity provider | `""` | - -### Common Parameters - -| Name | Description | Value | -| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | -| `replicaCount` | Number of deepsource runner replicas to deploy | `1` | -| `image.repository` | deepsource runner image repository | `us.gcr.io/deepsource-dev/runner` | -| `image.pullPolicy` | deepsource runner image pull policy | `Always` | -| `image.tag` | deepsource runner image tag | `""` | -| `imagePullSecrets` | deepsource runner image pull secrets | `[]` | -| `nameOverride` | String to partially override runner.name | `""` | -| `fullnameOverride` | String to partially override runner.name | `""` | -| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | -| `serviceAccount.annotations` | Annotations for service account. Evaluated as a template. Only used if `create` is `true`. | `{}` | -| `serviceAccount.name` | Name of the service account to use. If not set and create is true, a name is generated using the fullname template. | `""` | -| `podAnnotations` | Annotations for the deepsource runner pods | `{}` | -| `podSecurityContext` | Security context policies to add to the deepsource runner pods | `{}` | -| `securityContext` | Security context policies to add to the containers | `{}` | -| `service.type` | deepsource runner service type | `ClusterIP` | -| `service.port` | deepsource runner service HTTP port | `80` | -| `ingress.enabled` | Enable ingress record generation for deepsource runner | `false` | -| `ingress.className` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` | -| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | -| `ingress.hosts` | Deepsource runner Ingress hosts | `[]` | -| `ingress.tls` | Deepsource runner Ingress TLS configuration | `[]` | -| `resources.limits.cpu` | The resources limits for the deepsource runner containers | `200m` | -| `resources.limits.memory` | The resources limits for the deepsource runner containers | `1Gi` | -| `resources.requests.cpu` | The requested cpu for the deepsource runner containers | `100m` | -| `resources.requests.memory` | The requested memory for the deepsource runner containers | `128Mi` | -| `autoscaling.enabled` | Enable Horizontal POD autoscaling for deepsource runner | `false` | -| `autoscaling.minReplicas` | Minimum number of deepsource runner replicas | `1` | -| `autoscaling.maxReplicas` | Maximum number of deepsource runner replicas | `100` | -| `autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization percentage | `80` | -| `autoscaling.targetMemoryUtilizationPercentage` | Target Memory utilization percentage | `80` | -| `nodeSelector` | Node labels for deepsource runner pods assignment | `{}` | -| `tolerations` | Tolerations for deepsource runner pods assignment | `[]` | -| `affinity` | Affinity for deepsource runner pods assignment | `{}` | - -### RQLite configuration parameters - -| Name | Description | Value | -| ---------------------------------- | ---------------------------------------------------------------- | --------------- | -| `rqlite.image.repository` | RQLite image repository | `rqlite/rqlite` | -| `rqlite.image.pullPolicy` | RQLite image pull policy | `IfNotPresent` | -| `rqlite.image.tag` | RQLite image tag | `7.20.6` | -| `rqlite.replicaCount` | Number of rqlite replicas to deploy | `1` | -| `rqlite.storageSize` | The size of the persistent volume to use for the rqlite database | `1Gi` | -| `rqlite.resources.limits.cpu` | The resources limits for the rqlite containers | `200m` | -| `rqlite.resources.limits.memory` | The resources limits for the rqlite containers | `1Gi` | -| `rqlite.resources.requests.cpu` | The requested cpu for the rqlite containers | `100m` | -| `rqlite.resources.requests.memory` | The requested memory for the rqlite containers | `128Mi` | diff --git a/helm/runner/templates/NOTES.txt b/helm/runner/templates/NOTES.txt deleted file mode 100644 index d9df937..0000000 --- a/helm/runner/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "runner.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "runner.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "runner.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "runner.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/helm/runner/templates/_helpers.tpl b/helm/runner/templates/_helpers.tpl deleted file mode 100644 index a75fda5..0000000 --- a/helm/runner/templates/_helpers.tpl +++ /dev/null @@ -1,79 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "runner.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "runner.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "runner.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "runner.labels" -}} -helm.sh/chart: {{ include "runner.chart" . }} -{{ include "runner.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "runner.selectorLabels" -}} -app.kubernetes.io/name: {{ include "runner.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "runner.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "runner.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} - -{{- define "rqlite.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-rqlite -{{- end }} - -{{- define "rqlite.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }}-rqlite -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}-rqlite -{{- end }} -{{- end }} -{{- end }} diff --git a/helm/runner/templates/artifact-secret.yaml b/helm/runner/templates/artifact-secret.yaml deleted file mode 100644 index 665fb38..0000000 --- a/helm/runner/templates/artifact-secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: "artifacts-credentials" - namespace: {{ .Values.config.kubernetes.namespace }} -type: Opaque -data: - credentials: {{ .Values.config.objectStorage.credential | b64enc | indent 2 }} diff --git a/helm/runner/templates/deployment.yaml b/helm/runner/templates/deployment.yaml deleted file mode 100644 index 877169c..0000000 --- a/helm/runner/templates/deployment.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "runner.fullname" . }} - labels: - {{- include "runner.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "runner.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "runner.selectorLabels" . | nindent 8 }} - spec: - imagePullSecrets: - - name: {{ include "runner.fullname" . }}-image-registry - serviceAccountName: {{ include "runner.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/app/runner"] - args: ["--config", "/config/config.yaml", "--debug", "true"] - env: - - name: RQLITE_HOST - value: {{ include "rqlite.fullname" . }}-svc - - name: RQLITE_PORT - value: "4001" - - name: TASK_IMAGE_PULL_SECRET_NAME - value: {{ include "runner.fullname" . }}-image-registry - ports: - - name: http - containerPort: 8080 - protocol: TCP - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - name: secret - mountPath: "/config" - readOnly: true - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: secret - secret: - secretName: {{ include "runner.fullname" . }} - items: - - key: config - path: config.yaml \ No newline at end of file diff --git a/helm/runner/templates/hpa.yaml b/helm/runner/templates/hpa.yaml deleted file mode 100644 index 471ad8f..0000000 --- a/helm/runner/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "runner.fullname" . }} - labels: - {{- include "runner.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "runner.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/helm/runner/templates/image-pull-secret.yaml b/helm/runner/templates/image-pull-secret.yaml deleted file mode 100644 index 6228cf2..0000000 --- a/helm/runner/templates/image-pull-secret.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "runner.fullname" . }}-image-registry - namespace: {{ .Release.Namespace }} -type: kubernetes.io/dockerconfigjson -stringData: - .dockerconfigjson: |- -{{- $auth := printf "%s:%s" .Values.config.kubernetes.imageRegistry.username .Values.config.kubernetes.imageRegistry.password | b64enc }} - { - "auths": { - "{{ .Values.config.kubernetes.imageRegistry.registryUrl }}": { - "username": "{{ .Values.config.kubernetes.imageRegistry.username }}", - "password": "{{ .Values.config.kubernetes.imageRegistry.password }}", - "auth": "{{ $auth }}" - } - } - } ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "runner.fullname" . }}-image-registry - namespace: {{ .Values.config.kubernetes.namespace }} -type: kubernetes.io/dockerconfigjson -stringData: - .dockerconfigjson: |- -{{- $auth := printf "%s:%s" .Values.config.kubernetes.imageRegistry.username .Values.config.kubernetes.imageRegistry.password | b64enc }} - { - "auths": { - "{{ .Values.config.kubernetes.imageRegistry.registryUrl }}": { - "username": "{{ .Values.config.kubernetes.imageRegistry.username }}", - "password": "{{ .Values.config.kubernetes.imageRegistry.password }}", - "auth": "{{ $auth }}" - } - } - } diff --git a/helm/runner/templates/ingress.yaml b/helm/runner/templates/ingress.yaml deleted file mode 100644 index 4df6e2f..0000000 --- a/helm/runner/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "runner.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "runner.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/helm/runner/templates/role.yaml b/helm/runner/templates/role.yaml deleted file mode 100644 index 1f1e3bc..0000000 --- a/helm/runner/templates/role.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: "runner-jobs" - namespace: {{ .Values.config.kubernetes.namespace }} -rules: -- apiGroups: ["batch"] - resources: ["jobs"] - verbs: ["get", "list", "create", "delete"] diff --git a/helm/runner/templates/rolebinding.yaml b/helm/runner/templates/rolebinding.yaml deleted file mode 100644 index f3536ee..0000000 --- a/helm/runner/templates/rolebinding.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: "runner-jobs" - namespace: {{ .Values.config.kubernetes.namespace }} -subjects: -- kind: ServiceAccount - name: "runner" - namespace: default -roleRef: - kind: Role - name: "runner-jobs" - apiGroup: rbac.authorization.k8s.io diff --git a/helm/runner/templates/rqlite-internal-service.yaml b/helm/runner/templates/rqlite-internal-service.yaml deleted file mode 100644 index ed860d3..0000000 --- a/helm/runner/templates/rqlite-internal-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "rqlite.fullname" . }}-svc-internal -spec: - clusterIP: None - publishNotReadyAddresses: True - selector: - app: {{ include "rqlite.name" . }} - ports: - - protocol: TCP - port: 4001 - targetPort: 4001 diff --git a/helm/runner/templates/rqlite-service.yaml b/helm/runner/templates/rqlite-service.yaml deleted file mode 100644 index 710b7c2..0000000 --- a/helm/runner/templates/rqlite-service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "rqlite.fullname" . }}-svc -spec: - selector: - app: {{ include "rqlite.name" . }} - ports: - - protocol: TCP - port: 4001 - targetPort: 4001 diff --git a/helm/runner/templates/rqlite-statefulset.yaml b/helm/runner/templates/rqlite-statefulset.yaml deleted file mode 100644 index 43ae761..0000000 --- a/helm/runner/templates/rqlite-statefulset.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "rqlite.fullname" . }} -spec: - selector: - matchLabels: - app: {{ include "rqlite.name" . }} - serviceName: {{ include "rqlite.fullname" . }}-svc-internal - replicas: {{ .Values.rqlite.replicaCount }} - podManagementPolicy: "Parallel" - template: - metadata: - labels: - app: {{ include "rqlite.name" . }} - spec: - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - terminationGracePeriodSeconds: 10 - containers: - - name: {{ include "rqlite.name" . }} - image: {{ .Values.rqlite.image.repository }}:{{ .Values.rqlite.image.tag }} - imagePullPolicy: {{ .Values.rqlite.image.pullPolicy }} - args: - - "-disco-mode=dns" - - "-disco-config={\"name\":\"{{ include "rqlite.fullname" . }}-svc-internal\"}" - - "-bootstrap-expect={{ .Values.rqlite.replicaCount }}" - - "-join-interval=1s" - - "-join-attempts=120" - ports: - - containerPort: 4001 - name: rqlite - resources: - {{- toYaml .Values.resources | nindent 12 }} - readinessProbe: - httpGet: - scheme: HTTP - path: /readyz - port: 4001 - periodSeconds: 5 - timeoutSeconds: 2 - initialDelaySeconds: 2 - livenessProbe: - httpGet: - scheme: HTTP - path: /readyz?noleader - port: rqlite - initialDelaySeconds: 5 - timeoutSeconds: 2 - failureThreshold: 3 - volumeMounts: - - name: rqlite-file - mountPath: /rqlite/file - volumeClaimTemplates: - - metadata: - name: rqlite-file - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: {{ .Values.rqlite.storageSize }} diff --git a/helm/runner/templates/secret.yaml b/helm/runner/templates/secret.yaml deleted file mode 100644 index d33da85..0000000 --- a/helm/runner/templates/secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "runner.fullname" . }} - namespace: {{ .Release.Namespace }} -type: Generic -data: - config: | -{{ .Values.config | toYaml | toString | b64enc | indent 4 }} diff --git a/helm/runner/templates/service.yaml b/helm/runner/templates/service.yaml deleted file mode 100644 index f8b4901..0000000 --- a/helm/runner/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "runner.fullname" . }} - labels: - {{- include "runner.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: 8080 - protocol: TCP - name: http - selector: - {{- include "runner.selectorLabels" . | nindent 4 }} diff --git a/helm/runner/templates/serviceaccount.yaml b/helm/runner/templates/serviceaccount.yaml deleted file mode 100644 index 288876c..0000000 --- a/helm/runner/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "runner.serviceAccountName" . }} - labels: - {{- include "runner.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/helm/runner/templates/task-namespace.yaml b/helm/runner/templates/task-namespace.yaml deleted file mode 100644 index 52281bb..0000000 --- a/helm/runner/templates/task-namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.config.kubernetes.namespace }} - labels: - {{- include "runner.labels" . | nindent 4 }} diff --git a/helm/runner/templates/tests/test-connection.yaml b/helm/runner/templates/tests/test-connection.yaml deleted file mode 100644 index 6f971db..0000000 --- a/helm/runner/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "runner.fullname" . }}-test-connection" - labels: - {{- include "runner.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "runner.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm/runner/values.schema.json b/helm/runner/values.schema.json deleted file mode 100644 index 68d6596..0000000 --- a/helm/runner/values.schema.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema#", - "type": "object", - "properties": { - "config": { - "type": "object", - "properties": { - "runner": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "host": { - "type": "string" - }, - "clientId": { - "type": "string" - }, - "clientSecret": { - "type": "string" - }, - "privateKey": { - "type": "string" - }, - "webhookSecret": { - "type": "string" - } - } - }, - "deepsource": { - "type": "object", - "properties": { - "host": { - "type": "string" - }, - "publicKey": { - "type": "string" - } - } - }, - "apps": { - "type": "array" - }, - "saml": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "metadataUrl": { - "type": "string" - }, - "certificate": { - "type": "string" - }, - "key": { - "type": "string" - } - } - }, - "objectStorage": { - "type": "object", - "properties": { - "backend": { - "type": "string" - }, - "bucket": { - "type": "string" - }, - "credential": { - "type": "string" - } - } - } - } - }, - "replicaCount": { - "type": "integer" - }, - "image": { - "type": "object", - "properties": { - "repository": { - "type": "string" - }, - "pullPolicy": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "imagePullSecrets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ] - } - }, - "nameOverride": { - "type": "string" - }, - "fullnameOverride": { - "type": "string" - }, - "serviceAccount": { - "type": "object", - "properties": { - "create": { - "type": "boolean" - }, - "annotations": { - "type": "object" - }, - "name": { - "type": "string" - } - } - }, - "podAnnotations": { - "type": "object" - }, - "podSecurityContext": { - "type": "object" - }, - "securityContext": { - "type": "object" - }, - "service": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "port": { - "type": "integer" - } - } - }, - "ingress": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "className": { - "type": "string" - }, - "annotations": { - "type": "object" - }, - "hosts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "host": { - "type": "string" - }, - "paths": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "pathType": { - "type": "string" - } - } - } - } - } - } - }, - "tls": { - "type": "array", - "items": { - "type": "object", - "properties": { - "hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "secretName": { - "type": "string" - } - }, - "required": [ - "hosts", - "secretName" - ] - } - } - } - }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object" - }, - "requests": { - "type": "object" - } - } - }, - "nodeSelector": { - "type": "object" - }, - "tolerations": { - "type": "array", - "items": { - "type": "object" - } - }, - "affinity": { - "type": "object" - }, - "rqlite": { - "type": "object", - "properties": { - "image": { - "type": "object", - "properties": { - "repository": { - "type": "string" - }, - "pullPolicy": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "replicaCount": { - "type": "integer" - }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object" - }, - "requests": { - "type": "object" - } - } - }, - "storageSize": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/helm/runner/values.yaml b/helm/runner/values.yaml deleted file mode 100644 index 87cbb87..0000000 --- a/helm/runner/values.yaml +++ /dev/null @@ -1,291 +0,0 @@ -## @section Runner configuration Parameters -## - -## The configuration values for deepsource runner, this will create a secret to be used by the runner -## -config: - ## @param config.apps Configuration values for the VCS apps to be used by the runner - ## apps: - ## - name: app1 - ## provider: github - ## github: - ## apiHost: "" - ## appId: "" - ## clientId: "" - ## clientSecret: "" - ## host: "" - ## privateKey: "" - ## slug: "" - ## webhookSecret: "" - ## - apps: [] - ## @param config.deepsource Configuration values for the deepsource remote host - ## deepsource: - ## host: "example.app.deepsource.com" - ## publicKey: "" - ## - deepsource: {} - ## Configuration values for the kubernetes cluster - ## - kubernetes: - ## @param config.kubernetes.namespace The namespace to schedule the tasks in - ## - namespace: "" - ## @param config.kubernetes.nodeSelector The node selector to use for the tasks - ## - nodeSelector: {} - ## The image regitry configuration to use for the tasks - ## - imageRegistry: - ## @param config.kubernetes.imageRegistry.registryUrl The registry url to use for the task images - ## - registryUrl: "" - ## @param config.kubernetes.imageRegistry.username The username to use for the image registry - ## - username: "" - ## @param config.kubernetes.imageRegistry.password The password to use for the image registry - ## - password: "" - ## 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) - ## - backend: "" - ## @param config.objectStorage.bucket The bucket to use for the object storage - ## - bucket: "" - ## @param config.objectStorage.credential The credentials value to use for the object storage - ## - credential: "" - ## Configuration values for the runner - ## - runner: - ## @param config.runner.id The id of the runner - ## - id: "" - ## @param config.runner.host The host of the runner to use - ## - host: "" - ## @param config.runner.clientId The client id to use for the runner - ## - clientId: "" - ## @param config.runner.clientSecret The client secret to use for the runner - ## - clientSecret: "" - ## @param config.runner.privateKey The private key to use for the runner - ## - privateKey: "" - ## @param config.runner.webhookSecret The webhook secret to use for the runner - ## - webhookSecret: "" - ## Configuration values for the SAML2.0 identity provider - ## - saml: - ## @param config.saml.enabled Whether to enable SAML2.0 authentication - ## - enabled: false - ## @param config.saml.certificate The certificate to use for the runner as service provider - ## - certificate: "" - ## @param config.saml.key The private key to use for the runner as service provider - ## - key: "" - ## @param config.saml.metadataUrl The metadata url to use for the identity provider - metadataUrl: "" - -## @section Common Parameters -## - -## @param replicaCount Number of deepsource runner replicas to deploy -## -replicaCount: 1 - -## Deepsource runner image version -## @param image.repository deepsource runner image repository -## @param image.pullPolicy deepsource runner image pull policy -## @param image.tag deepsource runner image tag -## -image: - repository: proxy.deepsource.com/images/deepsource-production/runner - pullPolicy: Always - tag: "" - -## @param imagePullSecrets deepsource runner image pull secrets -imagePullSecrets: [] - -## @param nameOverride String to partially override runner.name -## -nameOverride: "" - -## @param fullnameOverride String to partially override runner.name -## -fullnameOverride: "" - -## ServiceAccount configuration -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ -## @param serviceAccount.create Specifies whether a ServiceAccount should be created -## @param serviceAccount.annotations Annotations for service account. Evaluated as a template. Only used if `create` is `true`. -## @param serviceAccount.name Name of the service account to use. If not set and create is true, a name is generated using the fullname template. -## -serviceAccount: - create: true - annotations: {} - name: "" - -## @param podAnnotations Annotations for the deepsource runner pods -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## @param podSecurityContext Security context policies to add to the deepsource runner pods -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: {} - -## @param securityContext Security context policies to add to the containers -## -securityContext: {} - -## deepsource runner service parameters -## -service: - ## @param service.type deepsource runner service type - ## - type: ClusterIP - ## @param service.port deepsource runner service HTTP port - ## - port: 80 - -## DeepSource runner ingress parameters -## ref: https://kubernetes.io/docs/user-guide/ingress/ -## -ingress: - ## @param ingress.enabled Enable ingress record generation for deepsource runner - ## - enabled: false - ## @param ingress.className IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) - ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster. - ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ - ## - className: "" - ## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. - ## Use this parameter to set the required annotations for cert-manager, see - ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations - ## e.g: - ## annotations: - ## kubernetes.io/ingress.class: nginx - ## cert-manager.io/cluster-issuer: cluster-issuer-name - ## - annotations: {} - ## @param ingress.hosts Deepsource runner Ingress hosts - ## hosts: - ## - host: runner.example.com - ## paths: - ## - path: / - ## pathType: ImplementationSpecific - hosts: [] - ## @param ingress.tls Deepsource runner Ingress TLS configuration - ## tls: - ## - secretName: tls-runner-deepsource-com - ## hosts: - ## - runner.example.com - tls: [] - -## DeepSource runner resource requests and limits -## ref: https://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - ## The resources limits for the deepsource runner containers - ## - limits: - ## @param resources.limits.cpu The resources limits for the deepsource runner containers - ## - cpu: 200m - ## @param resources.limits.memory The resources limits for the deepsource runner containers - ## - memory: 1Gi - ## The requested resources for the deepsource runner containers - ## - requests: - ## @param resources.requests.cpu The requested cpu for the deepsource runner containers - ## - cpu: 100m - ## @param resources.requests.memory The requested memory for the deepsource runner containers - ## - memory: 128Mi - -## Autoscaling parameters -## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ -## @param autoscaling.enabled Enable Horizontal POD autoscaling for deepsource runner -## @param autoscaling.minReplicas Minimum number of deepsource runner replicas -## @param autoscaling.maxReplicas Maximum number of deepsource runner replicas -## @param autoscaling.targetCPUUtilizationPercentage Target CPU utilization percentage -## @param autoscaling.targetMemoryUtilizationPercentage Target Memory utilization percentage -## -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - targetMemoryUtilizationPercentage: 80 - -## @param nodeSelector Node labels for deepsource runner pods assignment -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## @param tolerations Tolerations for deepsource runner pods assignment -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## @param affinity Affinity for deepsource runner pods assignment -## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## @section RQLite configuration parameters -## - -## RQLite configuration parameters -rqlite: - ## RQLite image version - ## @param rqlite.image.repository RQLite image repository - ## @param rqlite.image.pullPolicy RQLite image pull policy - ## @param rqlite.image.tag RQLite image tag - ## - image: - repository: "rqlite/rqlite" - pullPolicy: IfNotPresent - tag: "7.20.6" - - ## @param rqlite.replicaCount Number of rqlite replicas to deploy - ## - replicaCount: 1 - - ## @param rqlite.storageSize The size of the persistent volume to use for the rqlite database - ## - storageSize: 1Gi - - ## RQLite resource requests and limits - ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ - resources: - ## The resources limits for the rqlite containers - ## - limits: - ## @param rqlite.resources.limits.cpu The resources limits for the rqlite containers - ## - cpu: 200m - ## @param rqlite.resources.limits.memory The resources limits for the rqlite containers - ## - memory: 1Gi - ## The requested resources for the rqlite containers - ## - requests: - ## @param rqlite.resources.requests.cpu The requested cpu for the rqlite containers - ## - cpu: 100m - ## @param rqlite.resources.requests.memory The requested memory for the rqlite containers - ## - memory: 128Mi