poolRef从pool获取预热,携带了entrypoint,但看pod的yaml还是pool的配置,是没注入成功导致还是缺少了什么配置呢?
================================pool配置=================================
spec:
containers:
- args:
- |
set -e
if [ -x /opt/opensandbox/bin/execd ]; then
/opt/opensandbox/bin/execd &
fi
tail -f /dev/null
command:
- sh
- '-lc'
env:
- name: PORT
value: '3000'
- name: NODE_ENV
value: production
image: harbor.xxxx.cn/version/xxxx/xxxx-service-sandbox:v0.1.6
imagePullPolicy: IfNotPresent
name: sandbox
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
cpu: '1'
memory: 4Gi
requests:
cpu: '1'
memory: 4Gi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/opensandbox/bin
name: opensandbox-bin
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-z5rpd
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
initContainers:
- args:
- |
cp ./execd /opt/opensandbox/bin/execd &&
cp ./bootstrap.sh /opt/opensandbox/bin/bootstrap.sh &&
chmod +x /opt/opensandbox/bin/execd &&
chmod +x /opt/opensandbox/bin/bootstrap.sh
command:
- /bin/sh
- '-c'
image: harbor.xxxx.cn/tool/opensandbox/execd:v1.0.18
imagePullPolicy: IfNotPresent
name: execd-installer
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/opensandbox/bin
name: opensandbox-bin
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-z5rpd
readOnly: true
===========================获取预热时的entrypoint==============================
func buildPoolRefSandboxEntrypoint() string {
return `set -e
if [ -z "${EXECD_ACCESS_TOKEN:-}" ]; then
echo "EXECD_ACCESS_TOKEN is required"
exit 1
fi
for pid in $(pidof execd 2>/dev/null || true); do
kill "$pid" 2>/dev/null || true
done
i=0
while pidof execd >/dev/null 2>&1 && [ "$i" -lt 20 ]; do
sleep 0.1
i=$((i + 1))
done
/opt/opensandbox/bin/execd --access-token "$EXECD_ACCESS_TOKEN" &
tail -f /dev/null`
}
poolRef从pool获取预热,携带了entrypoint,但看pod的yaml还是pool的配置,是没注入成功导致还是缺少了什么配置呢?
================================pool配置=================================
spec:
containers:
- args:
- |
set -e
if [ -x /opt/opensandbox/bin/execd ]; then
/opt/opensandbox/bin/execd &
fi
tail -f /dev/null
command:
- sh
- '-lc'
env:
- name: PORT
value: '3000'
- name: NODE_ENV
value: production
image: harbor.xxxx.cn/version/xxxx/xxxx-service-sandbox:v0.1.6
imagePullPolicy: IfNotPresent
name: sandbox
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
cpu: '1'
memory: 4Gi
requests:
cpu: '1'
memory: 4Gi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/opensandbox/bin
name: opensandbox-bin
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-z5rpd
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
initContainers:
- args:
- |
cp ./execd /opt/opensandbox/bin/execd &&
cp ./bootstrap.sh /opt/opensandbox/bin/bootstrap.sh &&
chmod +x /opt/opensandbox/bin/execd &&
chmod +x /opt/opensandbox/bin/bootstrap.sh
command:
- /bin/sh
- '-c'
image: harbor.xxxx.cn/tool/opensandbox/execd:v1.0.18
imagePullPolicy: IfNotPresent
name: execd-installer
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/opensandbox/bin
name: opensandbox-bin
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-z5rpd
readOnly: true
===========================获取预热时的entrypoint==============================
func buildPoolRefSandboxEntrypoint() string {
return `set -e
if [ -z "${EXECD_ACCESS_TOKEN:-}" ]; then
echo "EXECD_ACCESS_TOKEN is required"
exit 1
fi
for pid in $(pidof execd 2>/dev/null || true); do
kill "$pid" 2>/dev/null || true
done
i=0
while pidof execd >/dev/null 2>&1 && [ "$i" -lt 20 ]; do
sleep 0.1
i=$((i + 1))
done
/opt/opensandbox/bin/execd --access-token "$EXECD_ACCESS_TOKEN" &
tail -f /dev/null`
}