我想第一次设置Kubernetes.我正在关注Fedora手册安装指南:http: //kubernetes.io/v1.0/docs/getting-started-guides/fedora/fedora_manual_config.html
我检查了我的API服务器的日志,并收到此错误:
server.go:464] Unable to listen for secure (open /var/run/kubernetes/apiserver.crt: no such file or directory); will try again.
Run Code Online (Sandbox Code Playgroud)
我认为它需要某种证书,但安装指南并未提及任何相关信息.这是我的apiserver配置文件的样子
# The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0"
# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"
# Port node listen on
KUBELET_PORT="--kubelet_port=10250"
# Location of the etcd cluster
#KUBE_ETCD_SERVERS="--etcd_servers=http://vagrant-master:4001"
KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001"
# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# default admission control policies
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
# Add your own!
KUBE_API_ARGS="--service_account_key_file=/etc/kubernetes/certs/serviceaccount.key"
Run Code Online (Sandbox Code Playgroud)
这是我的服务状态
kube-apiserver.service - …
Run Code Online (Sandbox Code Playgroud) 使用docker,我可以通过log-driver = syslog命令行选项将容器日志转发到syslog.如何通过Kubernetes yaml/json描述符传递这些docker参数?
我正在为pod创建一个基于ram的emptyDir卷.
volumes:
- name: ram-disk
emptyDir:
medium: "Memory"
Run Code Online (Sandbox Code Playgroud)
因为这是一个ram磁盘,我需要设置从ram获取的最大大小.是否有参数来设置最大尺寸和最小尺寸?
我正在使用DigitalOcean上的CoreOs和Kubernetes构建容器集群,我已经看到,为了向世界公开Pod,您必须使用Type:LoadBalancer创建服务.我认为这是最佳解决方案,因此您无需在nuberx或haproxy等kubernetes之外添加外部负载均衡器.我想知道是否可以使用DO的浮动IP来创建它.
我的目标是使我的Web应用程序(部署在Kubernetes 1.4集群上)看到最初发出HTTP请求的客户端的IP.由于我打算在裸机群集上运行应用程序,因此GCE和service.alpha.kubernetes.io/external-traffic: OnlyLocal
1.4中引入的服务注释不适用于我.
寻找替代方案,我发现这个问题建议设置一个Ingress来实现我的目标.所以,我已经设置了Ingress和NginX Ingress控制器.部署进展顺利,我能够通过Ingress地址和端口80连接到我的Web应用程序.但是在日志中我仍然看到集群内部IP(从172.16.0.0/16)范围 - 这意味着外部客户端IP未通过Ingress正确传递.您能否告诉我除了上述内容之外还需要配置什么才能使其正常工作?
我的Ingress'配置:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myWebApp
spec:
backend:
serviceName: myWebApp
servicePort: 8080
Run Code Online (Sandbox Code Playgroud) 我尝试安装Rancher v1.3.1并启用Kubernetes环境,安装似乎没问题,但是当我导航到Dashboard但结果是空白页面时,我检查2部署:kubernetes-dashboard和tiller-deploy每次使用日志重启:
初始化与Kubernetes apiserver的连接时出错.这很可能意味着群集配置错误(例如,它具有无效的apiserver证书或服务帐户配置)或--apiserver-host参数指向不存在的服务器.原因:获取https://10.43.0.1:443/version:拨打tcp 10.43.0.1:443:i/o超时
我不知道为什么,请帮助我
我不知道为什么kubernetes服务公开10.43.0.1:443属于不同的命名空间(默认)与其他人(kube系统)
我的公司使用它自己的根CA,当我试图拉图像时.即使从私人注册表我收到错误:
1小时3分22 {kubelet minikube}警告FailedSync错误同步窗格,跳过:使用ErrImagePull"POD"的"StartContainer"失败:"gcr.io/google_containers/pause-amd64:3.0的图片拉取失败,这可能是因为有此请求没有凭据.
详细信息:(来自守护程序的错误响应:获取https://gcr.io/v1/_ping:x509:由未知权限签名的证书)"1h 10s 387 {kubelet minikube}警告FailedSync错误同步pod,跳过:未能"StartContainer"对于带有ImagePullBackOff的"POD":"后退拉图像"gcr.io/google_containers/pause-amd64:3.0 \""
如何将根CA安装到minkube或避免此消息,即仅使用私有注册表,并且不要从中提取任何内容gcr.io
?
我在kops配置的AWS集群上测试了kubernetes部署和EBS卷安装.这是部署yml文件:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: helloworld-deployment-volume
spec:
replicas: 1
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: k8s-demo
image: wardviaene/k8s-demo
ports:
- name: nodejs-port
containerPort: 3000
volumeMounts:
- mountPath: /myvol
name: myvolume
volumes:
- name: myvolume
awsElasticBlockStore:
volumeID: <volume_id>
Run Code Online (Sandbox Code Playgroud)
之后kubectl create -f <path_to_this_yml>
,我在pod描述中收到以下消息:
Attach failed for volume "myvolume" : Error attaching EBS volume "XXX" to instance "YYY": "UnauthorizedOperation: You are not authorized to perform this operation. status code: 403
Run Code Online (Sandbox Code Playgroud)
看起来这只是一个权限问题.好的,我检查了节点角色的策略IAM
- > Roles
- …
在Google Cloud Function上下文中对GKE集群的Kubernetes API进行身份验证的最佳方法是什么?在深入研究google-auth-library
and 的源代码之后@kubernetes/client-node
,我通过使用一些未公开的API提出了以下解决方案。它可以工作,但是我想知道这是否是正确的方法,以及那里是否有随时可用的东西。
https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters#MasterAuth还返回clientCertificate和clientKey ,这尤其奇怪。将那些用于opts.cert
和opts.key
代替访问令牌会导致以下错误:
Error from server (Forbidden): namespaces "footest" is forbidden: User "client" cannot delete namespaces in the namespace "footest": Unknown user "client"
Run Code Online (Sandbox Code Playgroud)
Error from server (Forbidden): namespaces "footest" is forbidden: User "client" cannot delete namespaces in the namespace "footest": Unknown user "client"
Run Code Online (Sandbox Code Playgroud) kubernetes ×10
amazon-ec2 ×1
clientip ×1
coreos ×1
docker ×1
kops ×1
kubectl ×1
minikube ×1
rancher ×1
syslog ×1