heapster-controller.yaml 错误 - 选择以下之一:[heapster eventer heapster-nanny eventer-nanny]
heapster-controller.yaml error -choose one of: [heapster eventer heapster-nanny eventer-nanny]
正在尝试部署 heapster-controller
让 Heapster + Graphana + InfluxDB 为 Kubernetes 工作。尝试使用 heapster-controller.yaml 文件进行部署时收到错误消息:
heapster-controller.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: heapster-v1.1.0-beta1
namespace: kube-system
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
matchLabels:
k8s-app: heapster
template:
metadata:
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: gcr.io/google_containers/heapster:v1.1.0-beta1
name: heapster
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 200m
requests:
cpu: 100m
memory: 200m
command:
- /heapster
- --source=kubernetes.summary_api:''
- --sink=influxdb:http://monitoring-influxdb:8086
- --metric_resolution=60s
- image: gcr.io/google_containers/heapster:v1.1.0-beta1
name: eventer
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 200m
requests:
cpu: 100m
memory: 200m
command:
- /eventer
- --source=kubernetes:''
- --sink=influxdb:http://monitoring-influxdb:8086
- image: gcr.io/google_containers/addon-resizer:1.0
name: heapster-nanny
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --cpu=100m
- --extra-cpu=0m
- --memory=200
- --extra-memory=200Mi
- --threshold=5
- --deployment=heapster-v1.1.0-beta1
- --container=heapster
- --poll-period=300000
- image: gcr.io/google_containers/addon-resizer:1.0
name: eventer-nanny
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --cpu=100m
- --extra-cpu=0m
- --memory=200
- --extra-memory=200Ki
- --threshold=5
- --deployment=heapster-v1.1.0-beta1
- --container=eventer
- --poll-period=300000
部署成功,但出现错误:
[root@node236 influxdb]# kubectl get pods -o wide --namespace=kube-system
NAME READY STATUS RESTARTS AGE NODE
heapster-v1.1.0-beta1-3082378092-t6inb 2/4 RunContainerError 0 1m node262.local.net
[root@node236 influxdb]#
显示失败容器的日志:
[root@node236 influxdb]# kubectl logs --namespace=kube-system heapster-v1.1.0-beta1-3082378092-t6inb
Error from server: a container name must be specified for pod heapster-v1.1.0-beta1-3082378092-t6inb, choose one of: [heapster eventer heapster-nanny eventer-nanny]
[root@node236 influxdb]#
我可能哪里出错了?
感谢任何反馈!!
亚历克斯
正确的语法是kubectl logs <pod> <container>
。
在您的示例中,kubectl logs heapster-v1.1.0-beta1-3082378092-t6inb heapster --namespace=kube-system
将显示指定 pod 中 "heapster" 容器的日志。
非常感谢您的反馈。我认为我的问题在于 tls-certs。需要深入挖掘。
再次感谢!!
正在尝试部署 heapster-controller
让 Heapster + Graphana + InfluxDB 为 Kubernetes 工作。尝试使用 heapster-controller.yaml 文件进行部署时收到错误消息:
heapster-controller.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: heapster-v1.1.0-beta1
namespace: kube-system
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
matchLabels:
k8s-app: heapster
template:
metadata:
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: gcr.io/google_containers/heapster:v1.1.0-beta1
name: heapster
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 200m
requests:
cpu: 100m
memory: 200m
command:
- /heapster
- --source=kubernetes.summary_api:''
- --sink=influxdb:http://monitoring-influxdb:8086
- --metric_resolution=60s
- image: gcr.io/google_containers/heapster:v1.1.0-beta1
name: eventer
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 200m
requests:
cpu: 100m
memory: 200m
command:
- /eventer
- --source=kubernetes:''
- --sink=influxdb:http://monitoring-influxdb:8086
- image: gcr.io/google_containers/addon-resizer:1.0
name: heapster-nanny
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --cpu=100m
- --extra-cpu=0m
- --memory=200
- --extra-memory=200Mi
- --threshold=5
- --deployment=heapster-v1.1.0-beta1
- --container=heapster
- --poll-period=300000
- image: gcr.io/google_containers/addon-resizer:1.0
name: eventer-nanny
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --cpu=100m
- --extra-cpu=0m
- --memory=200
- --extra-memory=200Ki
- --threshold=5
- --deployment=heapster-v1.1.0-beta1
- --container=eventer
- --poll-period=300000
部署成功,但出现错误:
[root@node236 influxdb]# kubectl get pods -o wide --namespace=kube-system
NAME READY STATUS RESTARTS AGE NODE
heapster-v1.1.0-beta1-3082378092-t6inb 2/4 RunContainerError 0 1m node262.local.net
[root@node236 influxdb]#
显示失败容器的日志:
[root@node236 influxdb]# kubectl logs --namespace=kube-system heapster-v1.1.0-beta1-3082378092-t6inb
Error from server: a container name must be specified for pod heapster-v1.1.0-beta1-3082378092-t6inb, choose one of: [heapster eventer heapster-nanny eventer-nanny]
[root@node236 influxdb]#
我可能哪里出错了?
感谢任何反馈!!
亚历克斯
正确的语法是kubectl logs <pod> <container>
。
在您的示例中,kubectl logs heapster-v1.1.0-beta1-3082378092-t6inb heapster --namespace=kube-system
将显示指定 pod 中 "heapster" 容器的日志。
非常感谢您的反馈。我认为我的问题在于 tls-certs。需要深入挖掘。
再次感谢!!