Skip to content

Commit

Permalink
feat(OSS helm-dashboard): Clean yarn.lock before release
Browse files Browse the repository at this point in the history
  • Loading branch information
komodor-bot committed Nov 13, 2024
1 parent 28acac2 commit 9fca275
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 43 deletions.
6 changes: 3 additions & 3 deletions charts/helm-dashboard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: application

name: helm-dashboard
description: A GUI Dashboard for Helm by Komodor
icon: "https://raw.githubusercontent.com/komodorio/helm-dashboard/main/pkg/dashboard/static/logo.svg"
icon: "https://raw.githubusercontent.com/komodorio/helm-dashboard/refs/heads/main/images/logo.svg"

version: 0.1.10
appVersion: "1.3.3"
version: 2.0.2
appVersion: "2.0.2"
60 changes: 33 additions & 27 deletions charts/helm-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ helm upgrade --install helm-dashboard komodorio/helm-dashboard

This chart bootstraps a Helm Dashboard deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

While installed inside cluster, Helm Dashboard will run some additional backgroud actions, for example, will automatically update Helm repositories. To enable that behavior locally, set `HD_CLUSTER_MODE` env variable.
While installed inside cluster, Helm Dashboard will run some additional background actions, for example, will automatically update Helm repositories. To enable that behavior locally, set `HD_CLUSTER_MODE` env variable.

## Prerequisites

Expand Down Expand Up @@ -50,32 +50,38 @@ For instance, you can place authentication proxy in front of Helm Dashboard, lik

The following table lists the configurable parameters of the chart and their default values.

| Parameter | Description | Default |
| ------------------------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------ |
| `image.repository` | Image registry/name | `docker.io/komodorio/helm-dashboard` |
| `image.tag` | Image tag | |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `replicaCount` | Number of dashboard Pods to run | `1` |
| `dashboard.allowWriteActions` | Enables write actions. Allow modifying, deleting and creating charts and kubernetes resources. | `true` |
| `resources.requests.cpu` | CPU resource requests | `200m` |
| `resources.limits.cpu` | CPU resource limits | `1` |
| `resources.requests.memory` | Memory resource requests | `256Mi` |
| `resources.limits.memory` | Memory resource limits | `1Gi` |
| `service.type ` | Kubernetes service type | `ClusterIP` |
| `service.port ` | Kubernetes service port | `8080` |
| `serviceAccount.create` | Creates a service account | `true` |
| `serviceAccount.name` | Optional name for the service account | `{RELEASE_FULLNAME}` |
| `nodeSelector` | Node labels for pod assignment | |
| `affinity` | Affinity settings for pod assignment | |
| `tolerations` | Tolerations for pod assignment | |
| `dashboard.persistence.enabled` | Enable helm data persistene using PVC | `true` |
| `dashboard.persistence.accessModes` | Persistent Volume access modes | `["ReadWriteOnce"]` |
| `dashboard.persistence.storageClass` | Persistent Volume storage class | `""` |
| `dashboard.persistence.size` | Persistent Volume size | `100M` |
| `dashboard.persistence.hostPath` | Set path in case you want to use local host path volumes (not recommended in production) | `""`
| `updateStrategy.type` | Set up update strategy for helm-dashboard installation. | `RollingUpdate` |
| `extraArgs` | Set the arguments to be supplied to the helm-dashboard binary | `[--no-browser, --bind=0.0.0.0]`

| Parameter | Description | Default |
|---------------------------------------|------------------------------------------------------------------------------------------------|----------------------------------|
| `global.imageRegistry` | Registry for all images, useful for private registry | `""` |
| `global.imagePullSecrets` | Specify Docker-registry secret names as an array | `[]` |
| `image.repository` | Image registry/name | `komodorio/helm-dashboard` |
| `image.tag` | Image tag | |
| `image.imagePullSecrets` | Specify Docker-registry secret names as an array | `[]` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `replicaCount` | Number of dashboard Pods to run | `1` |
| `dashboard.allowWriteActions` | Enables write actions. Allow modifying, deleting and creating charts and kubernetes resources. | `true` |
| `resources.requests.cpu` | CPU resource requests | `200m` |
| `resources.limits.cpu` | CPU resource limits | `1` |
| `resources.requests.memory` | Memory resource requests | `256Mi` |
| `resources.limits.memory` | Memory resource limits | `1Gi` |
| `service.type ` | Kubernetes service type | `ClusterIP` |
| `service.port ` | Kubernetes service port | `8080` |
| `serviceAccount.create` | Creates a service account | `true` |
| `serviceAccount.name` | Optional name for the service account | `{RELEASE_FULLNAME}` |
| `nodeSelector` | Node labels for pod assignment | |
| `affinity` | Affinity settings for pod assignment | |
| `tolerations` | Tolerations for pod assignment | |
| `dashboard.persistence.enabled` | Enable helm data persistene using PVC | `true` |
| `dashboard.persistence.accessModes` | Persistent Volume access modes | `["ReadWriteOnce"]` |
| `dashboard.persistence.storageClass` | Persistent Volume storage class | `""` |
| `dashboard.persistence.size` | Persistent Volume size | `100M` |
| `dashboard.persistence.hostPath` | Set path in case you want to use local host path volumes (not recommended in production) | `""` |
| `updateStrategy.type` | Set up update strategy for helm-dashboard installation. | `RollingUpdate` |
| `extraArgs` | Set the arguments to be supplied to the helm-dashboard binary | `[--no-browser, --bind=0.0.0.0]` |
| `testImage.repository` | Test image registry/name | `busybox` |
| `testImage.tag` | Test image tag | `lastest` |
| `testImage.imagePullSecrets` | Specify Docker-registry secret names as an array | `[]` |
| `testImage.pullPolicy` | Test image pull policy | `IfNotPresent` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

