From 3137550ece993039d743074e8348f4b8e025e279 Mon Sep 17 00:00:00 2001 From: HenrikDK Date: Fri, 27 Jan 2023 20:51:12 +0100 Subject: [PATCH] new chart for sentinel-dashboard --- charts/sentinel-dashboard/.helmignore | 23 +++++++ charts/sentinel-dashboard/Chart.yaml | 6 ++ .../sentinel-dashboard/templates/_helpers.tpl | 58 +++++++++++++++++ .../templates/ui-deployment.yaml | 62 +++++++++++++++++++ .../templates/ui-ingress.yaml | 26 ++++++++ .../templates/ui-service.yaml | 15 +++++ charts/sentinel-dashboard/values.yaml | 59 ++++++++++++++++++ 7 files changed, 249 insertions(+) create mode 100644 charts/sentinel-dashboard/.helmignore create mode 100644 charts/sentinel-dashboard/Chart.yaml create mode 100644 charts/sentinel-dashboard/templates/_helpers.tpl create mode 100644 charts/sentinel-dashboard/templates/ui-deployment.yaml create mode 100644 charts/sentinel-dashboard/templates/ui-ingress.yaml create mode 100644 charts/sentinel-dashboard/templates/ui-service.yaml create mode 100644 charts/sentinel-dashboard/values.yaml diff --git a/charts/sentinel-dashboard/.helmignore b/charts/sentinel-dashboard/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/sentinel-dashboard/.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/sentinel-dashboard/Chart.yaml b/charts/sentinel-dashboard/Chart.yaml new file mode 100644 index 0000000..929a353 --- /dev/null +++ b/charts/sentinel-dashboard/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: sentinel-dashboard +appVersion: "1.0.0" +version: 1.0.0 +description: A lightweight tool to help .Net developers work with the output of serilog's structured json logs. +type: application diff --git a/charts/sentinel-dashboard/templates/_helpers.tpl b/charts/sentinel-dashboard/templates/_helpers.tpl new file mode 100644 index 0000000..6ee6087 --- /dev/null +++ b/charts/sentinel-dashboard/templates/_helpers.tpl @@ -0,0 +1,58 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "sentinel-dashboard.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 "sentinel-dashboard.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 "sentinel-dashboard.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Controller labels. +*/}} +{{- define "sentinel-dashboard.labels" -}} +helm.sh/chart: {{ include "sentinel-dashboard.chart" . }} +{{ include "sentinel-dashboard.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Controller Selector labels. +*/}} +{{- define "sentinel-dashboard.selectorLabels" -}} +app.kubernetes.io/name: {{ include "sentinel-dashboard.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use. +*/}} +{{- define "sentinel-dashboard.serviceAccountName" -}} +{{- default (include "sentinel-dashboard.fullname" .) .Values.serviceAccount.name }} +{{- end }} diff --git a/charts/sentinel-dashboard/templates/ui-deployment.yaml b/charts/sentinel-dashboard/templates/ui-deployment.yaml new file mode 100644 index 0000000..6ef526a --- /dev/null +++ b/charts/sentinel-dashboard/templates/ui-deployment.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "sentinel-dashboard.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "sentinel-dashboard.labels" . | nindent 4 }} +spec: + strategy: + type: Recreate + selector: + matchLabels: + {{- include "sentinel-dashboard.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "sentinel-dashboard.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "sentinel-dashboard.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "sentinel-dashboard.fullname" . }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: {{ .Values.image.url }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: humio-api + value: {{ .Values.humioApi }} + - name: humio-repository + value: {{ .Values.humioRepository }} + - name: humio-token + valueFrom: + secretKeyRef: + name: {{ .Values.humioTokenSecret }} + key: token + optional: false + - name: namespace-filter + value: {{ .Values.namespaceFilter }} + {{- 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/sentinel-dashboard/templates/ui-ingress.yaml b/charts/sentinel-dashboard/templates/ui-ingress.yaml new file mode 100644 index 0000000..3f4b94e --- /dev/null +++ b/charts/sentinel-dashboard/templates/ui-ingress.yaml @@ -0,0 +1,26 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "sentinel-dashboard.fullname" . }} + namespace: {{ .Release.Namespace }} + {{- with .Values.ingressAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingressClassName }} + tls: + - hosts: + - {{ .Values.ingress }} + secretName: {{ include "sentinel-dashboard.fullname" . }} + rules: + - host: {{ .Values.ingress }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "sentinel-dashboard.fullname" . }} + port: + number: 8080 diff --git a/charts/sentinel-dashboard/templates/ui-service.yaml b/charts/sentinel-dashboard/templates/ui-service.yaml new file mode 100644 index 0000000..67cb6cd --- /dev/null +++ b/charts/sentinel-dashboard/templates/ui-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "sentinel-dashboard.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "sentinel-dashboard.labels" . | nindent 4 }} +spec: + type: "ClusterIP" + ports: + - port: 8080 + targetPort: 4654 + name: http + selector: + {{- include "sentinel-dashboard.selectorLabels" . | nindent 4 }} diff --git a/charts/sentinel-dashboard/values.yaml b/charts/sentinel-dashboard/values.yaml new file mode 100644 index 0000000..e0c90cb --- /dev/null +++ b/charts/sentinel-dashboard/values.yaml @@ -0,0 +1,59 @@ +# Use these fields to override the name of the deployment +nameOverride: "" +fullnameOverride: "" + +image: + url: "henrikdk/sentinel-dashboard-ui:20230127-1c9172c" + pullPolicy: IfNotPresent + +# Optional list of namespace prefixes that will be accessible from this instance. +# Expects either an empty string, a single value prefixes or a list of prefixes with out spaces eg. "value,other,third" +namespaceFilter: "" + +# Url to the humio instances API endpoint, defaults to humio cloud. +humioApi: "https://cloud.humio.com" + +# Name of the humio repository that will act as a source for all error data. +humioRepository: "" + +# Name of the secret that contains the access token used to access the Humio API. The secret must have the token value provided in the 'token' key. +humioTokenSecret: "" + +# Ingress url where the dashboard will be reachable +ingress: "" + +# Ingress class for the deployed ingress. +ingressClass: "" + +# Annotations added to the ingress: +ingressAnnotations: {} + +imagePullSecrets: [] + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +resources: {} + # Not enabled by default, but values are provided as guidance. + # limits: + # cpu: 500m + # memory: 256Mi + # requests: + # cpu: 100m + # memory: 60Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {}