Skip to content

Commit

Permalink
feat: apply event-logs cron for dev and test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
NithinKuruba committed Aug 29, 2023
1 parent 910426a commit eea0516
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
4 changes: 3 additions & 1 deletion helm/kc-cron-job/templates/cron-event-logs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{- range .Values.namespace.eventLogs }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "..fullname" . }}-event-logs
namespace: {{ .Values.namespace.eventLogs }}
namespace: {{ . }}
labels:
app.kubernetes.io/name: {{ include "..name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down Expand Up @@ -90,3 +91,4 @@ spec:
persistentVolumeClaim:
claimName: {{ .Values.pvc.name }}
restartPolicy: Never
{{- end }}
2 changes: 2 additions & 0 deletions helm/kc-cron-job/templates/cron-remove-inactive-users.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enableRemoveInactiveUsersJob }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down Expand Up @@ -159,3 +160,4 @@ spec:
name: kc-cron-rm-inactive-users
key: rc-webhook
restartPolicy: Never
{{- end }}
8 changes: 7 additions & 1 deletion helm/kc-cron-job/values-c6af30-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ imagePullSecrets:
nameOverride: kc-cron-job
fullnameOverride: kc-cron-job

enableRemoveInactiveUsersJob: false

namespace:
eventLogs: 'c6af30-prod'
eventLogs:
- 'c6af30-dev'
- 'c6af30-test'
- 'c6af30-prod'
activeSessions: 'c6af30-tools'
rmInactiveUsers: 'c6af30-tools'

pvc:
name: sso-keycloak-logs
Expand Down
7 changes: 6 additions & 1 deletion helm/kc-cron-job/values-eb75ad-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ imagePullSecrets:
nameOverride: kc-cron-job
fullnameOverride: kc-cron-job

enableRemoveInactiveUsersJob: false

namespace:
eventLogs: 'eb75ad-prod'
eventLogs:
- 'eb75ad-dev'
- 'eb75ad-test'
- 'eb75ad-prod'
activeSessions: 'eb75ad-tools'
rmInactiveUsers: 'eb75ad-tools'

Expand Down
39 changes: 39 additions & 0 deletions localdev/macs/docker-compose-kc-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3.8'

services:
keycloak:
container_name: keycloak
image: keycloak:9.0.3
depends_on:
- postgres
ports:
- 8080:8080
environment:
DB_VENDOR: POSTGRES
DB_PORT: 5432
DB_USER: keycloak
DB_PASSWORD: keycloak
DB_ADDR: postgres:5432
DB_DATABASE: keycloak
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_LOGLEVEL: INFO
ROOT_LOGLEVEL: INFO

postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
restart: on-failure
tty: true
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
postgres_data:
driver: local

0 comments on commit eea0516

Please sign in to comment.