gpt4 book ai didi

kubernetes - 如何配置 Keycloak Helm Chart

转载 作者:行者123 更新时间:2023-12-02 11:30:33 33 4
gpt4 key购买 nike

我正在尝试将 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',
]
P.S 我正在尝试为 https://github.com/oauth2-proxy/oauth2-proxy/tree/master/contrib/local-environment 运行 k8s 示例
他们在那里有带有 Dex 的 k8s 演示,我想用 Keycloak 对其进行调整。

最佳答案

您可以使用 kompose 工具将 docker compose 直接转换为 kubernetes 文件。如果您想制作 Helm chart ,只需替换为模板并在图表值中提供值。此外,Kubernetes 部署在 yaml 中有命令字段。
正如您在 github.com/codecentric/helm-charts/blob/master/charts/keycloak/... 中所见命令 由 .Values.command 设置
所以在文件 github.com/codecentric/helm-charts/blob/master/charts/keycloak/... 替换 命令:[] 与您的 docker-compose 命令 .

关于kubernetes - 如何配置 Keycloak Helm Chart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63640401/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com