-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from MinaFoundation/PM-1603-redisinsight-helm…
…-chart PM 1603 redisinsight helm chart
- Loading branch information
Showing
11 changed files
with
499 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: redisinsight | ||
description: A Helm chart for Redisinsight | ||
|
||
# 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: "2.48.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# redisinsight | ||
|
||
![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: 2.48.0](https://img.shields.io/badge/AppVersion-2.48.0-informational?style=flat-square) | ||
|
||
A Helm chart for Redisinsight | ||
|
||
## Prerequisites | ||
|
||
Before using this Helm chart, you should have the following prerequisites: | ||
|
||
- Access to Kubernetes cluster (If needed contact your friendly neighbourhood DevOps engineer) | ||
- Helm >= v3.14.3 | ||
- (**Optional**) helmfile >= v0.162.0 to install this chart | ||
|
||
## Installation | ||
|
||
> Note: **examples** can be found in the repository | ||
To install this Helm chart, the easiest is to create a helmfile.yaml with needed values and run: | ||
|
||
``` | ||
helmfile template | ||
helmfile apply | ||
``` | ||
|
||
Or use helmfile only to generate resources and apply them with kubectl like so: | ||
|
||
``` | ||
helmfile template | kubectl -f - | ||
``` | ||
|
||
Verify that the chart is deployed successfully: | ||
|
||
> Note: `kubectl` is a better suited tool for this | ||
``` | ||
helmfile status | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Affinity rules | | ||
| fullnameOverride | string | `""` | The full release name override | | ||
| image.pullPolicy | string | `"IfNotPresent"` | The pullPolicy used when pulling the image | | ||
| image.repository | string | `"redis/redisinsight"` | The repository of the image | | ||
| image.tag | string | `"2.48.0"` | The tag of the iamge. Overrides the image tag whose default is the chart appVersion. | | ||
| imagePullSecrets | list | `[]` | The secrets used to pull the image | | ||
| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"redisinsight.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | Ingress related values | | ||
| ingress.annotations | object | `{}` | Ingress annotations | | ||
| ingress.className | string | `""` | IngressClass used for the ingress | | ||
| ingress.enabled | bool | `false` | Whether to enable the ingress or not | | ||
| ingress.tls | list | `[]` | Tls settings | | ||
| nameOverride | string | `""` | The release name override | | ||
| nodeSelector | object | `{}` | Node selector labels | | ||
| persistence | object | `{"annotations":{},"className":"","enabled":true,"size":"100Mi"}` | Presistence related values | | ||
| persistence.annotations | object | `{}` | Annotations for the Persistent Volume Claim | | ||
| persistence.className | string | `""` | The name of the storageclass | | ||
| persistence.enabled | bool | `true` | Whether to enable persistence or not | | ||
| persistence.size | string | `"100Mi"` | Size of the Persistent Volume | | ||
| podAnnotations | object | `{}` | Annotations to add to the pods | | ||
| podSecurityContext | object | `{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000}` | SecurityContext used for the pods | | ||
| resources | object | `{}` | Resource limitations for the pods | | ||
| securityContext | object | `{}` | SecurityContext | | ||
| server.extraEnvVars | object | `{}` | Extra environment variables to inject | | ||
| server.ports | object | `{"ui":5540}` | Collection of ports | | ||
| server.ports.ui | int | `5540` | Port through which the UI is exposed | | ||
| server.replicas | int | `1` | The number of pods to be deployed for server | | ||
| server.service | object | `{"annotations":{},"labels":{}}` | Specific values for the service resource | | ||
| server.service.annotations | object | `{}` | Service annotations | | ||
| server.service.labels | object | `{}` | Service labels | | ||
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | ||
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | ||
| terminationGracePeriodSeconds | int | `30` | The time to wait before terminating the process | | ||
| tolerations | list | `[]` | Tolerations | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "redisinsight.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 "redisinsight.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 "redisinsight.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "redisinsight.labels" -}} | ||
helm.sh/chart: {{ include "redisinsight.chart" . }} | ||
{{ include "redisinsight.selectorLabels" . }} | ||
app.kubernetes.io/version: "{{ include "redisinsight.redisinsightVersion" . }}" | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Version is either the Chart's AppVersion or the image versionOverride, if specified | ||
*/}} | ||
{{- define "redisinsight.redisinsightVersion" -}} | ||
{{- if ne .Values.image.versionOverride "*" -}} | ||
{{- .Values.image.versionOverride -}} | ||
{{- else -}} | ||
{{ .Chart.AppVersion }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "redisinsight.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "redisinsight.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "redisinsight.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "redisinsight.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "redisinsight.fullname" . }} | ||
labels: | ||
{{- include "redisinsight.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.server.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "redisinsight.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "redisinsight.selectorLabels" . | nindent 8 }} | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "redisinsight.fullname" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
{{- if .Values.persistence.enabled }} | ||
volumes: | ||
- name: redisinsight-volume | ||
persistentVolumeClaim: | ||
claimName: {{ include "redisinsight.fullname" . }} | ||
{{- end }} | ||
containers: | ||
- name: redisinsight | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http-ui | ||
containerPort: 5540 | ||
protocol: TCP | ||
{{- if .Values.persistence.enabled }} | ||
volumeMounts: | ||
- mountPath: "/data" | ||
name: redisinsight-volume | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
env: | ||
{{- if .Values.server.extraEnvVars }} | ||
{{- toYaml .Values.server.extraEnvVars | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
{{- $fullName := include "redisinsight.fullname" . -}} | ||
{{- $svcPort := .Values.server.ports.ui -}} | ||
{{- 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 "redisinsight.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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if .Values.persistence.enabled -}} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ include "redisinsight.fullname" . }} | ||
labels: | ||
app: {{ include "redisinsight.fullname" . }} | ||
{{- with .Values.persistence.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.persistence.className }} | ||
storageClassName: {{ .Values.persistence.className }} | ||
{{- end }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.size }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "redisinsight.fullname" . }} | ||
labels: | ||
{{- if .Values.server.service.labels }} | ||
{{- with .Values.server.service.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
app: {{ include "redisinsight.fullname" . }} | ||
{{- if .Values.server.service.annotations }} | ||
{{- with .Values.server.service.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
publishNotReadyAddresses: true | ||
selector: | ||
{{- include "redisinsight.selectorLabels" . | nindent 4 }} | ||
ports: | ||
- name: http-ui | ||
port: {{ .Values.server.ports.ui }} | ||
protocol: TCP | ||
targetPort: http-ui |
Oops, something went wrong.