1. The following error was reported during the creation of Nginx pod:
#kubectlcreate-F Nginx-pod.yaml
from " Nginx-pod.yaml " " Nginx " is for default/default is automatically created and added to the service account
Workaround:
1> Modify the Kube_admission_control parameter in the/etc/kubernetes/apiserver file.
Before modification:
Kube_admission_control="--admission_control=namespacelifecycle,namespaceexists,limitranger, Securitycontextdeny,serviceaccount,resourcequota"
Remove the "serviceaccount" option.
2> Restart Kube-apiserver Service
# systemctl Restart Kube-apiserver.
2. During the pod creation process, the exception is displayed, and the following error message is available by viewing the log/var/log/messages:
Nov - +: the: .localhost kube-apiserver:e1126 +: the:06.697708 1963Server.go:454] Unable to generate self signed cert:open/var/run/kubernetes/apiserver.crt:permission Deniednov - +: the: .localhost kube-apiserver:e1126 +: the:06.697818 1963Server.go:464] Unable to listen forSecure (Open/var/run/kubernetes/apiserver.crt:no such file or directory); WouldTryAgain.
There are two ways to resolve this:
The first method:
# Vim/usr/lib/systemd/system/kube-apiserver.service
[Service]permissionsstartonly=trueexecstartpre=-/usr/bin/mkdir/var/run/ kubernetesexecstartpre=/usr/bin/chown-r kube:kube/var/run/kubernetes/
# Systemctl Daemon-reload
# systemctl Restart Kube-apiserver
The second method:
# Vim/etc/kubernetes/apiserver
kube_api_args="--secure-port=0"
Add the--secure-port=0 parameter to the Kube_api_args.
The reasons are as follows:
--secure-port=64430, Don't serve HTTPS at all.
3. During the creation of the pod using the Yaml file, the report "Error from Server:the server could not find the requested resource"
The problem is most problematic because the kubernetes version is too low, although the node node status display is ready, but the pod cannot be created.
Accompanying phenomenon: When describing the state of a node, it is shown as follows, and normally there is no red box part.
and the version information displayed is as follows:
Note: This version of the information is consistent with the version information in the Yum source provided by Kubernetes: http://cbs.centos.org/repos/virt7-testing/x86_64/os/Packages/
And the latest version information is:
Kubelet Version: v1.0.3.34+b9a88a7d0e357b
cause of the problem:
The CentOS-brought CD is used as the local Yum source, and the configuration file of the network Yum source with CentOS is removed.
Workaround:
Use the configuration file of the network Yum source that comes with CentOS.
PS: How to Build a kubernetes cluster, refer to the Official building guide
Https://github.com/kubernetes/kubernetes/blob/release-1.0/docs/getting-started-guides/centos/centos_manual_config.md
Problems encountered during the construction of Kubernetes cluster