keycloak高可用部署

木木1年前技术文章738

添加keycloak应用

rancher应用商店模式添加keycloak仓库地址

rancher应用商店添加bitnami的helm仓库地址

https://charts.bitnami.com/bitnami

chart模式添加keycloak

添加对应chart包

keycloak-9.2.5_jsDHLiSrDK.tgz

安装keycloak

应用商店安装keycloak并且对yaml文件进行自定义

affinity: {}
args: []
auth:
  adminPassword: ''
  adminUser: admin #管理员用户名称,可更改
  createAdminUser: true
  existingSecret: ''
  existingSecretPerPassword: {}
  managementPassword: ''
  managementUser: manager
  tls:
    autoGenerated: false
    enabled: false
    existingSecret: ''
    jksSecret: ''
    keystoreFilename: ''
    keystorePassword: ''
    resources:
      limits: {}
      requests: {}
    truststoreFilename: ''
    truststorePassword: ''
    usePem: false
autoscaling:
  enabled: false
  maxReplicas: 11
  minReplicas: 1
  targetCPU: ''
  targetMemory: ''
cache:
  enabled: false
clusterDomain: cluster.local
command: []
commonAnnotations: {}
commonLabels: {}
configuration: ''
containerPorts:
  http: 8080
  https: 8443
  management: 9990
containerSecurityContext:
  enabled: true
  runAsNonRoot: true
  runAsUser: 1001
customLivenessProbe: {}
customReadinessProbe: {}
customStartupProbe: {}
diagnosticMode:
  args:
    - infinity
  command:
    - sleep
  enabled: false
existingConfigmap: ''
externalDatabase:
  database: bitnami_keycloak
  existingSecret: ''
  existingSecretPasswordKey: ''
  host: ''
  password: ''
  port: 5432
  user: bn_keycloak
extraDeploy: []
extraEnvVars: []
extraEnvVarsCM: ''
extraEnvVarsSecret: ''
extraStartupArgs: ''
extraVolumeMounts: []
extraVolumes: []
fullnameOverride: ''
global:
  imagePullSecrets: []
  imageRegistry: ''
  # 配置存储
  storageClass: ''
  cattle:
    systemProjectId: p-s7jhh
hostAliases: []
image:
  debug: false
  pullPolicy: IfNotPresent
  pullSecrets: []
  registry: docker.io
  repository: bitnami/keycloak
  tag: 18.0.0-debian-10-r6
ingress:
  annotations: {}
  apiVersion: ''
  enabled: false
  extraHosts: []
  extraPaths: []
  extraRules: []
  extraTls: []
  hostname: keycloak.local
  ingressClassName: ''
  path: /
  pathType: ImplementationSpecific
  secrets: []
  selfSigned: false
  servicePort: http
  tls: false
initContainers: []
initdbScripts: {}
initdbScriptsConfigMap: ''
keycloakConfigCli:
  annotations:
    helm.sh/hook: post-install,post-upgrade,post-rollback
    helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
    helm.sh/hook-weight: '5'
  args: []
  backoffLimit: 1
  command: []
  configuration: {}
  containerSecurityContext:
    enabled: true
    runAsNonRoot: true
    runAsUser: 1001
  enabled: false
  existingConfigmap: ''
  extraEnvVars: []
  extraEnvVarsCM: ''
  extraEnvVarsSecret: ''
  extraVolumeMounts: []
  extraVolumes: []
  hostAliases: []
  image:
    pullPolicy: IfNotPresent
    pullSecrets: []
    registry: docker.io
    repository: bitnami/keycloak-config-cli
    tag: 5.2.0-debian-10-r15
  podAnnotations: {}
  podLabels: {}
  podSecurityContext:
    enabled: true
    fsGroup: 1001
  resources:
    limits: {}
    requests: {}
kubeVersion: ''
lifecycleHooks: {}
livenessProbe:
  enabled: true
  failureThreshold: 3
  initialDelaySeconds: 300
  periodSeconds: 1
  successThreshold: 1
  timeoutSeconds: 5
metrics:
  enabled: false
  service:
    annotations:
      prometheus.io/port: '{{ .Values.metrics.service.ports.http }}'
      prometheus.io/scrape: 'true'
    ports:
      http: 9990
  serviceMonitor:
    enabled: false
    honorLabels: false
    interval: 30s
    jobLabel: ''
    labels: {}
    metricRelabelings: []
    namespace: ''
    relabelings: []
    scrapeTimeout: ''
    selector: {}
