diff --git a/riftbit/loki-stack/Chart.yaml b/riftbit/loki-stack/Chart.yaml index d27f58f..0a43f27 100644 --- a/riftbit/loki-stack/Chart.yaml +++ b/riftbit/loki-stack/Chart.yaml @@ -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 \ No newline at end of file + - 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 diff --git a/riftbit/loki-stack/requirements.yaml b/riftbit/loki-stack/requirements.yaml index d02897b..e2ca18b 100644 --- a/riftbit/loki-stack/requirements.yaml +++ b/riftbit/loki-stack/requirements.yaml @@ -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" @@ -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" diff --git a/riftbit/loki-stack/values.yaml b/riftbit/loki-stack/values.yaml index f666afb..00f6a71 100644 --- a/riftbit/loki-stack/values.yaml +++ b/riftbit/loki-stack/values.yaml @@ -66,4 +66,4 @@ logstash: #password => "test" } # stdout { codec => rubydebug } - } \ No newline at end of file + } diff --git a/riftbit/redisinsight/.helmignore b/riftbit/redisinsight/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/riftbit/redisinsight/.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/riftbit/redisinsight/Chart.yaml b/riftbit/redisinsight/Chart.yaml new file mode 100644 index 0000000..8f9f658 --- /dev/null +++ b/riftbit/redisinsight/Chart.yaml @@ -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). diff --git a/riftbit/redisinsight/templates/NOTES.txt b/riftbit/redisinsight/templates/NOTES.txt new file mode 100644 index 0000000..f6d7d86 --- /dev/null +++ b/riftbit/redisinsight/templates/NOTES.txt @@ -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 }} diff --git a/riftbit/redisinsight/templates/_helpers.tpl b/riftbit/redisinsight/templates/_helpers.tpl new file mode 100644 index 0000000..9d2d04a --- /dev/null +++ b/riftbit/redisinsight/templates/_helpers.tpl @@ -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 }} diff --git a/riftbit/redisinsight/templates/deployment.yaml b/riftbit/redisinsight/templates/deployment.yaml new file mode 100644 index 0000000..d5a3e6e --- /dev/null +++ b/riftbit/redisinsight/templates/deployment.yaml @@ -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 }} diff --git a/riftbit/redisinsight/templates/hpa.yaml b/riftbit/redisinsight/templates/hpa.yaml new file mode 100644 index 0000000..f3a875f --- /dev/null +++ b/riftbit/redisinsight/templates/hpa.yaml @@ -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 }} diff --git a/riftbit/redisinsight/templates/ingress.yaml b/riftbit/redisinsight/templates/ingress.yaml new file mode 100644 index 0000000..bfbff6d --- /dev/null +++ b/riftbit/redisinsight/templates/ingress.yaml @@ -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 }} diff --git a/riftbit/redisinsight/templates/service.yaml b/riftbit/redisinsight/templates/service.yaml new file mode 100644 index 0000000..7c68944 --- /dev/null +++ b/riftbit/redisinsight/templates/service.yaml @@ -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 }} diff --git a/riftbit/redisinsight/templates/serviceaccount.yaml b/riftbit/redisinsight/templates/serviceaccount.yaml new file mode 100644 index 0000000..e7f9c6a --- /dev/null +++ b/riftbit/redisinsight/templates/serviceaccount.yaml @@ -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 }} diff --git a/riftbit/redisinsight/templates/tests/test-connection.yaml b/riftbit/redisinsight/templates/tests/test-connection.yaml new file mode 100644 index 0000000..5a0e9bb --- /dev/null +++ b/riftbit/redisinsight/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "redisinsight-chart.fullname" . }}-test-connection" + labels: + {{- include "redisinsight-chart.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "redisinsight-chart.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/riftbit/redisinsight/values.yaml b/riftbit/redisinsight/values.yaml new file mode 100644 index 0000000..b63896f --- /dev/null +++ b/riftbit/redisinsight/values.yaml @@ -0,0 +1,79 @@ +# Default values for redisinsight-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: redislabs/redisinsight + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: latest + +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: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {}