有没有办法告诉kubectl我的Pod应该只部署在某个实例池上?
例如:
nodeSelector:
pool: poolname
假设我已经用以下内容创建了我的泳池:
gcloud container node-pools create poolname --cluster=cluster-1 --num-nodes=10 --machine-type=n1-highmem-32
最佳答案
好的,我找到了解决方案:
gcloud为池名称创建一个标签。在 list 中,我只是将其放在节点选择器下。很容易。
我的manifest.yaml出现了:我用kubernetes部署了ipyparallel
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ipengine
spec:
replicas: 1
template:
metadata:
labels:
app: ipengine
spec:
containers:
- name: ipengine
image: <imageaddr.>
args:
- ipengine
- --ipython-dir=/tmp/config/
- --location=ipcontroller.default.svc.cluster.local
- --log-level=0
resources:
requests:
cpu: 1
#memory: 3Gi
nodeSelector:
#<labelname>:value
cloud.google.com/gke-nodepool: pool-highcpu32