我有一個ACS k8s Windows羣集設置和工作。早在我發現我需要使用nodeSelector時,即使我的容器映像是Windows,k8s也會嘗試將我的容器分配給主節點(Linux)。我用這個:混合CPU /內存資源和nodeSelectors失敗
nodeSelector:
beta.kubernetes.io/os: windows
現在我試圖內存和CPU資源分配給我的豆莢和K8S無法找到一個合適的節點。它顯示了這個錯誤:
No nodes are available that match all of the following predicates:: Insufficient memory (2), MatchNodeSelector (1)
我有一個超小的資源分配和我的節點有足夠的空間供這些:
resources:
requests:
memory: 1Mi
這裏是全K8S部署YAML:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: forest-worker-res
spec:
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
app: forest-worker
template:
metadata:
labels:
app: forest-worker
env: debug
spec:
containers:
- name: forest-worker
image: intmadras.azurecr.io/forest-worker
resources:
requests:
memory: 10Mi
nodeSelector:
beta.kubernetes.io/os: windows
imagePullSecrets:
- name: azurereg
如果我刪除了nodeSelector,那麼depoment會繼續,但是會再次失敗,因爲k8s將它分配給主節點。所以我卡住了。我如何使用nodeSelector並分配資源?
請問您能否顯示k8s文件? –
@ JasonYe-MSFT我已經添加了完整的k8s部署yaml – BrettRobi