kubernetes入门(10)kubernetes单机安装后 - helloworld

 

前言

查看端口是否被监听了 ::netstat -tlp |grep 31002

我是用的yum install etcd kubernetes docker vim, 这样装的是1.5.2,不是最新版本的kubernetes

据说可以下载*Admin安装kubernetes,装的比较新,1.7以上才支持istio的!

一、安装业务应用

1、安装

kubectl create -f mysql-rc.xml

kubectl create -f mysql-svc.xml

kubectl create -f myweb-rc.xml

kubectl create -f myweb-svc.xml

2、检查

kubectl get rc

kubectl get pods

kubectl get services

3、问题1:发现pod都在containercreating状态,不是running

运行 kubectl get pods 发现一直在containercreating状态,执行 kubectl describe pod xxxx,发现基础镜像找不到

Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest\""
百度到的解决办法有:
1\FQ
2\修改hosts文件(这里我用的是“61.91.161.217 gcr.io”,但是可能会失效)
3\从其他源下载容器pod-infrastructure:latest”,然后打tag为“registry.access.redhat.com/rhel7/pod-infrastructure:latest”

我的具体做法:

修改docker配置 vi /etc/sysconfig/docker 增加  --insecure-registry gcr.io  --registry-mirror=https://olzwzeg2.mirror.aliyuncs.com , systemctl restart docker

从hub.com 搜索下载镜像 pod-infrastructure:latest,修改tag:docker tag xxx 

2.2、192.168.136.103:30001

kubectl get service

使用当前node的ip+30001构造测试地址::http://192.168.136.103:30001/demo

报错如下:Error:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

解决办法:

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值