Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Add external valkey to nextcloud and juicefs #1514

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6fff170
add valkey-cluster as a memecache for nextcloud
cloudymax Jul 15, 2024
748c652
tweak some redis options and set a sync wave
cloudymax Jul 15, 2024
e8b363c
disable tls for now
cloudymax Jul 15, 2024
ff4da67
remove tls cert mounts
cloudymax Jul 15, 2024
cfffe12
try some other redis configs
cloudymax Jul 15, 2024
7677f5b
re-enable tls
cloudymax Jul 16, 2024
a41be5d
use tls only, no password
cloudymax Jul 16, 2024
9b12a93
fix certificate names
cloudymax Jul 16, 2024
3114a3d
add to the correct project
cloudymax Jul 16, 2024
a413071
change instance sizes
cloudymax Jul 16, 2024
3caf78b
add valkey to juicefs
cloudymax Jul 16, 2024
9f0a9a0
switch back to passwords
cloudymax Jul 18, 2024
de3894c
Update valkey_cluster_argocd_app.yaml
cloudymax Oct 25, 2024
c10b80b
Merge remote-tracking branch 'origin' into valkey-nextcloud
cloudymax Oct 27, 2024
f2df23c
fix secret name mismatch
cloudymax Oct 27, 2024
5d1ac38
enable more redis?
cloudymax Oct 27, 2024
8730205
enable less redis?
cloudymax Oct 27, 2024
36f43ac
switch from valkey cluster to valkey
cloudymax Oct 27, 2024
e83b9f7
swapping to non-clustered valkey
cloudymax Oct 27, 2024
fa7473c
fix incorrect branch ref
cloudymax Oct 27, 2024
19de3f4
fix bool vs string errors
cloudymax Oct 27, 2024
d67eddb
fix bool vs string issues
cloudymax Oct 27, 2024
3a96aea
more bool string stuff
cloudymax Oct 27, 2024
3b0222c
fix valkey pvc names
cloudymax Oct 27, 2024
c8ec362
add redis host env var
cloudymax Oct 27, 2024
865c5cd
add redis host port env var
cloudymax Oct 27, 2024
ff2e294
add redis host port env var
cloudymax Oct 27, 2024
2ea78d1
add redis host port env var
cloudymax Oct 27, 2024
6fb40be
fix valkey secret names
cloudymax Dec 31, 2024
f95559a
Update nextcloud_argocd_appset.yaml
cloudymax Dec 31, 2024
7e929d5
fix secret names again
cloudymax Dec 31, 2024
ef3acbe
enable redis options
cloudymax Dec 31, 2024
d15dc90
enable redis options
cloudymax Dec 31, 2024
2514774
enable redis options
cloudymax Dec 31, 2024
9f3fbe6
nextcloud_argocd_appset.yaml
cloudymax Dec 31, 2024
c80d3ee
remove old redis
cloudymax Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions demo/juicefs/app_of_apps/juicefs_argocd_appset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ spec:
input:
parameters:
secret_vars:
- juicefs_redis_password
- juicefs_redis_url
- juicefs_redis_port
- juicefs_valkey_password
- juicefs_valkey_url
- juicefs_valkey_port
- juicefs_s3_key_id
- juicefs_s3_secret_key
- juicefs_s3_bucket_url
Expand Down Expand Up @@ -78,15 +78,15 @@ spec:
- secretName: juicefs-tls
hosts:
- "{{ .juicefs_s3_dshboard_url }}"

storageClasses:
- name: "juicefs-sc"
- name: "juicefs"
enabled: true
reclaimPolicy: Delete
allowVolumeExpansion: true
backend:
name: "juicefs"
metaurl: "redis://:{{ .juicefs_redis_password }}@{{ .juicefs_redis_url }}:{{ .juicefs_redis_port }}/1"
metaurl: "redis://:{{ .juicefs_valkey_password }}@{{ .juicefs_valkey_url }}:{{ .juicefs_valkey_port }}/1"
storage: "s3"
bucket: "{{ .juicefs_s3_bucket_url }}"
accessKey: {{ .juicefs_s3_key_id }}
Expand Down
80 changes: 0 additions & 80 deletions demo/juicefs/app_of_apps/redis-cluster_argocd_app.yaml

This file was deleted.

116 changes: 116 additions & 0 deletions demo/juicefs/app_of_apps/valkey-cluster_argocd_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
# has to be after secrets, but before web-app
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: juicefs-valkey-cluster-appset
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "3"
spec:
goTemplate: true
# generator allows us to source specific values from an external k8s secret
generators:
- plugin:
configMapRef:
name: secret-var-plugin-generator
input:
parameters:
secret_vars:
- juicefs_valkey_password
template:
metadata:
name: juicefs-valkey-cluster
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
project: juicefs
destination:
server: https://kubernetes.default.svc
namespace: juicefs
syncPolicy:
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
automated:
prune: true
selfHeal: true
source:
repoURL: 'registry-1.docker.io'
chart: bitnamicharts/valkey-cluster
targetRevision: 0.1.2
helm:
values: |
fullnameOverride: "valkey"

usePassword: false
password: ""
existingSecret: ""
existingSecretPasswordKey: ""

tls:
enabled: true
authClients: true
autoGenerated: true

service:
ports:
valkey: 6379
type: ClusterIP
loadBalancerIP: ""
loadBalancerSourceRanges: []
externalTrafficPolicy: Cluster

