我想将docker-compose.yaml Keycloak转换为Char值,但我有一点困难:
Docker-compose配置看起来像这样:
keycloak:
container_name: keycloak
image: jboss/keycloak:10.0.0
hostname: keycloak
command:
[
'-b',
'0.0.0.0',
'-Djboss.socket.binding.port-offset=1000',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=dir',
'-Dkeycloak.migration.dir=/keycloak',
'-Dkeycloak.migration.strategy=IGNORE_EXISTING',
]
volumes:
- ./keycloak:/realm-config
environment:
KEYCLOAK_USER: admin@example.com
KEYCLOAK_PASSWORD: password
networks:
keycloak:
aliases:
- keycloak.localtest.me
ports:
- 9080:9080/tcp
我想要做的是处理图表数值:
keycloak:
basepath: auth
username: admin
password: password
route:
tls:
enabled: false
extraEnv: |
- name: PROXY_ADDRESS_FORWARDING
value: "true"
- name: KEYCLOAK_IMPORT
value: /keycloak/master-realm.json
- name: JAVA_OPTS
value: >-
-Djboss.socket.binding.port-offset=1000
extraVolumes: |
- name: realm-secret
secret:
secretName: realm-secret
extraVolumeMounts: |
- name: realm-secret
mountPath: "../keycloak/"
readOnly: true
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
path: /auth/?(.*)
hosts:
- keycloak.localtest.me
我不太明白在docker-compose.yaml文件中该把它放在哪里:
command:
[
'-b',
'0.0.0.0',
'-Djboss.socket.binding.port-offset=1000',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=dir',
'-Dkeycloak.migration.dir=/realm-config',
'-Dkeycloak.migration.strategy=IGNORE_EXISTING',
]
附言:我想运行一个关于 k8s 的示例,地址为 https://github.com/oauth2-proxy/oauth2-proxy/tree/master/contrib/local-environment。他们提供了包含 Dex 的 k8s 演示,我想将其改为 Keycloak。