feat(hydra-cleaner): add component #61

Open
lgourvenec wants to merge 1 commits from f/hydra_cleaner into unstable
Owner

Hydra database doesn't remove data from its table "oauth2_flow" and all the tables linked (by a foreign key) to it (code, access, oidc, etc.).

This component remove data older than a specific date, by batch with a limit.

This component rely on the component hydra-cnpg-database.

To test it, import the component

components:
- https://forge.cadoles.com/CadolesKube/sso-kustom//components/hydra-cleaner?ref=f/hydra_cleaner

and modify your NetworkPolicy if you already have one

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-hydra-database
spec:
  podSelector:
    matchLabels:
      cnpg.io/cluster: hydra-postgres
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app.kubernetes.io/name: hydra
    - podSelector:
        matchLabels:
          app.kubernetes.io/name: hydra-cleaner
    ports:
    - port: 5432

You can also modify the configmap:

configMapGenerator:
- name: hydra-cleaner-env
  behavior: merge
  literals:
  - RETENTION_HOURS="0"
  - BATCH_SIZE="100"
  - LIMIT="1000"
Hydra database doesn't remove data from its table "oauth2_flow" and all the tables linked (by a foreign key) to it (code, access, oidc, etc.). This component remove data older than a specific date, by batch with a limit. This component rely on the component hydra-cnpg-database. To test it, import the component ``` components: - https://forge.cadoles.com/CadolesKube/sso-kustom//components/hydra-cleaner?ref=f/hydra_cleaner ``` and modify your NetworkPolicy if you already have one ``` apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-hydra-database spec: podSelector: matchLabels: cnpg.io/cluster: hydra-postgres policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: hydra - podSelector: matchLabels: app.kubernetes.io/name: hydra-cleaner ports: - port: 5432 ``` You can also modify the configmap: ``` configMapGenerator: - name: hydra-cleaner-env behavior: merge literals: - RETENTION_HOURS="0" - BATCH_SIZE="100" - LIMIT="1000" ```
lgourvenec added 1 commit 2025-02-27 16:26:12 +01:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin f/hydra_cleaner:f/hydra_cleaner
git checkout f/hydra_cleaner
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CadolesKube/sso-kustom#61
No description provided.