persistence:
enabled: true
path: /bitnami/valkey/data
storageClass: "local-path"
annotations:
k8up.io/backup: "true"
accessModes:
- ReadWriteOnce
size: 8Gi

persistentVolumeClaimRetentionPolicy:
enabled: false
whenScaled: Retain
whenDeleted: Retain

valkey:
command: []
args: []
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 0
podManagementPolicy: Parallel
automountServiceAccountToken: false
hostNetwork: false
useAOFPersistence: "yes"
containerPorts:
valkey: 6379
bus: 16379
resourcesPreset: "small"
resources: {}

cluster:
init: true
nodes: 6
replicas: 1
externalAccess:
enabled: false
hostMode: false
service:
disableLoadBalancerIP: false
type: LoadBalancer
port: 6379
loadBalancerIP: []
loadBalancerSourceRanges: []

metrics:
enabled: false
resourcesPreset: "micro"
serviceMonitor:
enabled: false


39 changes: 37 additions & 2 deletions nextcloud/app_of_apps/nextcloud_argocd_appset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,26 @@ spec:
- name: "PGSSLROOTCERT"
value: /etc/secrets/ca/ca.crt

- name: "REDIS_HOST"
value: valkey-primary.nextcloud.svc.cluster.local

- name: "REDIS_HOST_PORT"
value: "6379"

- name: "REDIS_HOST_PASSWORD"
valueFrom:
secretKeyRef:
name: nextcloud-redis-credentials
key: redis_password

extraVolumes:
# - name: before-starting-scripts
# configMap:
# name: before-starting-scripts
# defaultMode: 0550
#- name: certs
# secret:
# secretName: valkey-crt

- name: postgres-ca
secret:
Expand All @@ -206,21 +221,28 @@ spec:
extraVolumeMounts:
# - name: before-starting-scripts
# mountPath: /docker-entrypoint-hooks.d/before-starting
#- mountPath: /certs
# name: certs

- name: postgres-ca
mountPath: /etc/secrets/ca

- name: postgres-client-certs
mountPath: /etc/secrets/nextcloud

# defaultConfigs:
# redis.config.php: false
defaultConfigs:
redis.config.php: true

phpConfigs:
# www.conf: |-
# [www]
# user = www-data
# group = www-data
#redis-cluster.ini: |-
# redis.session.locking_enabled=1
# redis.session.lock_retries=-1
# redis.session.lock_wait_time=10000

www.conf: |-
[www]
security.limit_extensions = .php .css .js .html
Expand All @@ -243,6 +265,19 @@ spec:
php_admin_value[post_max_size] = 10G

configs:
redis.config.php: |-
<?php
$CONFIG = [
'memcache.local' => '\OC\Memcache\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => [
'host' => 'getenv("REDIS_HOST")',
'port' => 'getenv("REDIS_HOST_PORT")',
'password' => 'getenv(REDIS_HOST_PASSWORD)',
],
];

logging.config.php: |-
<?php
$CONFIG = array (
Expand Down
40 changes: 31 additions & 9 deletions nextcloud/app_of_apps/pvc_argocd_appset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
- nextcloud_config_pvc_enabled
- nextcloud_config_storage
- nextcloud_config_access_mode
- nextcloud_valkey_storage
- nextcloud_valkey_access_mode
- nextcloud_valkey_pvc_enabled
template:
metadata:
name: nextcloud-pvc
Expand All @@ -42,19 +45,38 @@ spec:
source:
repoURL: https://github.com/small-hack/argocd-apps.git
path: nextcloud/storage/pvc/
targetRevision: main
targetRevision: valkey-nextcloud
helm:
valuesObject:
# -- enable nextcloud files pvc
files_pvc:
enabled: '{{ .nextcloud_files_pvc_enabled }}'
storageClassName: '{{ .global_pvc_storage_class }}'
accessMode: '{{ .nextcloud_files_access_mode }}'
storage: '{{ .nextcloud_files_storage }}'
enabled: true
#enabled: '{{ .nextcloud_valkey_pvc_enabled }}'
storageClassName: local-path
#storageClassName: '{{ .global_pvc_storage_class }}'
accessMode: ReadWriteOnce
#accessMode: '{{ .nextcloud_valkey_access_mode }}'
storage: 20Gi
#storage: '{{ .nextcloud_valkey_storage }}'

# -- enable nextcloud configuration pvc
config_pvc:
enabled: '{{ .nextcloud_config_pvc_enabled }}'
storageClassName: '{{ .global_pvc_storage_class }}'
accessMode: '{{ .nextcloud_config_access_mode }}'
storage: '{{ .nextcloud_config_storage }}'
enabled: true
#enabled: '{{ .nextcloud_valkey_pvc_enabled }}'
storageClassName: local-path
#storageClassName: '{{ .global_pvc_storage_class }}'
accessMode: ReadWriteOnce
#accessMode: '{{ .nextcloud_valkey_access_mode }}'
storage: 2Gi
#storage: '{{ .nextcloud_valkey_storage }}'

# -- enable mastodon valkeyuration pvc
valkey_pvc:
enabled: true
#enabled: '{{ .nextcloud_valkey_pvc_enabled }}'
storageClassName: local-path
#storageClassName: '{{ .global_pvc_storage_class }}'
accessMode: ReadWriteOnce
#accessMode: '{{ .nextcloud_valkey_access_mode }}'
storage: 2Gi
#storage: '{{ .nextcloud_valkey_storage }}'
Loading