【问题标题】:Error setting up tools on kubernetes on local system在本地系统上的 kubernetes 上设置工具时出错
【发布时间】:2017-02-01 13:11:40
【问题描述】:

我刚刚开始使用 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 已成功设置,其余显示错误,如图所示:

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

ps:如果有任何要求:
操作系统:Ubuntu 16.04
CPU:英特尔 i5 6200
GPU:英伟达 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

Pod 已完成,但除了 spark 之外没有运行。我怎样才能运行它们?

【问题讨论】:

    标签: ubuntu apache-spark hdfs kubernetes


    【解决方案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

    【讨论】:

    • 我已经编辑了我的问题,请阅读输出并告诉我那里出了什么问题。谢谢
    • 请阅读编辑。我已提取所有必需的图像,但它们没有运行。
    猜你喜欢
    • 1970-01-01
    • 2021-05-12
    • 2015-09-14
    • 2012-03-29
    • 2020-11-17
    • 1970-01-01
    • 2019-12-13
    • 1970-01-01
    • 2020-05-28
    相关资源
    最近更新 更多