Skip to content

Commit

Permalink
Merge pull request #8 from riftbit/develop
Browse files Browse the repository at this point in the history
feat(chart): add redisinsight chart
  • Loading branch information
ergoz authored Mar 25, 2022
2 parents 1184808 + d1aea04 commit e6cd398
Show file tree
Hide file tree
Showing 14 changed files with 426 additions and 11 deletions.
34 changes: 26 additions & 8 deletions riftbit/loki-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
apiVersion: "v1"
apiVersion: v2
name: loki-stack
version: 2.5.0
appVersion: v2.1.0
version: 2.5.1
kubeVersion: "^1.10.0-0"
description: "Loki: like Prometheus, but for logs."
type: application
keywords:
- redis
- gui
home: https://grafana.com/loki
icon: https://raw.githubusercontent.com/grafana/loki/master/docs/sources/logo.png
sources:
- https://github.com/grafana/loki
- https://github.com/grafana/loki
# dependencies: # A list of the chart requirements (optional)
# - name: The name of the chart (nginx)
# version: The version of the chart ("1.2.3")
# repository: (optional) The repository URL ("https://example.com/charts") or alias ("@repo-name")
# condition: (optional) A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
# tags: # (optional)
# - Tags can be used to group charts for enabling/disabling together
# import-values: # (optional)
# - ImportValues holds the mapping of source values to parent key to be imported. Each item can be a string or pair of child/parent sublist items.
# alias: (optional) Alias to be used for the chart. Useful when you have to add the same chart multiple times
maintainers:
- name: Loki Maintainers
email: lokiproject@googlegroups.com
engine: gotpl
- name: "ergoz"
email: ergozru@gmail.com
url: https://riftbit.com
icon: https://raw.githubusercontent.com/grafana/loki/master/docs/sources/logo.png
appVersion: "v2.1.0"
# deprecated: Whether this chart is deprecated (optional, boolean)
# annotations:
# example: A list of annotations keyed by name (optional).
# engine: gotpl
8 changes: 6 additions & 2 deletions riftbit/loki-stack/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ dependencies:
- name: "loki"
condition: loki.enabled
repository: "https://grafana.github.io/helm-charts"
version: "^2.9.0"
version: "^2.10.0"

- name: "promtail"
condition: promtail.enabled
repository: "https://grafana.github.io/helm-charts"
version: "^3.10.0"
version: "^3.11.0"

- name: "grafana"
condition: grafana.enabled
version: "~6.16.12"
repository: "https://grafana.github.io/helm-charts"

- name: "prometheus"
condition: prometheus.enabled
version: "~15.0.1"
Expand All @@ -22,10 +24,12 @@ dependencies:
condition: fluent-bit.enabled
repository: "https://grafana.github.io/helm-charts"
version: "^2.2.0"

- name: "filebeat"
condition: filebeat.enabled
version: "~7.8.0"
repository: "https://helm.elastic.co"

- name: "logstash"
condition: logstash.enabled
version: "~7.8.0"
Expand Down
2 changes: 1 addition & 1 deletion riftbit/loki-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ logstash:
#password => "test"
}
# stdout { codec => rubydebug }
}
}
23 changes: 23 additions & 0 deletions riftbit/redisinsight/.helmignore
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/
31 changes: 31 additions & 0 deletions riftbit/redisinsight/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v2
name: redisinsight
version: 0.1.0
kubeVersion: "^1.10.0-0"
description: RedisInsight - The GUI for Redis
type: application
keywords:
- redis
- gui
home: https://redis.com/redis-enterprise/redis-insight/
# sources:
# - https://github.com/grafana/loki
# dependencies: # A list of the chart requirements (optional)
# - name: The name of the chart (nginx)
# version: The version of the chart ("1.2.3")
# repository: (optional) The repository URL ("https://example.com/charts") or alias ("@repo-name")
# condition: (optional) A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
# tags: # (optional)
# - Tags can be used to group charts for enabling/disabling together
# import-values: # (optional)
# - ImportValues holds the mapping of source values to parent key to be imported. Each item can be a string or pair of child/parent sublist items.
# alias: (optional) Alias to be used for the chart. Useful when you have to add the same chart multiple times
maintainers:
- name: "ergoz"
email: ergozru@gmail.com
url: https://riftbit.com
icon: https://raw.githubusercontent.com/grafana/loki/master/docs/sources/logo.png
appVersion: "v1.0.0"
# deprecated: Whether this chart is deprecated (optional, boolean)
# annotations:
# example: A list of annotations keyed by name (optional).
21 changes: 21 additions & 0 deletions riftbit/redisinsight/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "redisinsight-chart.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "redisinsight-chart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "redisinsight-chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "redisinsight-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8001 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8001:8001
{{- end }}
62 changes: 62 additions & 0 deletions riftbit/redisinsight/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "redisinsight-chart.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-chart.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.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "redisinsight-chart.labels" -}}
helm.sh/chart: {{ include "redisinsight-chart.chart" . }}
{{ include "redisinsight-chart.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "redisinsight-chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "redisinsight-chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "redisinsight-chart.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "redisinsight-chart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
66 changes: 66 additions & 0 deletions riftbit/redisinsight/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "redisinsight-chart.fullname" . }}
labels:
{{- include "redisinsight-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "redisinsight-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "redisinsight-chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "redisinsight-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: db
emptyDir: {}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8001
protocol: TCP
# livenessProbe:
# httpGet:
# path: /healthcheck/
# port: 8001
# initialDelaySeconds: 5
# periodSeconds: 5
# failureThreshold: 1
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: db
mountPath: /db
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
28 changes: 28 additions & 0 deletions riftbit/redisinsight/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "redisinsight-chart.fullname" . }}
labels:
{{- include "redisinsight-chart.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "redisinsight-chart.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
41 changes: 41 additions & 0 deletions riftbit/redisinsight/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "redisinsight-chart.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- 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-chart.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- 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: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions riftbit/redisinsight/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "redisinsight-chart.fullname" . }}
labels:
{{- include "redisinsight-chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 8001
protocol: TCP
name: http
selector:
{{- include "redisinsight-chart.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions riftbit/redisinsight/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "redisinsight-chart.serviceAccountName" . }}
labels:
{{- include "redisinsight-chart.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading

0 comments on commit e6cd398

Please sign in to comment.