Commit 4aaef9c9 by tingweiwang

oidc

0 parents
version: '3'
volumes:
postgres_data:
driver: local
services:
postgres:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
keycloak:
image: jboss/keycloak
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: Pa55w0rd
# Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the PostgreSQL JDBC driver documentation in order to use it.
#JDBC_PARAMS: "ssl=true"
ports:
- 8080:8080
depends_on:
- postgres
\ No newline at end of file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe
convert --file=docker-compose.yml
kompose.version: 1.15.0 (e3cd4d4)
creationTimestamp: null
labels:
io.kompose.service: keycloak
name: keycloak
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: keycloak
spec:
containers:
- name: keycloak
env:
- name: DB_ADDR
value: postgres-keycloak
- name: DB_DATABASE
value: "keycloak"
- name: DB_PASSWORD
value: password
- name: DB_USER
value: keycloak
- name: DB_VENDOR
value: POSTGRES
- name: KEYCLOAK_PASSWORD
value: Pa55w0rd
- name: KEYCLOAK_USER
value: admin
image: jboss/keycloak
ports:
- containerPort: 8080
resources: {}
initContainers:
- name: init-postgres-keycloak-service
image: busybox
command: ['sh', '-c', 'until nslookup postgres-keycloak; do echo waiting for postgres-keycloak; sleep 2; done;']
restartPolicy: Always
status: {}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: keycloak-ingress
spec:
backend:
serviceName: keycloak
servicePort: 8080
\ No newline at end of file
apiVersion: v1
kind: Secret
metadata:
name: secretName
data:
secretKey: BASE64_ENCODED_VALUE
type: Opaque
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe
convert --file=docker-compose.yml
kompose.version: 1.15.0 (e3cd4d4)
creationTimestamp: null
labels:
io.kompose.service: keycloak
name: keycloak
spec:
ports:
- port: 8080
selector:
io.kompose.service: keycloak
type: NodePort
apiVersion: v1
kind: Namespace
metadata:
name: keycloak-demo
\ No newline at end of file
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: postgres-data
name: postgres-data-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgres
annotations:
kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe
convert --file=docker-compose.yml
kompose.version: 1.15.0 (e3cd4d4)
creationTimestamp: null
labels:
io.kompose.service: postgres
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: postgres
spec:
containers:
- name: postgres
env:
- name: POSTGRES_DB
value: keycloak
- name: POSTGRES_PASSWORD
value: password
- name: POSTGRES_USER
value: keycloak
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
image: postgres
ports:
- containerPort: 5432
resources: {}
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres-data-vol
restartPolicy: Always
volumes:
- name: postgres-data-vol
persistentVolumeClaim:
claimName: postgres-pvc
status: {}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
spec:
nfs:
path: /opt/registry
server: 192.168.1.53
accessModes:
- ReadWriteOnce
capacity:
storage: 500Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgres-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: C:\ProgramData\chocolatey\lib\kubernetes-kompose\tools\kompose.exe
convert --file=docker-compose.yml
kompose.version: 1.15.0 (e3cd4d4)
creationTimestamp: null
labels:
io.kompose.service: postgres
name: postgres-keycloak
spec:
ports:
- name: "5432"
port: 5432
selector:
io.kompose.service: postgres
type: ClusterIP
status:
loadBalancer: {}
#!/bin/bash
./start-postgres.sh
./start-keycloak.sh
#!/bin/bash
kubectl apply -f keycloak-deployment.yaml -f keycloak-service.yaml
#!/bin/bash
kubectl apply -f postgres-deployment.yaml -f postgres-service.yaml
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!