在此处输入图像描述我正在尝试在我的项目中实现 HPA,这样每当 CPU 利用率高于 15% 时,它应该自动缩放 pod,但 HPA 正在工作,它正在创建 pod,但 pod 正在从容器创建状态变为终止状态在一秒钟内,由于 pod 正在终止,因此也无法看到任何与 pod 相关的日志,但 kubectl get events
正在显示:
"**Error: cannot find volume "default-token-chcXX" to mount into container, Unable to attach or mount volumes: unmounted volumes=[default-token-chcXX[\][1], unattached volumes=[default-token-chcXX]: timed out waiting for the condition** "
apiVersion: apps/v1
kind: Deployment
metadata:
name: XXX
namespace: XXX
spec:
selector:
matchLabels:
app: XXX
replicas: 2
template:
metadata:
labels:
app: XXX
annotations:
timestamp: "{{ .Values.metadata.annotations.timestamp }}"
spec:
containers:
- name: gui
image: ""1.0"
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-chcXX
readOnly: true
imagePullPolicy: Always
resources:
limits:
memory: 300m
cpu: 512Mi
requests:
memory: 300m
cpu: 512Mi
nodeSelector:
agentpool: XXX
tolerations:
- key: pool-name
operator: Equal
value: XXX
effect: NoSchedule
volumes:
- name: default-token-chcXX
secret:
defaultMode: 420
secretName: default-token-chcXX