Kubernetes daemonset无法运行

时间:2016-04-20 04:35:42

标签: kubernetes

运行Daemonset

kubectl create -f test-daemon.yaml --validate=false

错误

Error from server: error when creating "test-daemon.yaml": the server could not find the requested resource (post daemonsets.extensions)

配置

[Unit]
Description=Kubernetes API Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=network-online.target etcd2.service generate-serviceaccount-key.service
After=network-online.target etcd2.service generate-serviceaccount-key.service
[Service]
EnvironmentFile=/etc/environment
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-apiserver -z /opt/bin/kube-apiserver https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kube-apiserver
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
ExecStartPre=/opt/bin/wupiao 127.0.0.1:2379/v2/machines
ExecStart=/opt/bin/kube-apiserver \
--service_account_key_file=/opt/bin/kube-serviceaccount.key \
--service_account_lookup=false \
--admission_control=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota \
--runtime_config=api/v1,extensions/v1beta1=true,extensions/v1beta1/daemonsets=true \
--allow_privileged=true \
--insecure_bind_address=0.0.0.0 \
--insecure_port=3001 \
--kubelet_https=true \
--secure_port=6443 \
--service-cluster-ip-range=10.100.0.0/16 \
--etcd_servers=http://127.0.0.1:2379 \
--public_address_override=${COREOS_PRIVATE_IPV4} \
--logtostderr=true
Restart=always
RestartSec=10

添加了配置

--runtime_config=api/v1,extensions/v1beta1=true,extensions/v1beta1/daemonsets=true 

ReplicationController

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
  app: test
name: test
spec:
template:
  metadata:
    labels:
      app: test
  spec:
    containers:
      name: test
      image: 192.168.1.3:4000/test
      ports:
        - containerPort: 80

1 个答案:

答案 0 :(得分:0)

尝试删除架构缓存:rm -rf /tmp/kubectl.schema