diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d5a475..f58c0a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,6 +18,9 @@ workflows: branches: &filter-only-main only: - main + requires: + - get-version + - pre-commit jobs: get-version: @@ -88,7 +91,7 @@ jobs: - checkout - add_ssh_keys: fingerprints: - - 'TODO: add fingerprint here' + - '99:72:8a:c8:d2:8d:f5:b8:66:c0:01:12:ee:24:2b:16' - attach_workspace: at: /tmp/workspace - run: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b07461f..d48cf5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: rev: 'v4.4.0' hooks: - id: check-yaml - exclude: 'deploy/helm' + exclude: 'charts' - id: check-merge-conflict - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable @@ -16,7 +16,7 @@ repos: - id: check-vcs-permalinks - id: trailing-whitespace - id: end-of-file-fixer - exclude: 'deploy/helm/README.md' + exclude: 'charts/seq-input-gelf/README.md' - repo: https://github.com/syntaqx/git-hooks rev: 'v0.0.17' diff --git a/charts/seq-input-gelf/.helmignore b/charts/seq-input-gelf/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/seq-input-gelf/.helmignore @@ -0,0 +1,23 @@ +# 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/ diff --git a/charts/seq-input-gelf/Chart.yaml b/charts/seq-input-gelf/Chart.yaml new file mode 100644 index 0000000..e257025 --- /dev/null +++ b/charts/seq-input-gelf/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +appVersion: "3.0.441-x64" +description: A Helm chart for deploying seq-input-gelf to Kubernetes +home: 'https://speckle.systems/' +icon: 'https://speckle.xyz/logo.svg' +maintainers: + - name: Speckle Systems + url: 'https://speckle.systems/' +name: seq-input-gelf +sources: + - 'https://github.com/specklesystems/speckle-server' +type: application +version: 0.1.0 diff --git a/charts/seq-input-gelf/README.md b/charts/seq-input-gelf/README.md new file mode 100644 index 0000000..8c02fd6 --- /dev/null +++ b/charts/seq-input-gelf/README.md @@ -0,0 +1,46 @@ +# seq-input-gelf + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.441-x64](https://img.shields.io/badge/AppVersion-3.0.441--x64-informational?style=flat-square) + +A Helm chart for deploying seq-input-gelf to Kubernetes + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Speckle Systems | | | + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"datalust/seq-input-gelf"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| seq.apiKey.secretKey | string | `"api-key"` | | +| seq.apiKey.secretName | string | `"seq-api-key"` | | +| seq.diagnosticLogging | bool | `true` | | +| seq.rustBackTrace | int | `0` | | +| seq.url | string | `"http://seq:5341"` | | +| service.port | int | `12201` | | +| service.protocol | string | `"TCP"` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | + diff --git a/charts/seq-input-gelf/templates/NOTES.txt b/charts/seq-input-gelf/templates/NOTES.txt new file mode 100644 index 0000000..5c983ed --- /dev/null +++ b/charts/seq-input-gelf/templates/NOTES.txt @@ -0,0 +1 @@ +🎉 Thank you for deploying seq-input-gelf! diff --git a/charts/seq-input-gelf/templates/_helpers.tpl b/charts/seq-input-gelf/templates/_helpers.tpl new file mode 100644 index 0000000..7e70176 --- /dev/null +++ b/charts/seq-input-gelf/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "seq-input-gelf.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 "seq-input-gelf.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 "seq-input-gelf.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "seq-input-gelf.labels" -}} +helm.sh/chart: {{ include "seq-input-gelf.chart" . }} +{{ include "seq-input-gelf.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "seq-input-gelf.selectorLabels" -}} +app.kubernetes.io/name: {{ include "seq-input-gelf.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "seq-input-gelf.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "seq-input-gelf.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/seq-input-gelf/templates/deployment.yaml b/charts/seq-input-gelf/templates/deployment.yaml new file mode 100644 index 0000000..5d34870 --- /dev/null +++ b/charts/seq-input-gelf/templates/deployment.yaml @@ -0,0 +1,86 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "seq-input-gelf.fullname" . }} + labels: + {{- include "seq-input-gelf.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "seq-input-gelf.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "seq-input-gelf.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "seq-input-gelf.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 3000 + fsGroup: 2000 + allowPrivilegeEscalation: false + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: gelf + containerPort: {{ .Values.service.port }} + protocol: {{ .Values.service.protocol }} + # TODO: Add liveness and readiness probes + # livenessProbe: + # httpGet: + # path: / + # port: http + # readinessProbe: + # httpGet: + # path: / + # port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: SEQ_ADDRESS + value: {{ .Values.seq.url }} + - name: SEQ_API_KEY + valueFrom: + secretKeyRef: + name: {{ .Values.seq.apiKey.secretName }} + key: {{ .Values.seq.apiKey.secretKey }} + - name: GELF_ADDRESS + value: {{ printf "%s://0.0.0.0:%s" ( lower .Values.service.protocol ) .Values.service.port }} + - name: GELF_ENABLE_DIAGNOSTICS + value: {{ .Values.seq.enableDiagnostics | quote }} + # - name: GELF_CERTIFICATE_PATH + # value: /certs/seq-input-gelf.crt + # - name: GELF_CERTIFICATE_PRIVATE_KEY_PATH + # value: /certs/seq-input-gelf.key + - name: RUST_BACKTRACE + value: {{ .Values.seq.rustBackTrace | quote }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/seq-input-gelf/templates/service.yaml b/charts/seq-input-gelf/templates/service.yaml new file mode 100644 index 0000000..f737cc3 --- /dev/null +++ b/charts/seq-input-gelf/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "seq-input-gelf.fullname" . }} + labels: + {{- include "seq-input-gelf.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: gelf + protocol: {{ .Values.service.protocol }} + name: gelf + selector: + {{- include "seq-input-gelf.selectorLabels" . | nindent 4 }} diff --git a/charts/seq-input-gelf/templates/serviceaccount.yaml b/charts/seq-input-gelf/templates/serviceaccount.yaml new file mode 100644 index 0000000..97b1bb9 --- /dev/null +++ b/charts/seq-input-gelf/templates/serviceaccount.yaml @@ -0,0 +1,14 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "seq-input-gelf.serviceAccountName" . }} + labels: + {{- include "seq-input-gelf.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +secrets: + - name: {{ .Values.seq.apiKey.secretName }} +{{- end }} diff --git a/charts/seq-input-gelf/values.yaml b/charts/seq-input-gelf/values.yaml new file mode 100644 index 0000000..364e4da --- /dev/null +++ b/charts/seq-input-gelf/values.yaml @@ -0,0 +1,49 @@ +replicaCount: 1 + +seq: + apiKey: + secretName: seq-api-key + secretKey: api-key + url: http://seq:5341 + diagnosticLogging: true + rustBackTrace: 0 # 0 = disabled, 1 = enabled. Used for debugging. + +image: + repository: datalust/seq-input-gelf + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +service: + type: ClusterIP + port: 12201 + protocol: TCP + +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {}