- 浏览: 2542467 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Rancher and k8s 2019(1)Introduction and First Sample
Try on my CentOS
Installed Docker on the machine
> docker --version
Docker version 19.03.2, build 6a30dfc
Start the Rancker from Docker Image
> mkdir ~/tool/rancher-docker
> sudo ln -s /home/carl/tool/rancher-docker /opt/rancher-docker
> sudo ln -s /opt/rancher-docker /opt/rancher
Go to the working directory
> cd /opt/rancher
> mkdir /opt/rancher/rancher_home
Prepare a Makefile there
> cat Makefile
PORT=9090
SSL_PORT=9091
IMAGE=rancher/rancher
TAG=stable
NAME=rancher-$(PORT)
run:
docker run \
-d \
--restart=unless-stopped \
-p $(PORT):80 \
-p $(SSL_PORT):443 \
-v $(shell pwd)/rancher_home:/var/lib/rancher/ \
--name $(NAME) \
$(IMAGE):$(TAG)
clean:
docker stop ${NAME}
docker rm ${NAME}
Start to run that
> make run
Check the running status
> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c4c932adb121 rancher/rancher:stable "entrypoint.sh" 15 seconds ago Up 14 seconds 0.0.0.0:9090->80/tcp, 0.0.0.0:9091->443/tcp rancher-9090
Visit the HTTPS port, it will ask you to set up the password and etc.
https://centos-dev1:9091/
Create my Cluster
[Global] —> [Clusters] —> [Add Cluster] —> [From my Existing Nodes] my current demo testing
Cluster Name: dockerdemo
Next Button
Checkbox Worker
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --worker
Checkbox Worker/Control Plane
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --controlplane --worker
Checkbox ETCD/Control Plane/Worker
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --etcd --controlplane --worker
Run this command on my centos-dev1
> sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --etcd --controlplane --worker
Click on the cluster name dockerdemo, it will drive us to the cluster information page.
It shows to me the first cluster is there with only one node.
Go to cluster ‘dockerdemo’ —> [Default] —> [Workloads] —> [Deploy]
Name: nginxdemo
Docker Image: nginx:alpine
WorkloadType: 1 pod
Namespace: default
[Add Port]
80 —> TCP —> NodePort(On every node) 30000
[Launch] button
Visit page
http://centos-dev1:30000/
Stop the service and try others
> make clean
Try on my MAC
> docker --version
Docker version 19.03.2, build 6a30dfc
Do the similar thing on MAC
> make run PORT=80 SSL_PORT=443
References:
https://www.itfanr.cc/2019/08/31/lightweight-kubernetes-release-k3s-issues/
https://www.rancher.cn/rancher-k3s/
https://rancher.com/docs/rancher/v2.x/en/
https://rancher.com/docs/rancher/v2.x/en/installation/ha/
Rancher
https://tonybai.com/2016/04/14/an-introduction-about-rancher/
https://www2.cnrancher.com/rancherv2-0-quick-start-guide/
https://www.rancher.cn/docs/
https://www.rancher.cn/docs/rancher/v2.x/cn/overview/
https://www.cnblogs.com/horizonli/p/10572573.html
k8s
https://www.jianshu.com/p/6b8ee8a5010f
https://blog.csdn.net/CSDN_duomaomao/article/details/78029800
https://www.zhihu.com/question/309076492
Try on my CentOS
Installed Docker on the machine
> docker --version
Docker version 19.03.2, build 6a30dfc
Start the Rancker from Docker Image
> mkdir ~/tool/rancher-docker
> sudo ln -s /home/carl/tool/rancher-docker /opt/rancher-docker
> sudo ln -s /opt/rancher-docker /opt/rancher
Go to the working directory
> cd /opt/rancher
> mkdir /opt/rancher/rancher_home
Prepare a Makefile there
> cat Makefile
PORT=9090
SSL_PORT=9091
IMAGE=rancher/rancher
TAG=stable
NAME=rancher-$(PORT)
run:
docker run \
-d \
--restart=unless-stopped \
-p $(PORT):80 \
-p $(SSL_PORT):443 \
-v $(shell pwd)/rancher_home:/var/lib/rancher/ \
--name $(NAME) \
$(IMAGE):$(TAG)
clean:
docker stop ${NAME}
docker rm ${NAME}
Start to run that
> make run
Check the running status
> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c4c932adb121 rancher/rancher:stable "entrypoint.sh" 15 seconds ago Up 14 seconds 0.0.0.0:9090->80/tcp, 0.0.0.0:9091->443/tcp rancher-9090
Visit the HTTPS port, it will ask you to set up the password and etc.
https://centos-dev1:9091/
Create my Cluster
[Global] —> [Clusters] —> [Add Cluster] —> [From my Existing Nodes] my current demo testing
Cluster Name: dockerdemo
Next Button
Checkbox Worker
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --worker
Checkbox Worker/Control Plane
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --controlplane --worker
Checkbox ETCD/Control Plane/Worker
>sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --etcd --controlplane --worker
Run this command on my centos-dev1
> sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.8 --server https://centos-dev1:9091 --token fmnlt47dl5dp52ddj2hpxfqmkqd69wpm6gjlq9xnkr6bzdd26mmvd2 --ca-checksum 06c2f71d46eaea14f4a21eeb0ec59e73899b56fe5e27204c4357caa93ab0ba8e --etcd --controlplane --worker
Click on the cluster name dockerdemo, it will drive us to the cluster information page.
It shows to me the first cluster is there with only one node.
Go to cluster ‘dockerdemo’ —> [Default] —> [Workloads] —> [Deploy]
Name: nginxdemo
Docker Image: nginx:alpine
WorkloadType: 1 pod
Namespace: default
[Add Port]
80 —> TCP —> NodePort(On every node) 30000
[Launch] button
Visit page
http://centos-dev1:30000/
Stop the service and try others
> make clean
Try on my MAC
> docker --version
Docker version 19.03.2, build 6a30dfc
Do the similar thing on MAC
> make run PORT=80 SSL_PORT=443
References:
https://www.itfanr.cc/2019/08/31/lightweight-kubernetes-release-k3s-issues/
https://www.rancher.cn/rancher-k3s/
https://rancher.com/docs/rancher/v2.x/en/
https://rancher.com/docs/rancher/v2.x/en/installation/ha/
Rancher
https://tonybai.com/2016/04/14/an-introduction-about-rancher/
https://www2.cnrancher.com/rancherv2-0-quick-start-guide/
https://www.rancher.cn/docs/
https://www.rancher.cn/docs/rancher/v2.x/cn/overview/
https://www.cnblogs.com/horizonli/p/10572573.html
k8s
https://www.jianshu.com/p/6b8ee8a5010f
https://blog.csdn.net/CSDN_duomaomao/article/details/78029800
https://www.zhihu.com/question/309076492
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 468NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 362Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 364Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 330Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 424Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 366Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 445VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 377Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 468NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 414Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 332Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 243GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 445GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 321GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 307Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 286Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 303Serverless with NodeJS and Tenc ...
相关推荐
K8S Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:...
- 主机名:Rancher_K8s_node1,IP地址:192.168.1.16,操作系统:Ubuntu 16.04/内核4.4.0,角色:K8s-node - 主机名:Rancher_K8s_node2,IP地址:192.168.1.17,操作系统:Ubuntu 16.04/内核4.4.0,角色:K8s-...
K8S Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:...
Docker-Rancher-K8S教程
K8S Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:...
使用RKE构建企业生产Kubernetes集群 内容包含: 1.集群主机准备 2.daocker部署 3.docker compose安装 4.添加rancher用户 5.生成ssh证书用户部署集群 6.rke工具下载 7.初始化rke配置文件 ....
总结来说,容器持久化存储是解决容器化应用数据持久化的关键技术,Kubernetes作为云原生的操作系统,提供了强大的容器管理和编排能力,而Rancher则为企业级K8s部署提供了便利的管理平台。这三者共同推动了容器云技术...
自动安装Docker、rancher、k8s、mysql、redis、haproxy、mongodb、nginx、Node.js , mosquitto (MQTT
jenkins调用shell触发rancher命令通过yml方式部署微服务镜像
在本篇内容中,我们将详细讨论如何使用Rancher 2.2版本部署Kubernetes(k8s)集群,以及涉及的关键组件和操作步骤。Rancher是一个流行的开源平台,用于管理和部署容器化应用程序,而Kubernetes则是一个自动化容器...
k8s平台rancher V2.4.5 docker镜像包包含:rancher/prom-node-exporter v0.18.1、rancher/mirrored-flannelcni-flannel v0.16.1、registry.aliyuncs.com/google_containers/kube-proxy v1.17.0、rancher/mirrored-...
【Dapr学习(2)之Rancher2.63(k8s&k3s)环境安装Dapr】 在本文中,我们将深入探讨如何在Kubernetes(k8s)和k3s环境中,利用Rancher2.6.3管理工具安装Dapr。Dapr(Distributed Application Runtime)是一个...
1. **环境准备**:确保所有节点的操作系统、Docker和网络设置符合k8s的要求。 2. **二进制文件获取**:从官方仓库下载k8s的最新或特定版本二进制文件。 3. **配置文件编辑**:为每个组件创建配置文件,设定如证书、...
k8s部署rancher,rancher证书文件
k8s-dns-sidecar-amd64-1.14.8镜像,镜像使用方法: docker load -i k8s-dns-sidecar-amd64-1.14.8.tar.gz
kubernetes单节点Rancher安装部署手册 kubernetes是一个开源的容器编排系统,可以自动部署、扩展和管理容器化应用程序。Rancher是一个kubernetes-as-a-service解决方案,提供了图形化界面来部署和管理kubernetes...
k8s集群pod经常重启问题排查总结