Skip to content

Commit 97c5b7a

Browse files
authored
Merge pull request #25 from valkey-io/fix/notes
Fix/notes
2 parents 8e4a1c9 + c387bc6 commit 97c5b7a

File tree

2 files changed

+107
-54
lines changed

2 files changed

+107
-54
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,53 @@
1-
name: Lint and Test Charts
1+
name: Helm Template (valkey)
22

3-
on: pull_request
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: helm-template-${{ github.ref }}
15+
cancel-in-progress: true
416

517
jobs:
6-
lint-test:
18+
template:
719
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
kube: ["1.31.0", "1.30.0"] # K8s versions to render against
24+
825
steps:
926
- name: Checkout
10-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
1128
with:
12-
fetch-depth: 0
29+
fetch-depth: 1
1330

1431
- name: Set up Helm
15-
uses: azure/setup-helm@v4.2.0
32+
uses: azure/setup-helm@v4
1633
with:
17-
version: v3.17.0
34+
version: v3.15.3
1835

19-
- uses: actions/[email protected]
20-
with:
21-
python-version: '3.x'
22-
check-latest: true
23-
24-
- name: Set up chart-testing
25-
uses: helm/[email protected]
36+
- name: Build dependencies (if any)
37+
run: |
38+
helm dependency build valkey || true
2639
27-
- name: Run chart-testing (list-changed)
28-
id: list-changed
40+
- name: Render manifests (helm template)
2941
run: |
30-
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
31-
if [[ -n "$changed" ]]; then
32-
echo "changed=true" >> "$GITHUB_OUTPUT"
33-
fi
34-
35-
- name: Run chart-testing (lint)
36-
if: steps.list-changed.outputs.changed == 'true'
37-
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
38-
39-
- name: Create kind cluster
40-
if: steps.list-changed.outputs.changed == 'true'
41-
uses: helm/[email protected]
42-
43-
- name: Run chart-testing (install)
44-
if: steps.list-changed.outputs.changed == 'true'
45-
run: ct install --target-branch ${{ github.event.repository.default_branch }}
42+
out="/tmp/valkey-k${{ matrix.kube }}.yaml"
43+
helm template valkey-tmpl ./valkey \
44+
--kube-version "${{ matrix.kube }}" \
45+
> "$out"
46+
echo "Rendered -> $out"
47+
48+
- name: Upload rendered manifests
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: valkey-template-k${{ matrix.kube }}
52+
path: /tmp/valkey-*.yaml
53+
if-no-files-found: error

valkey/templates/NOTES.txt

Lines changed: 67 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,67 @@
1-
1. Get the application URL by running these commands:
2-
{{- if .Values.ingress.enabled }}
3-
{{- range $host := .Values.ingress.hosts }}
4-
{{- range .paths }}
5-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6-
{{- end }}
7-
{{- end }}
8-
{{- else if contains "NodePort" .Values.service.type }}
9-
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "valkey.fullname" . }})
10-
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11-
echo http://$NODE_IP:$NODE_PORT
12-
{{- else if contains "LoadBalancer" .Values.service.type }}
13-
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14-
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "valkey.fullname" . }}'
15-
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "valkey.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16-
echo http://$SERVICE_IP:{{ .Values.service.port }}
17-
{{- else if contains "ClusterIP" .Values.service.type }}
18-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "valkey.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19-
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20-
echo "Visit http://127.0.0.1:8080 to use your application"
21-
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22-
{{- end }}
1+
{{/*
2+
NOTES for Valkey Helm Chart
3+
This file is rendered after `helm install` / `helm upgrade`.
4+
*/}}
5+
6+
⭐ Valkey has been deployed!
7+
8+
Release: {{ .Release.Name }}
9+
Namespace: {{ .Release.Namespace }}
10+
Chart: {{ .Chart.Name }} {{ .Chart.Version }}
11+
App version: {{ .Chart.AppVersion }}
12+
13+
Service: {{ include "valkey.fullname" . }}
14+
Type: {{ .Values.service.type }}
15+
Port: {{ .Values.service.port }}
16+
17+
1) In-cluster access
18+
From another Pod:
19+
$ valkey-cli -h {{ include "valkey.fullname" . }} -p {{ .Values.service.port }} PING
20+
21+
2) Local access via kubectl port-forward
22+
$ kubectl -n {{ .Release.Namespace }} port-forward svc/{{ include "valkey.fullname" . }} 6379:{{ .Values.service.port }}
23+
In another terminal:
24+
$ valkey-cli -h 127.0.0.1 -p 6379 PING
25+
26+
{{ if eq .Values.service.type "LoadBalancer" }}
27+
3) External access (LoadBalancer)
28+
$ export SERVICE_IP=$(kubectl -n {{ .Release.Namespace }} get svc {{ include "valkey.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
29+
$ valkey-cli -h $SERVICE_IP -p {{ .Values.service.port }} PING
30+
{{ else if eq .Values.service.type "NodePort" }}
31+
3) External access (NodePort)
32+
$ export NODE_PORT=$(kubectl -n {{ .Release.Namespace }} get svc {{ include "valkey.fullname" . }} -o jsonpath='{.spec.ports[0].nodePort}')
33+
$ export NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
34+
$ valkey-cli -h $NODE_IP -p $NODE_PORT PING
35+
{{ end }}
36+
37+
{{ if .Values.auth.enabled }}
38+
🔐 Authentication is ENABLED (ACL)
39+
- Provide the username and password from `.auth.aclConfig`.
40+
- Default user:
41+
$ valkey-cli -h {{ include "valkey.fullname" . }} -p {{ .Values.service.port }} -a <password> PING
42+
- Named user:
43+
$ valkey-cli -h {{ include "valkey.fullname" . }} -p {{ .Values.service.port }} --user <user> -a <password> PING
44+
{{ else }}
45+
🔓 Authentication is DISABLED
46+
- Enable with: `--set auth.enabled=true` and provide `.auth.aclConfig`.
47+
{{ end }}
48+
49+
✅ Quick test
50+
$ valkey-cli -h {{ include "valkey.fullname" . }} -p {{ .Values.service.port }}{{ if .Values.auth.enabled }} --user <user> -a <password>{{ end }}
51+
valkey> SET foo bar
52+
valkey> GET foo
53+
"bar"
54+
55+
{{ if .Values.dataStorage.enabled }}
56+
💾 Persistence
57+
- A PVC is enabled. To see it:
58+
$ kubectl -n {{ .Release.Namespace }} get pvc -l app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/name={{ include "valkey.name" . }}
59+
- Note: `dataStorage.keepPvc={{ .Values.dataStorage.keepPvc }}` controls whether the PVC is kept on uninstall.
60+
{{ else }}
61+
💾 Persistence
62+
- Persistence is DISABLED. Data will not survive Pod restarts.
63+
- Enable with: `--set dataStorage.enabled=true --set dataStorage.requestedSize=5Gi` (optionally set `dataStorage.className`).
64+
{{ end }}
65+
66+
🧹 Uninstall
67+
$ helm -n {{ .Release.Namespace }} uninstall {{ .Release.Name }}

0 commit comments

Comments
 (0)