nameOverride: ''
networkPolicy:
  additionalRules: {}
  allowExternal: true
  enabled: false
nodeAffinityPreset:
  key: ''
  type: ''
  values: []
nodeSelector: {}
pdb:
  create: false
  maxUnavailable: ''
  minAvailable: 1
podAffinityPreset: ''
podAnnotations: {}
podAntiAffinityPreset: soft
podLabels: {}
podManagementPolicy: Parallel
podSecurityContext:
  enabled: true
  fsGroup: 1001
postgresql:
  architecture: standalone
  auth:
    database: bitnami_keycloak
    existingSecret: ''
    password: ''
    username: bn_keycloak
  enabled: true
priorityClassName: ''
proxy: passthrough
rbac:
  create: false
  rules: []
readinessProbe:
  enabled: true
  failureThreshold: 3
  initialDelaySeconds: 30
  periodSeconds: 10
  successThreshold: 1
  timeoutSeconds: 1
replicaCount: 1
resources:
  limits: {}
  requests: {}
schedulerName: ''
service:
  annotations: {}
  clusterIP: ''
  externalTrafficPolicy: Cluster
  extraPorts: []
  loadBalancerIP: ''
  loadBalancerSourceRanges: []
  nodePorts:
    http: ''
    https: ''
  ports:
    http: 80
    https: 443
  sessionAffinity: None
  type: ClusterIP
serviceAccount:
  annotations: {}
  automountServiceAccountToken: true
  create: true
  name: ''
sidecars: []
startupProbe:
  enabled: false
  failureThreshold: 60
  initialDelaySeconds: 30
  periodSeconds: 5
  successThreshold: 1
  timeoutSeconds: 1
terminationGracePeriodSeconds: ''
tolerations: []
topologySpreadConstraints: {}
updateStrategy:
  rollingUpdate: {}
  type: RollingUpdate

配置文件官方参考文档

https://github.com/bitnami/charts/tree/master/bitnami/keycloak/

获取admin用户的password

Plain Text kubectl get secret keycloak -n {namespace}  -o jsonpath='{.data.admin-password}' |base64 -d

配置keycloak

登录后界面如下

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271434342.png

设置中文

如图进行设置

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271436795.png

创建域

鼠标移动到左上角即可以创建域(realm),域是一个隔离的空间,在realm中我们可以创建users和applications。

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271445147.png

创建完成后可以看到我们已经切换到了刚刚创建的域

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271446419.png

创建用户

接下来我们创建一个用户

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271446838.png

输入用户名确定即可

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271451975.png

创建完成后选择到凭据页面为用户添加密码

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202209291623644.png

用户登录

在客户端页面我们可以看到我们这个域的登录链接

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271501069.png

尝试进行登录

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271502650.png

修改密码

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271503607.png

进行配置

https://teamo-md.oss-cn-shanghai.aliyuncs.com/img/202205271503780.png


相关文章

helm简介

helm简介

一、Helm 是什么在没使用 helm 之前,向 kubernetes 部署应用,我们要依次部署 deployment、svc 等,步骤较繁琐。况且随着很多项目微服务化,复杂的应用在容器中部署以及管理...

oracle安装gi执行root.sh报错:PRCR-1079 : Failed to start resource ora.cvu

1、具体报错如下:安装gi执行root.sh报错:PRCC-1014 : LISTENER_SCAN1 was already runningPRCR-1004 : Resource ora.LIST...

使用Sqoop将数据从Hive导入MySQL(一)

使用Sqoop将数据从Hive导入MySQL(一)

使用Sqoop将数据从Hive导入MySQL首先查看csv数据类型创建类似的hive表并导入数据CREATE TABLE data (    province STRING,    code INT,...

MySQL运维实战(4.7) SQL_MODE之ANSI_QUOTES

默认情况下,mysql使用反引号(`)作为标识符的引号。使用mysql关键字作为表名、字段名会报语法错误,这时可以加上反引号( `),避免报错。设置ANSI_QUOTES后,使用双引号(")...

MySQL运维实战(4.1) MySQL表存储引擎

MySQL表的特点和其他数据库如Oracle、SQL Server相比,mysql有一些特点:MySQL使用插件式存储引擎,同一个数据库中的表可以使用不同的存储引擎。存储引擎决定了表的物理存储格式。表...

Kubernetes openelb

1、背景在云服务环境中的 Kubernetes 集群里,通常可以用云服务提供商提供的负载均衡服务来暴露 Service,但是在本地没办法这样操作。而 OpenELB 可以让用户在裸金属服务器、边缘以及...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。