本文介绍了kube-apiserver在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本问题:当我尝试在主节点上使用kube-apiserver时,出现命令未找到错误.如何安装/配置kube-apiserver?任何指向示例的链接都将有所帮助.

Base question: When I try to use kube-apiserver on my master node, I get command not found error. How I can install/configure kube-apiserver? Any link to example will help.

$ kube-apiserver --enable-admission-plugins DefaultStorageClass
-bash: kube-apiserver: command not found

详细信息:我是Kubernetes和Docker的新手,并试图使用volumeClaimTemplates创建StatefulSet.我的问题是未创建自动PV,我在PVC日志中收到此消息:"persistentvolume-controller等待创建卷".我不确定是否需要定义DefaultStorageClass,是否需要kube-apiserver来定义它.

Details: I am new to Kubernetes and Docker and was trying to create StatefulSet with volumeClaimTemplates. My problem is that the automatic PVs are not created and I get this message in the PVC log: "persistentvolume-controller waiting for a volume to be created". I am not sure if I need to define DefaultStorageClass and so needed kube-apiserver to define it.

Name:          nfs
Namespace:     default
StorageClass:  example-nfs
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner=example.com/nfs
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events:
  Type    Reason                Age                  From                         Message
  ----    ------                ----                 ----                         -------
  Normal  ExternalProvisioning  3m (x2401 over 10h)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner "example.com/nfs" or manually created by system administrator

这是获取pvc结果:

$ kubectl get pvc
NAME      STATUS    VOLUME    CAPACITY   ACCESS MODES   STORAGECLASS   AGE
nfs       Pending                                       example-nfs    10h

并获取storageclass:

And get storageclass:

$ kubectl describe storageclass example-nfs
Name:                  example-nfs
IsDefaultClass:        No
Annotations:           <none>
Provisioner:           example.com/nfs
Parameters:            <none>
AllowVolumeExpansion:  <unset>
MountOptions:          <none>
ReclaimPolicy:         Delete
VolumeBindingMode:     Immediate
Events:                <none>

如何解决此问题(例如,有关未创建存储的原因的日志)?

How can I troubleshoot this issue (e.g. logs for why the storage was not created)?

推荐答案

您在这里问两个不同的问题,一个关于kube-apiserver配置,一个关于对StorageClass进行故障排除.

You are asking two different questions here, one about kube-apiserver configuration, one about troubleshooting your StorageClass.

以下是您第一个问题的答案:

Here's an answer for your first question:

kube-apiserver在您的主节点上作为Docker容器运行.因此,二进制文件位于容器内,而不位于主机系统上.它由主机的kubelet从位于/etc/kubernetes/manifests的文件中启动. kubelet正在监视此目录,并将启动此处定义为静态豆荚"的任何豆荚.

kube-apiserver is running as a Docker container on your master node. Therefore, the binary is within the container, not on your host system. It is started by the master's kubelet from a file located at /etc/kubernetes/manifests. kubelet is watching this directory and will start any Pod defined here as "static pods".

要配置kube-apiserver命令行参数,您需要在主服务器上修改/etc/kubernetes/manifests/kube-apiserver.yaml.

To configure kube-apiserver command line arguments you need to modify /etc/kubernetes/manifests/kube-apiserver.yaml on your master.

这篇关于kube-apiserver在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 20:08