gongdear   gongdear的技术博客

欢迎大家参观我的博客

标签: Kubernetes (18)

Kubernetes集群安装ingress-nginx 有更新!

先将相关的虚拟机进行快照保存下来 virsh snapshot-create-as gongdear-kubernetes-master k8smaster-k8s_dns_done virsh snapshot-create-as gongdear-kubernetes-node1 k8snode1-k8s_dns_done virsh snapshot-create-as gongdear-kubernetes-node2 k8snode2-k8s_dns_done virsh snapshot-create-as gongdear-kubernetes-node3 k8snode3-k8s_dns_done virsh snapshot-create-as gongdear-kvmmain kvmmain_jenkins_docker_done 在master节点上创建如下配置文件 default-backend.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: default-http-ba....

Kubernetes安装kube-dns服务发现 有更新!

在各个node节点上 vim /etc/kubernetes/kubelet 添加如下配置 其他配置为自动生成的建议不要修改 KUBELET_ARGS=“–cluster-dns=10.254.10.2 –cluster-domain=sky –allow-privileged=true” master上 etcdctl mk /skydns/config ‘{“dns-addr”:“10.254.10.2:53”,“ttl”:3600,“domain”:“sky.”}’ 编辑skydns_dpm.yaml 文件 apiVersion: extensions/v1beta1 kind: Deployment metadata: name: kube-dns namespace: kube-system spec: replicas: 1 template: metadata: labels: name: kube-dns tier: platform subsystem: unconfirmed k8s-app: kube-dns version: v9 partition: “no”....

Kubernetes新建命名空间

development: apiVersion: v1 kind: Namespace metadata: name: development labels: name: development product: apiVersion: v1 kind: Namespace metadata: name: product labels: name: product 执行 kubectl create -f development.yaml kubectl create -f product.yaml

Kubernetes搭建Dashboard成功后访问报错 dial tcp 172.17.26.2:9090: getsockopt: connection refused

排查方法: 1、需要检查apiserver的地址设置的是否正确(重启apiserver和kubenets),然后就是flannel是否配置启动 2、配置Kubernetes网络,在master和nodes上都需要安装flannel 检查master和node上配置文件是否一致。 3、node节点上的FORWARD 查看转发是否是drop vim /usr/lib/sysctl.d/50-default.conf文件 添加 net.ipv4.ip_forward = 1 重启node节点后就可以正常访问了

基于Centos7.4的Kubernetes安装实录

四台kvm虚拟机 192.168.1.120 master 192.168.1.121 node1 192.168.1.122 node2 192.168.1.123 node3 •先决条件 如下操作在所有机器执行 1.确保系统已经安装epel-release源 yum -y install epel-release 2.关闭防火墙服务和selinx,避免与docker容器的防火墙规则冲突。 systemctl stop firewalld systemctl disable firewalld setenforce 0 •安装配置Kubernetes Master 如下操作在master上执行 1.使用yum安装etcd和kubernetes-master yum -y install etcd kubernetes-master 2.编辑/etc/etcd/etcd.conf文件 ETCD_NAME=default ETCD_DATA_DIR=“/var/lib/etcd/default.etcd” ETCD_LISTEN_CLIENT_URLS=“http://0.0.0.0:2....

k8s创建redis集群

创建redis-master Pod和服务 先定义RC来创建pod,然后定义与之关联的service。 为redis-master服务新建一个名为redis-master-controller.yaml的RC定义文件,内容为: apiVersion: v1 kind: ReplicationController metadata: name: redis-master labels: name: redis-master spec: replicas: 1 selector: name: redis-master template: metadata: labels: name: redis-master spec: containers: - name: master image: kubeguide/redis-master ports: - containerPort: 6379 新建好文件之后执行如下命令: kubectl create -f redis-master-controller.yaml 删除:将create换为delete即可。 查看刚刚新建的redis-mas....

k8s踩坑实录(1)--pod一直是ContainerCreating

通过kubectl describe命令查看具体信息(或查看日志/var/log/message) [root@MyCentos7 k8s]# kubectl describe pod kubernetes-dashboard-2094756401-kzhnx –namespace=kube-system Name: kubernetes-dashboard-2094756401-kzhnx Namespace: kube-system Node: mycentos7-1/192.168.126.131 Start Time: Tue, 05 Jun 2018 19:28:25 +0800 Labels: app=kubernetes-dashboard pod-template-hash=2094756401 Status: Pending IP: Controllers: ReplicaSet/kubernetes-dashboard-2094756401 Containers: kubernetes-dashboard: Container ID: Image: daocloud....