```bash
Expand Down
51 changes: 51 additions & 0 deletions charts/helm-dashboard/templates/_commons.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Return the proper image name
{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" .Values.global ) }}
*/}}
{{- define "common.images.image" -}}
{{- $registryName := .imageRoot.registry -}}
{{- $repositoryName := .imageRoot.repository -}}
{{- $separator := ":" -}}
{{- $termination := .imageRoot.tag | toString -}}
{{- if .global }}
{{- if .global.imageRegistry }}
{{- $registryName = .global.imageRegistry -}}
{{- end -}}
{{- end -}}
{{- if .imageRoot.digest }}
{{- $separator = "@" -}}
{{- $termination = .imageRoot.digest | toString -}}
{{- end -}}
{{- if $registryName }}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
{{- else -}}
{{- printf "%s%s%s" $repositoryName $separator $termination -}}
{{- end -}}
{{- end -}}

{{/*
Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
*/}}
{{- define "common.images.pullSecrets" -}}
{{- $pullSecrets := list }}

{{- if .global }}
{{- range .global.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}

{{- range .images -}}
{{- range .pullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}

{{- if (not (empty $pullSecrets)) }}
imagePullSecrets:
{{- range $pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end -}}
28 changes: 28 additions & 0 deletions charts/helm-dashboard/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,31 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return the proper image Registry Secret Names
*/}}
{{- define "helm-dashboard.imagePullSecrets" -}}
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) }}
{{- end -}}


{{/*
Return the proper image name
*/}}
{{- define "helm-dashboard.image" -}}
{{- $image := .Values.image -}}
{{- $tag := .Chart.AppVersion -}}
{{- if $image.tag -}}
{{- $tag = $image.tag -}}
{{- end -}}
{{- $_ := set $image "tag" $tag -}}
{{ include "common.images.image" (dict "imageRoot" $_ "global" .Values.global) }}
{{- end -}}

{{/*
Return the proper image name
*/}}
{{- define "test.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.testImage "global" .Values.global) }}
{{- end -}}
13 changes: 5 additions & 8 deletions charts/helm-dashboard/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ spec:
labels:
{{- include "helm-dashboard.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "helm-dashboard.imagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "helm-dashboard.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand All @@ -38,7 +35,7 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ include "helm-dashboard.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: HELM_CACHE_HOME
Expand All @@ -48,7 +45,7 @@ spec:
- name: HELM_DATA_HOME
value: /opt/dashboard/helm/data
- name: DEBUG
value: {{- ternary " 1" "" .Values.debug }}
value: {{- ternary " '1'" "" .Values.debug }}
{{- if .Values.dashboard.namespace }}
- name: HELM_NAMESPACE
value: {{ .Values.dashboard.namespace }}
Expand All @@ -60,11 +57,11 @@ spec:
livenessProbe:
httpGet:
path: /status
port: http
port: 8080
readinessProbe:
httpGet:
path: /status
port: http
port: 8080
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
5 changes: 2 additions & 3 deletions charts/helm-dashboard/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -24,6 +22,7 @@ rules:
{{- else }}
verbs: ["get", "list", "watch"]
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -36,4 +35,4 @@ roleRef:
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "helm-dashboard.serviceAccountName" . }}
name: {{ include "helm-dashboard.serviceAccountName" . }}
3 changes: 2 additions & 1 deletion charts/helm-dashboard/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ metadata:
annotations:
"helm.sh/hook": test
spec:
{{- include "helm-dashboard.imagePullSecrets" . | nindent 2 }}
containers:
- name: wget
image: busybox
image: {{ include "test.image" . }}
command: ['wget']
args: ['--timeout=5', '{{ include "helm-dashboard.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
23 changes: 22 additions & 1 deletion charts/helm-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ replicaCount: 1
# Flag for setting environment to debug mode
debug: false

global:
## @param global.imageRegistry Global Docker image registry
imageRegistry: ""
## Optionally specify an array of imagePullSecrets.
## Example:
## imagePullSecrets:
## - myRegistryKeySecretName
imagePullSecrets: []

image:
repository: komodorio/helm-dashboard
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

Expand Down Expand Up @@ -119,3 +128,15 @@ tolerations: []

affinity: {}


testImage:
repository: busybox
tag: latest
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# tag: ""
## Optionally specify an array of imagePullSecrets.
## Example:
## imagePullSecrets:
## - myRegistryKeySecretName
imagePullSecrets: []

0 comments on commit 9fca275

Please sign in to comment.