kubernetes无法为简单的RC创buildpod
我build立了一个本地的一体化Kubernetes env。 我按照下面的步骤来安装。 当我尝试创build我的第一个RC时,RC成功创build,但是该Pod没有创build:
Env:CentOS7
#systemctl disable firewalld #systemctl stop firewalld #yum install -y etcd kubernetes #systemctl start etcd #systemctl start docker #systemctl start kube-apiserver #systemctl start kube-controller-manager #systemctl start kube-scheduler #systemctl start kubelet #systemctl start kube-proxy
所有服务开始成功。
MySQL的-rc.yaml:
apiVersion: v1 kind: ReplicationController metadata: name: mysql spec: replicas: 1 selector: app: mysql template: metadata: labels: app: mysql spec: containers: - name: mysql image: mysql resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "500m" ports: - containerPort: 3306 env: - name: MYSQL_ROOT_PASSWORD value: "123456"
命令:
[root@terryhu82 yaml]# kubectl create -f mysql-rc.yaml replicationcontroller "mysql" created [root@terryhu82 yaml]# kubectl get rc NAME DESIRED CURRENT READY AGE mysql 1 0 0 48s [root@terryhu82 yaml]# kubectl get pods No resources found. [root@terryhu82 yaml]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@terryhu82 yaml]# kubectl get nodes NAME STATUS AGE 127.0.0.1 Ready 23h [root@terryhu82 yaml]# kubectl describe node 127.0.0.1 Name: 127.0.0.1 Role: Labels: beta.kubernetes.io/arch=amd64 beta.kubernetes.io/os=linux kubernetes.io/hostname=127.0.0.1 Taints: <none> CreationTimestamp: Mon, 06 Nov 2017 00:22:58 +0800 Phase: Conditions: Type Status LastHeartbeatTime LastTransitionTime Reason Message ---- ------ ----------------- ------------------ ------ ------- OutOfDisk False Mon, 06 Nov 2017 23:38:05 +0800 Mon, 06 Nov 2017 00:22:58 +0800 KubeletHasSufficientDisk kubelet has sufficient disk space available MemoryPressure False Mon, 06 Nov 2017 23:38:05 +0800 Mon, 06 Nov 2017 00:22:58 +0800 KubeletHasSufficientMemory kubelet has sufficient memory available DiskPressure False Mon, 06 Nov 2017 23:38:05 +0800 Mon, 06 Nov 2017 00:22:58 +0800 KubeletHasNoDiskPressure kubelet has no disk pressure Ready True Mon, 06 Nov 2017 23:38:05 +0800 Mon, 06 Nov 2017 00:23:08 +0800 KubeletReady kubelet is posting ready status Addresses: 127.0.0.1,127.0.0.1,127.0.0.1 Capacity: alpha.kubernetes.io/nvidia-gpu: 0 cpu: 4 memory: 16416476Ki pods: 110 Allocatable: alpha.kubernetes.io/nvidia-gpu: 0 cpu: 4 memory: 16416476Ki pods: 110 System Info: Machine ID: 52ac3151ed7d485d98fa44e0da0e817b System UUID: 564D434D-F7CF-9923-4B1D-A494E3391AE1 Boot ID: 148e293c-9631-4421-b55b-115ba72bc1d3 Kernel Version: 3.10.0-693.5.2.el7.x86_64 OS Image: CentOS Linux 7 (Core) Operating System: linux Architecture: amd64 Container Runtime Version: docker://1.12.6 Kubelet Version: v1.5.2 Kube-Proxy Version: v1.5.2 ExternalID: 127.0.0.1 Non-terminated Pods: (0 in total) Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits --------- ---- ------------ ---------- --------------- ------------- Allocated resources: (Total limits may be over 100 percent, ie, overcommitted. CPU Requests CPU Limits Memory Requests Memory Limits ------------ ---------- --------------- ------------- 0 (0%) 0 (0%) 0 (0%) 0 (0%) Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 13m 13m 1 {kubelet 127.0.0.1} Normal Starting Starting kubelet. 13m 13m 1 {kubelet 127.0.0.1} Warning ImageGCFailed unable to find data for container / 13m 13m 6 {kubelet 127.0.0.1} Normal NodeHasSufficientDisk Node 127.0.0.1 status is now: NodeHasSufficientDisk 13m 13m 6 {kubelet 127.0.0.1} Normal NodeHasSufficientMemory Node 127.0.0.1 status is now: NodeHasSufficientMemory 13m 13m 6 {kubelet 127.0.0.1} Normal NodeHasNoDiskPressure Node 127.0.0.1 status is now: NodeHasNoDiskPressure 13m 13m 1 {kubelet 127.0.0.1} Warning Rebooted Node 127.0.0.1 has been rebooted, boot id: 148e293c-9631-4421-b55b-115ba72bc1d3
我没有执行任何组件的configuration。 任何人都可以帮助指导为什么豆荚和容器没有被创build? 我在哪里可以看到日志?
运行这个mysql你需要173MB
内存。 你定义了128M作为上限,那就是为什么它没有开始。 你可以使用下面的一个。
apiVersion: v1 kind: ReplicationController metadata: name: mysql spec: replicas: 1 selector: app: mysql template: metadata: labels: app: mysql spec: containers: - name: mysql image: mysql resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "200Mi" cpu: "500m" ports: - containerPort: 3306 env: - name: MYSQL_ROOT_PASSWORD value: "123456"
htop输出
- 使用非默认端口在Docker容器中运行Rails应用程序
- 在Docker for Mac中增加磁盘映像大小
- 我怎么能说HTTPS到我的本地dockerregistry(sonatype nexus)
- 如何使用私人dockerregistry定义Kubernetes作业?
- Dockerized PostgreSQL:psql:致命:数据库系统正在启动
- Docker镜像里面的进程是否仍然需要pipe理?
- AWS Elastic Beanstalk中的Docker:在$ PATH中找不到可执行文件“
- Docker卷 – 将不同的文件系统绑定到../docker/volumes/
- 如何访问Google AppEngine托pipe虚拟机日志?