总结一下今日的学习过程
上午继续调试院里的机房机器,不论怎么改,镜像TensorFlow-GPU运行后,就是不能加载cuda。。。
接着看书,看了20页。。。
创建mysql-rc.yaml mysql pod怎么都不成功。。。
崩溃 最后还来一个mysql RC竟然不能删除,辛亏备份了系统,明天重来,
错误总结如下
错误
Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
解决
sed -i 's/KUBE_ADMISSION_CONTROL=.*/KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"/' /etc/kubernetes/apiserver
错误: kubernetes no nodes available to schedule pods in coreos
sed -i 's/KUBE_MASTER="--master=http:\/\/.*:8080"/KUBE_MASTER="--master=http:\/\/testlearn1:8080"/' /etc/kubernetes/config
重启:systemctl restart kube-apiserver
systemctl enable kubelet.service
systemctl start kubelet.service
systemctl enable kube-proxy.service
systemctl start kube-proxy.service
kubectl delete -f mysql-rc.yaml
kubectl create -f mysql-rc.yaml
kubectl get nodes
kubectl get rc
kubectl get pods
kubectl describe pod mysql
错误:Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \" registry.access.redhat.com/rhel7/pod-infrastructure:latest\""
解决
sed -i 's/KUBELET_ADDRESS="--address=.*"/KUBELET_ADDRESS="--address=0.0.0.0"/;s/KUBELET_HOSTNAME="--hostname-override=.*"/KUBELET_HOSTNAME="--hostname-override=
testlearn1"/;s/KUBELET_API_SERVER="--api-servers=http:\/\/.*:8080"/KUBELET_API_SERVER="--api-servers=http:\/\/testlearn1:8080"/;s/KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=.*"/KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=testlearn1:5000\/pod-infrastructure"/;s/KUBELET_ARGS=.*/KUBELET_ARGS="--cluster-dns=10.254.10.2 --cluster-domain=hi --allow-privileged=true"/' /etc/kubernetes/kubelet
function startMasterSoftware(){
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler docker; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done
}
startMasterSoftware
强制删除一个pods
kubectl delete pods mysql-j88c3 --grace-period=0 --force
sed -i
's/ETCD_NAME=default/
ETCD_NAME=testlearn1/
' /etc/etcd/etcd.conf
sed -i 's/ETCD_LISTEN_CLIENT_URLS="http:\/\/.*:2379"/ETCD_LISTEN_CLIENT_URLS="http:\/\/0.0.0.0:2379"/;s/ETCD_ADVERTISE_CLIENT_URLS="http:\/\/.*:2379"/ETCD_ADVERTISE_CLIENT_URLS="http:\/\/0.0.0.0:2379"/' /etc/etcd/etcd.conf
sed -i 's/OPTIONS=\x27--selinux-enabled --log-driver=journald --signature-verification=false.*\x27/OPTIONS=\x27--selinux-enabled --log-driver=journald --signature-verification=false --registry-mirror=https:\/\/ wzmto2ol.mirror.aliyuncs.com --insecure-registry
testlearn1:5000 --add-registry
testlearn1:5000\x27/' /etc/sysconfig/docker