在本地系统上的kubernetes上设置工具时出错

时间:2017-01-29 21:06:45

标签: ubuntu apache-spark hdfs kubernetes

我刚刚开始使用kubernetes。我正在关注pipelineIO提供的wiki并设置所有内容。我已经成功设置了kubernetes,但是我需要在集群上运行的其他工具也没有成功。这是他们的bash脚本:

#!/bin/sh

echo '...MySql...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/sql.ml/mysql-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/sql.ml/mysql-svc.yaml

echo '...HDFS...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/hdfs.ml/hdfs-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/hdfs.ml/hdfs-svc.yaml

echo '...Hive Metastore...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/metastore.ml/metastore-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/metastore.ml/metastore-svc.yaml

echo '...Spark - Master...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/apachespark.ml/spark-master-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/apachespark.ml/spark-master-svc.yaml

echo '...Spark - Worker...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/apachespark.ml/spark-worker-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/apachespark.ml/spark-worker-svc.yaml

echo '...JupyterHub...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/jupyterhub.ml/jupyterhub-rc.yaml
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/jupyterhub.ml/jupyterhub-svc.yaml

echo '...Dashboard - Weavescope...'
kubectl create -f https://raw.githubusercontent.com/fluxcapacitor/pipeline/master/dashboard.ml/weavescope/weavescope.yaml
kubectl describe svc weavescope-app

其中,只有weavescope已成功设置,其余显示错误,如图所示:

enter image description here

我不明白出了什么问题以及如何解决它。我无法通过在线搜索解决问题。我不认为任何码头图像实际上是由kubernetes下载的,但我不知道这是不是问题。请帮忙。

ps:如果以任何方式要求:
操作系统:Ubuntu 16.04
CPU:Intel i5 6200
GPU:Nvidia GeForce 940MX

编辑1:
在运行查询kubectl describe node minikube后,我没有找到任何关于findSelector的信息,这里是输出:

Name:           minikube
Role:           
Labels:         beta.kubernetes.io/arch=amd64
            beta.kubernetes.io/os=linux
            kubernetes.io/hostname=minikube
Taints:         <none>
CreationTimestamp:  Mon, 30 Jan 2017 02:16:46 +0530
Phase:          
Conditions:
  Type          Status  LastHeartbeatTime           LastTransitionTime          Reason              Message
  ----          ------  -----------------           ------------------          ------              -------
  OutOfDisk         False   Tue, 31 Jan 2017 02:55:10 +0530     Mon, 30 Jan 2017 02:16:46 +0530     KubeletHasSufficientDisk    kubelet has sufficient disk space available
  MemoryPressure    False   Tue, 31 Jan 2017 02:55:10 +0530     Mon, 30 Jan 2017 02:16:46 +0530     KubeletHasSufficientMemory  kubelet has sufficient memory available
  DiskPressure      False   Tue, 31 Jan 2017 02:55:10 +0530     Mon, 30 Jan 2017 02:16:46 +0530     KubeletHasNoDiskPressure    kubelet has no disk pressure
  Ready         True    Tue, 31 Jan 2017 02:55:10 +0530     Mon, 30 Jan 2017 02:16:47 +0530     KubeletReady            kubelet is posting ready status
Addresses:      192.168.99.100,192.168.99.100,minikube
Capacity:
 alpha.kubernetes.io/nvidia-gpu:    0
 cpu:                   2
 memory:                2049008Ki
 pods:                  110
Allocatable:
 alpha.kubernetes.io/nvidia-gpu:    0
 cpu:                   2
 memory:                2049008Ki
 pods:                  110
System Info:
 Machine ID:            112c60c791a944ff93bbc446e8c28598
 System UUID:           E0D8970E-F2E2-4503-A282-756ADA83592A
 Boot ID:           9305d5d2-11e9-411a-b335-b5aa3d59432e
 Kernel Version:        4.7.2
 OS Image:          Buildroot 2016.08
 Operating System:      linux
 Architecture:          amd64
 Container Runtime Version: docker://1.11.1
 Kubelet Version:       v1.5.1
 Kube-Proxy Version:        v1.5.1
ExternalID:         minikube
Non-terminated Pods:        (4 in total)
  Namespace         Name                    CPU Requests    CPU Limits  Memory Requests Memory Limits
  ---------         ----                    ------------    ----------  --------------- -------------
  default           weavescope-probe-zk779          50m (2%)    50m (2%)    0 (0%)      0 (0%)
  kube-system           kube-addon-manager-minikube     5m (0%)     0 (0%)      50Mi (2%)   0 (0%)
  kube-system           kube-dns-v20-75pq6          110m (5%)   0 (0%)      120Mi (5%)220Mi (10%)
  kube-system           kubernetes-dashboard-5q16v      0 (0%)      0 (0%)      0 (0%)      0 (0%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.
  CPU Requests  CPU Limits  Memory Requests Memory Limits
  ------------  ----------  --------------- -------------
  165m (8%) 50m (2%)    170Mi (8%)  220Mi (10%)
Events:
  FirstSeen LastSeen    Count   From            SubObjectPath   Type        Reason          Message
  --------- --------    -----   ----            -------------   --------    ------          -------
  17m       17m     1   {kube-proxy minikube}           Normal      Starting        Starting kube-proxy.
  17m       17m     1   {kubelet minikube}          Normal      Starting        Starting kubelet.
  17m       17m     1   {kubelet minikube}          Warning     ImageGCFailed       unable to find data for container /
  17m       17m     1   {kubelet minikube}          Normal      NodeHasSufficientDisk   Node minikube status is now: NodeHasSufficientDisk
  17m       17m     1   {kubelet minikube}          Normal      NodeHasSufficientMemory Node minikube status is now: NodeHasSufficientMemory
  17m       17m     1   {kubelet minikube}          Normal      NodeHasNoDiskPressure   Node minikube status is now: NodeHasNoDiskPressure
  17m       17m     1   {kubelet minikube}          Warning     Rebooted        Node minikube has been rebooted, boot id: 9305d5d2-11e9-411a-b335-b5aa3d59432e

编辑2:

cortana@cortana:~$ kubectl get pods
NAME                       READY     STATUS              RESTARTS   AGE
hdfs-gv0ss                 0/1       Completed           0          8h
jupyterhub-master-tt81t    0/1       ContainerCreating   0          8h
metastore-1-2-1-4qdnz      0/1       ContainerCreating   0          8h
mysql-master-8ksch         0/1       Completed           0          8h
spark-master-2-0-1-r8g9j   1/1       Running             1          8h
spark-worker-2-0-1-9v45w   0/1       Completed           0          8h
weavescope-app-lkl15       0/1       ContainerCreating   0          8h
weavescope-probe-s5zsd     0/1       ContainerCreating   0          6h

豆荚已经完成但除了火花之外没有运行。我该怎么办呢?

1 个答案:

答案 0 :(得分:1)

问题是您正在部署的ReplicationControllers有一个节点选择器:

  nodeSelector:
    training: "true"

节点选择器将影响pod的计划。在这种情况下,调度程序正在查找具有名为training的标签的节点,其值为true

我怀疑你没有一个有这个标签的节点。要查看给定节点的标签,您可以使用kubectl describe node $NODE_NAME。有关node selectors here.

的更多信息

编辑:从kubectl的输出中可以看出,您的节点没有标签training=true。该节点具有标签:

Name:           minikube
Role:           
Labels: beta.kubernetes.io/arch=amd64
        beta.kubernetes.io/os=linux
        kubernetes.io/hostname=minikube

因此,没有合适的节点来部署您的工作负载。如果要标记节点,可以kubectl label node minikube training=true