Skip to content

Commit

Permalink
Merge branch 'master' into fix/optional-exporter-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DandyDeveloper authored Apr 7, 2024
2 parents 9242c74 + 308521e commit 7fb8754
Show file tree
Hide file tree
Showing 17 changed files with 211 additions and 29 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@ on:
push:
branches: [ master ]
jobs:
build:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Package and Publish charts
uses: J12934/helm-gh-pages-action@master
with:
deploy-branch: gh-pages
access-token: "${{ secrets.CR_TOKEN }}"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3

- name: Install Helm Deps
run: |
for dir in $(ls -d charts/*/); do
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
done
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/dandydev-charts)](https://artifacthub.io/packages/search?repo=dandydev-charts)

### Charts for numerous projects. Migrated from `helm/stable` due to deprecation timeline.

Charts are deployed via Github Actions to the `gh-pages` branch.
Charts are deployed via Github Actions to the `gh-pages` branch.
4 changes: 4 additions & 0 deletions artifacthub-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repositoryID: 97c48e9b-3ece-4ce3-a888-6f3a63f2734a
owners:
- name: Aaron Layfield
email: [email protected]
6 changes: 3 additions & 3 deletions charts/grafana-agent/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: consul
repository: https://helm.releases.hashicorp.com
version: 0.33.0
digest: sha256:25a768a7a5e0f0f8240291118d141f9c8fb0cd050e5d74f5a13cea4b17cfc92a
generated: "2021-09-08T13:23:36.0307636+09:00"
version: 1.3.2
digest: sha256:48bd505ab89ecc7beccaf617e79b50ae874dcb89dba8039b36bf09315201aaf2
generated: "2024-02-05T22:39:53.273807587Z"
2 changes: 1 addition & 1 deletion charts/grafana-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords:
- cortex
dependencies:
- name: consul
version: 0.33.0
version: 1.3.2
repository: https://helm.releases.hashicorp.com
condition: scrapingServiceMode.enabled
maintainers:
Expand Down
Binary file removed charts/grafana-agent/charts/consul-0.33.0.tgz
Binary file not shown.
Binary file added charts/grafana-agent/charts/consul-1.3.2.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions charts/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ keywords:
- redis
- keyvalue
- database
version: 4.23.1
appVersion: 7.0.9
version: 4.26.4
appVersion: 7.2.4
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
maintainers:
Expand Down
26 changes: 19 additions & 7 deletions charts/redis-ha/README.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions charts/redis-ha/ci/multi-value-configs-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
## Testing if muti-valued config is working or not
redis:
config:
min-replicas-to-write: 1
min-replicas-max-lag: 5
maxmemory: "0"
maxmemory-policy: "volatile-lru"
save:
- "900 1"
- "300 10"
repl-diskless-sync: "yes"
rdbcompression: "yes"
rdbchecksum: "yes"
7 changes: 7 additions & 0 deletions charts/redis-ha/templates/_configs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
{{- end }}
{{- end }}
{{- range $key, $value := .Values.redis.config }}
{{- if kindIs "slice" $value }}
{{- range $value }}
{{ $key }} {{ . }}
{{- end }}
{{- else }}
{{ $key }} {{ $value }}
{{- end }}
{{- end }}
{{- if .Values.auth }}
requirepass replace-default-auth
Expand Down Expand Up @@ -459,6 +465,7 @@
identify_announce_ip
done

trap "exit 0" TERM
while true; do
sleep {{ .Values.splitBrainDetection.interval }}

Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-ha-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
{{- end }}
{{- if .Values.exporter.serviceMonitor.timeout }}
scrapeTimeout: {{ .Values.exporter.serviceMonitor.timeout }}
{{- end }}
{{- with .Values.exporter.serviceMonitor.endpointAdditionalProperties }}
{{- toYaml . | nindent 4 }}
{{- end }}
jobLabel: {{ template "redis-ha.fullname" . }}
namespaceSelector:
Expand Down
4 changes: 3 additions & 1 deletion charts/redis-ha/templates/redis-haproxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.haproxy.deploymentStrategy }}
strategy:
type: RollingUpdate
{{- toYaml . | nindent 4 }}
{{- end }}
revisionHistoryLimit: 1
replicas: {{ .Values.haproxy.replicas }}
selector:
Expand Down
74 changes: 74 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{- if and .Values.haproxy.enabled .Values.haproxy.networkPolicy.enabled }}
{{- $root := . }}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy-network-policy
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.haproxy.networkPolicy.annotations }}
annotations:
{{- range $key, $value := .Values.haproxy.networkPolicy.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "labels.standard" . | nindent 4 }}
{{- range $key, $value := .Values.haproxy.networkPolicy.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
podSelector:
matchLabels:
release: {{ .Release.Name }}
app: {{ template "redis-ha.name" . }}-haproxy
policyTypes:
- Ingress
- Egress
egress:
- to:
- podSelector:
matchLabels:
release: {{ .Release.Name }}
app: {{ template "redis-ha.name" . }}
ports:
- port: {{ .Values.redis.port }}
protocol: TCP
- port: {{ .Values.sentinel.port }}
protocol: TCP
- to:
- namespaceSelector: {}
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
{{- range $rule := .Values.haproxy.networkPolicy.egressRules }}
- to:
{{- (tpl (toYaml $rule.selectors) $) | nindent 8 }}
ports:
{{- toYaml $rule.ports | nindent 8 }}
{{- end }}
ingress:
- from:
- podSelector:
matchLabels:
release: {{ .Release.Name }}
app: {{ template "redis-ha.name" . }}
ports:
- port: {{ .Values.redis.port }}
protocol: TCP
- port: {{ .Values.sentinel.port }}
protocol: TCP
{{- range $rule := .Values.haproxy.networkPolicy.ingressRules }}
- from:
{{- (tpl (toYaml $rule.selectors) $) | nindent 8 }}
ports:
{{- if $rule.ports }}
{{- toYaml $rule.ports | nindent 8 }}
{{- end }}
- port: {{ $root.Values.redis.port }}
protocol: TCP
- port: {{ $root.Values.sentinel.port }}
protocol: TCP
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ spec:
{{- if and (eq .Values.haproxy.service.type "LoadBalancer") .Values.haproxy.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{ toYaml .Values.haproxy.service.loadBalancerSourceRanges | nindent 2 }}
{{- end }}
{{- if .Values.haproxy.service.externalIPs }}
externalIPs:
{{- range $key, $value := .Values.haproxy.service.externalIPs }}
- {{ $value }}
{{- end }}
{{- end }}
ports:
- name: tcp-haproxy
port: {{ .Values.haproxy.servicePort }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
{{- end }}
{{- if .Values.haproxy.metrics.serviceMonitor.timeout }}
scrapeTimeout: {{ .Values.haproxy.metrics.serviceMonitor.timeout }}
{{- end }}
{{- with .Values.haproxy.metrics.serviceMonitor.endpointAdditionalProperties }}
{{- toYaml . | nindent 4 }}
{{- end }}
jobLabel: {{ template "redis-ha.fullname" . }}-haproxy
namespaceSelector:
Expand Down
47 changes: 41 additions & 6 deletions charts/redis-ha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
image:
repository: redis
tag: 7.0.9-alpine3.17
tag: 7.2.4-alpine
pullPolicy: IfNotPresent

## Reference to one or more secrets to be used when pulling images
Expand Down Expand Up @@ -79,9 +79,15 @@ haproxy:
enabled: false
port: 6380
replicas: 3
# -- Deployment strategy for the haproxy deployment
deploymentStrategy:
type: RollingUpdate
# rollingUpdate:
# maxSurge: 25%
# maxUnavailable: 25%
image:
repository: haproxy
tag: 2.6.9
tag: 2.9.4-alpine
pullPolicy: IfNotPresent

## Custom labels for the haproxy pod
Expand All @@ -105,7 +111,6 @@ haproxy:
# maxUnavailable: 1
# minAvailable: 1


## Enable sticky sessions to Redis nodes via HAProxy
## Very useful for long-living connections as in case of Sentry for example
stickyBalancing: false
Expand All @@ -116,6 +121,7 @@ haproxy:
service:
type: ClusterIP
loadBalancerIP:
externalIPs: {}
labels: {}
annotations: null

Expand Down Expand Up @@ -145,9 +151,11 @@ haproxy:
# Set path to redis-exporter telemtery-path
# telemetryPath: /metrics
# Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator
# labels: {}
labels: {}
# Set timeout for scrape
# timeout: 10s
# Set additional properties for the ServiceMonitor endpoints such as relabeling, scrapeTimeout, tlsConfig, and more.
endpointAdditionalProperties: {}
init:
resources: {}
timeout:
Expand Down Expand Up @@ -201,6 +209,31 @@ haproxy:
IPv6:
enabled: true

networkPolicy:
## whether NetworkPolicy for Haproxy should be created
enabled: false
annotations: {}
labels: {}
## user defines ingress rules that Haproxy should permit into
## uses the format defined in https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
ingressRules: []
# - selectors:
# - namespaceSelector:
# matchLabels:
# name: my-redis-client-namespace
# podSelector:
# matchLabels:
# application: redis-client
## if ports is not defined then it defaults to the ports defined for enabled services (redis, sentinel)
# ports:
# - port: 6379
# protocol: TCP
# - port: 26379
# protocol: TCP

## user can define egress rules too, uses the same structure as ingressRules
egressRules: []

## Role Based Access
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
##
Expand Down Expand Up @@ -470,7 +503,7 @@ topologySpreadConstraints:
exporter:
enabled: false
image: oliver006/redis_exporter
tag: v1.43.0
tag: v1.57.0
pullPolicy: IfNotPresent

# prometheus port & scrape path
Expand Down Expand Up @@ -527,9 +560,11 @@ exporter:
# Set path to redis-exporter telemtery-path
# telemetryPath: /metrics
# Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator
# labels: {}
labels: {}
# Set timeout for scrape
# timeout: 10s
# Set additional properties for the ServiceMonitor endpoints such as relabeling, scrapeTimeout, tlsConfig, and more.
endpointAdditionalProperties: {}

# prometheus exporter SCANS redis db which can take some time
# allow different probe settings to not let container crashloop
Expand Down

0 comments on commit 7fb8754

Please sign in to comment.