diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 00000000..cd5bbe01 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: Hound +description: Code searching tool +type: application +version: 0.1.0 +appVersion: 1.0.0 diff --git a/helm/README.md b/helm/README.md new file mode 100644 index 00000000..4461da6e --- /dev/null +++ b/helm/README.md @@ -0,0 +1,6 @@ +[Helm](https://helm.sh/) Chart. Mainly for using in [Concourse CI](../concourse.md) + +docker.pkg.github.com +========================== + +Github registry doesn't work with k8s: https://github.com/containerd/containerd/issues/3291 diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt new file mode 100644 index 00000000..cebcfbf2 --- /dev/null +++ b/helm/templates/NOTES.txt @@ -0,0 +1 @@ +TODO: NOTES.txt diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl new file mode 100644 index 00000000..c097a96d --- /dev/null +++ b/helm/templates/_helpers.tpl @@ -0,0 +1,7 @@ +{{- define "imagePullSecret" }} +{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.image.registry (printf "%s:%s" .Values.image.username .Values.image.password | b64enc) | b64enc }} +{{- end }} + +{{- define "imageFull" -}} +{{- printf "%s/%s:%s" .Values.image.registry .Values.image.name .Values.image.tag -}} +{{- end -}} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml new file mode 100644 index 00000000..001182bd --- /dev/null +++ b/helm/templates/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hound-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: hound + template: + metadata: + labels: + app: hound + spec: + imagePullSecrets: + - name: github-docker-registry-secret + containers: + - name: hound + image: {{ include "imageFull" . }} + ports: + - containerPort: 6080 diff --git a/helm/templates/secret.yaml b/helm/templates/secret.yaml new file mode 100644 index 00000000..6108245a --- /dev/null +++ b/helm/templates/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: github-docker-registry-secret +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: {{ template "imagePullSecret" . }} diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 00000000..0b196de4 --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: hound-service +spec: + type: NodePort + ports: + - port: 6080 + targetPort: 6080 + protocol: TCP + selector: + app: hound diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 00000000..67cd3d24 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,7 @@ +# Following values must be specified +image: + registry: docker.pkg.github.com + name: it-projects-llc/hound/pr + tag: + username: + password: