作者:孙孟兰_580 | 来源:互联网 | 2023-09-17 12:54
我已经使用AWS EKS Fargate部署了Kubernetes集群,在其中部署了以下部署,服务和Ingress来部署Keycloak:
Deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ikonnekt-keycloak-deployment
spec:
selector:
matchLabels:
app: ikonnekt-keycloak
replicas: 1
template:
metadata:
labels:
app: ikonnekt-keycloak
project: ikonnekt
environment: development
spec:
containers:
- name: ikonnekt-keycloak
image: jboss/keycloak
imagePullPolicy: Always
env:
- name: Proxy_ADDRESS_FORWARDING
value: "true"
- name: KEYCLOAK_LOGLEVEL
value: DEBUG
- name: ROOT_LOGLEVEL
value: DEBUG
ports:
- containerPort: 8080
protocol: TCP
Service.yaml:
apiVersion: v1
kind: Service
metadata:
name: "service-keycloak"
annotations:
alb.ingress.kubernetes.io/target-type: ip
spec:
ports:
- port: 8080
targetPort: 8080
protocol: TCP
type: NodePort
selector:
app: "ikonnekt-keycloak"
Ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "keycloak-ingress"
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
labels:
app: keycloak-ingress
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: "service-keycloak"
servicePort: 8080
我已经使用NGINX容器尝试了完全相同的部署,服务和入口,并且可以正常工作。
是否需要添加任何特定配置以运行keycloak?
当我访问keycloak时,它返回503错误,并在几分钟后重新启动pod。
最后,解决了向部署中添加更多RAM请求的问题。使用它可以正常工作
4GB。
resources:
limits:
memory: "8192Mi"
requests:
memory: "4096Mi"