diff --git a/.github/workflows/deploy-to-nais.yml b/.github/workflows/deploy-to-nais.yml index b8ba814eb..00095aae7 100644 --- a/.github/workflows/deploy-to-nais.yml +++ b/.github/workflows/deploy-to-nais.yml @@ -17,7 +17,7 @@ on: hpa_file: required: false type: string - deploy_redis: + deploy_valkey: required: false type: boolean @@ -30,14 +30,14 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Deploy Redis - if: ${{ inputs.deploy_redis == true }} + - name: Deploy Valkey + if: ${{ inputs.deploy_valkey == true }} uses: nais/deploy/actions/deploy@v2 timeout-minutes: 1 continue-on-error: true env: CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/redis.yml + RESOURCE: .nais/valkey.yml VARS: .nais/vars/${{ inputs.vars_file }} - name: Deploy HPA if: ${{ inputs.hpa_file }} diff --git a/.github/workflows/deploy.dev1.yml b/.github/workflows/deploy.dev1.yml index c1517ce75..e7d5363a2 100644 --- a/.github/workflows/deploy.dev1.yml +++ b/.github/workflows/deploy.dev1.yml @@ -48,4 +48,4 @@ jobs: vars_file: vars-dev1.yml config_file: config.yml hpa_file: hpa-dev1.yml - deploy_redis: true + deploy_valkey: true diff --git a/.github/workflows/deploy.dev2.yml b/.github/workflows/deploy.dev2.yml index d671bebb9..d4c6418ca 100644 --- a/.github/workflows/deploy.dev2.yml +++ b/.github/workflows/deploy.dev2.yml @@ -48,4 +48,4 @@ jobs: vars_file: vars-dev2.yml config_file: config.yml hpa_file: hpa-dev2.yml - deploy_redis: true + deploy_valkey: true diff --git a/.github/workflows/deploy.prod.yml b/.github/workflows/deploy.prod.yml index 13f710b10..dd9af2a60 100644 --- a/.github/workflows/deploy.prod.yml +++ b/.github/workflows/deploy.prod.yml @@ -41,4 +41,4 @@ jobs: vars_file: vars-prod.yml config_file: config.yml hpa_file: hpa-prod.yml - deploy_redis: true + deploy_valkey: true diff --git a/.nais/config.yml b/.nais/config.yml index 11edc45c5..37d4118f9 100644 --- a/.nais/config.yml +++ b/.nais/config.yml @@ -27,8 +27,8 @@ spec: prometheus: enabled: true path: /internal/metrics - redis: - - instance: {{ redis.instance }} + valkey: + - instance: {{ valkey.instance }} access: readwrite ingresses: {{#each ingresses as |url|}} diff --git a/.nais/redis.yml b/.nais/valkey.yml similarity index 51% rename from .nais/redis.yml rename to .nais/valkey.yml index 4a7e00200..c0bb0c79d 100644 --- a/.nais/redis.yml +++ b/.nais/valkey.yml @@ -1,18 +1,18 @@ apiVersion: aiven.io/v1alpha1 -kind: Redis +kind: Valkey metadata: labels: app: nav-enonicxp-frontend team: personbruker - name: redis-personbruker-{{ redis.instance }} + name: valkey-personbruker-{{ valkey.instance }} namespace: personbruker spec: - plan: {{ redis.plan }} - project: {{ redis.project }} + plan: {{ valkey.plan }} + project: {{ valkey.project }} maintenanceWindowDow: saturday maintenanceWindowTime: 20:00:00 userConfig: - redis_maxmemory_policy: allkeys-lru + valkey_maxmemory_policy: allkeys-lru --- apiVersion: aiven.io/v1alpha1 @@ -20,10 +20,10 @@ kind: ServiceIntegration metadata: labels: team: personbruker - name: redis-personbruker-{{ redis.instance }} + name: valkey-personbruker-{{ valkey.instance }} namespace: personbruker spec: - project: {{ redis.project }} + project: {{ valkey.project }} integrationType: prometheus - destinationEndpointId: {{ redis.endpointId }} - sourceServiceName: redis-personbruker-{{ redis.instance }} + destinationEndpointId: {{ valkey.endpointId }} + sourceServiceName: valkey-personbruker-{{ valkey.instance }} diff --git a/.nais/vars/vars-dev1.yml b/.nais/vars/vars-dev1.yml index c791c93fd..63b88599b 100644 --- a/.nais/vars/vars-dev1.yml +++ b/.nais/vars/vars-dev1.yml @@ -15,7 +15,7 @@ resources: memory: 1000Mi limits: memory: 2000Mi -redis: +valkey: plan: hobbyist project: nav-dev instance: pagecache diff --git a/.nais/vars/vars-dev2.yml b/.nais/vars/vars-dev2.yml index 0315eb5db..faf605ebe 100644 --- a/.nais/vars/vars-dev2.yml +++ b/.nais/vars/vars-dev2.yml @@ -16,7 +16,7 @@ resources: memory: 500Mi limits: memory: 1000Mi -redis: +valkey: plan: hobbyist project: nav-dev instance: pagecache diff --git a/.nais/vars/vars-prod.yml b/.nais/vars/vars-prod.yml index 823ec6bdd..6b5d850f6 100644 --- a/.nais/vars/vars-prod.yml +++ b/.nais/vars/vars-prod.yml @@ -13,7 +13,7 @@ resources: memory: 2048Mi limits: memory: 4096Mi -redis: +valkey: plan: startup-4 project: nav-prod instance: pagecache diff --git a/docker-compose.yml b/docker-compose.yml index 4d54e8b3a..119271371 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: - '3002:3002' environment: SERVICE_SECRET: 'dummyToken' - NO_REDIS: true + NO_VALKEY: true dekoratoren: container_name: dekoratoren-xpfrontend diff --git a/nodeenv.d.ts b/nodeenv.d.ts index 09e06c207..17a00243b 100644 --- a/nodeenv.d.ts +++ b/nodeenv.d.ts @@ -20,9 +20,9 @@ declare global { ASSET_PREFIX: string; TELEMETRY_URL: string; NEXT_PHASE: string; - REDIS_URI_PAGECACHE: string; - REDIS_USERNAME_PAGECACHE: string; - REDIS_PASSWORD_PAGECACHE: string; + VALKEY_URI_PAGECACHE: string; + VALKEY_USERNAME_PAGECACHE: string; + VALKEY_PASSWORD_PAGECACHE: string; DECORATOR_NOCACHE?: 'true' | 'false'; } } diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index 901862703..c3f28e97b 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -10,8 +10,8 @@ type XpResponseProps = Record; const clientOptions: RedisClientOptions = { url: process.env.REDIS_URI_PAGECACHE, - username: process.env.REDIS_USERNAME_PAGECACHE, - password: process.env.REDIS_PASSWORD_PAGECACHE, + username: process.env.VALKEY_USERNAME_PAGECACHE, + password: process.env.VALKEY_PASSWORD_PAGECACHE, socket: { keepAlive: 5000, connectTimeout: 10000 }, } as const; @@ -19,7 +19,7 @@ const validateClientOptions = () => { const isValid = !!(clientOptions.url && clientOptions.username && clientOptions.password); if (!isValid) { - logger.error(`Client options for Redis has missing parameters!`); + logger.error(`Client options for Valkey has missing parameters!`); } return isValid; @@ -37,21 +37,23 @@ class RedisCacheImpl { private renderCacheKeyPrefix = ''; constructor() { + logger.info(clientOptions.url); + logger.info(clientOptions.username); this.client = createClient(clientOptions) .on('connect', () => { - logger.info('Redis client connected'); + logger.info('Valkey client connected'); }) .on('ready', () => { - logger.info('Redis client ready'); + logger.info('Valkey client ready'); }) .on('end', () => { - logger.info('Redis client connection closed'); + logger.info('Valkey client connection closed'); }) .on('reconnecting', () => { - logger.info('Redis client reconnecting'); + logger.info('Valkey client reconnecting'); }) .on('error', (err) => { - logger.error(`Redis client error: ${err}`); + logger.error(`Valkey client error: ${err}`); }); } @@ -61,7 +63,7 @@ class RedisCacheImpl { return this.client.connect().then(() => { logger.info( - `Initialized redis client with url ${clientOptions.url} - Render key prefix: ${this.renderCacheKeyPrefix} - Response key prefix: ${this.responseCacheKeyPrefix}` + `Initialized valkey client with url ${clientOptions.url} - Render key prefix: ${this.renderCacheKeyPrefix} - Response key prefix: ${this.responseCacheKeyPrefix}` ); return this; });