🔧(helm) run a valkey for the backend and one for yhub in dev and feature

We don't want to manage a valkey operator and cluster inside the Docs
repo, this will be managed outside. For dev purpose we only need a
standalone instance of valkey.
This commit is contained in:
Manuel Raynaud
2026-09-23 12:06:05 +02:00
parent 3cd85c95dc
commit 0afd3360fd
13 changed files with 41 additions and 247 deletions
+2 -31
View File
@@ -63,37 +63,8 @@ k8s_resource('impress-docs-celery-worker', resource_deps=['valkey-docs'])
k8s_resource('impress-docs-yhub', resource_deps=['valkey-yhub'])
k8s_resource('impress-docs-yhub-worker', resource_deps=['valkey-yhub'])
# the operator needs its CRDs, which land in uncategorized
k8s_resource('valkey-operator', resource_deps=['uncategorized'])
# The pods of a Valkey instance are created by the operator: group them with the
# objects they come from, and wait for them
for instance in ['valkey-docs', 'valkey-yhub']:
k8s_resource(
new_name=instance,
objects=['%s:valkey' % instance, '%s-user:user' % instance, '%s-user:secret' % instance],
extra_pod_selectors=[{'buf.red/name': instance}],
pod_readiness='wait',
resource_deps=['valkey-operator'],
)
# without --include-crds, the CRDs of the valkey-operator chart are left out
manifests = decode_yaml_stream(local('cd ../src/helm && helmfile -n impress -e dev template --include-crds .'))
for manifest in manifests:
if not manifest:
continue
# tilt down leaves the operator and its CRDs in place: deleted along with the
# Valkey resources, nothing would remain to clear their finalizers, and the
# stuck resources would block the CRDs of the next tilt up
if ((manifest['kind'] == 'CustomResourceDefinition' and manifest['spec']['group'].endswith('valkey.buf.red')) or
manifest['metadata'].get('labels', {}).get('app.kubernetes.io/instance') == 'valkey-operator'):
manifest['metadata'].setdefault('annotations', {})['tilt.dev/down-policy'] = 'keep'
# The chart's webhook.enabled=false only drops the webhook configuration: the
# operator still serves its webhooks and crashes on the missing certificate
# unless ENABLE_WEBHOOKS=false, which the chart cannot set (argocd gets it
# from src/helm/extra/valkey-operator/disable-webhooks.ytt.yaml)
if manifest['kind'] == 'Deployment' and manifest['metadata']['name'] == 'valkey-operator':
manifest['spec']['template']['spec']['containers'][0]['env'].append({'name': 'ENABLE_WEBHOOKS', 'value': 'false'})
k8s_yaml(encode_yaml_stream(manifests))
# the valkey chart leaves its objects without a namespace
k8s_yaml(namespace_inject(local('cd ../src/helm && helmfile -n impress -e dev template .'), 'impress'))
migration = '''
set -eu