[英]Aerospike user not found when running as nonroot
我正在使用社區版 aerospike docker 圖像。 我們的 k8s 集群不允許以 root 身份運行容器。 因此我開始關注這個文檔以非 root 身份運行。
但是當運行圖像時,我遇到了錯誤
link eth0 state up
link eth0 state up in 0
Dec 02 2021 10:15:12 GMT: CRITICAL (config): (cfg.c:2168) line 6 :: user not found: 8888
Dec 02 2021 10:15:12 GMT: WARNING (as): (signal.c:166) SIGINT received, shutting down Aerospike Community Edition build 5.6.0.7 os debian10
Dec 02 2021 10:15:12 GMT: WARNING (as): (signal.c:169) startup was not complete, exiting immediately
我的 aerospike conf 中有以下配置
service {
user 8888
group 8888
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile /var/run/aerospike/asd.pid
# service-threads 6 # cpu x 5 in 4.7
# transaction-queues 6 # obsolete in 4.7
# transaction-threads-per-queue 4 # obsolete in 4.7
proto-fd-max 15000
}
下面是我的 k8s 配置
apiVersion: apps/v1
kind: Deployment
metadata:
name: aerospike
labels:
app: aerospike
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0%
maxUnavailable: 100%
selector:
matchLabels:
app: aerospike
template:
metadata:
labels:
app: aerospike
spec:
terminationGracePeriodSeconds: 30
volumes:
- name: config-volume
configMap:
name: aerospikeconfig
containers:
- name: aerospike-container
image: aerospikeimage
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /etc/aerospike/
name: config-volume
env:
- name: NAMESPACE
value: "bar"
securityContext:
runAsUser: 8888
runAsGroup: 8888
runAsNonRoot: true
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 1Gi
cpu: 1
我認為這與 Kubernetes 無關,而只是 aerospike 您正在使用 uid/gid
user 8888
group 8888
您可以嘗試使用用戶名/組名嗎
user some_user
group some_group
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.