离线安装k8s\docker微服务环境

初始化系统(脚本) 安装docker 准备好安装包: 1.下载二进制安装包 wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz 2.解压并安装 tar zxvf docker-18.06.3-ce.tgz cp docker/* /usr/bin/ ### 注册为服务 [root@xkdl<a href="http://yw8.tech/tag/k8s/" title="查看 [阅读全文]

安装docker脚本

[root@localhost ~]# cat dockerinstall.sh yum install ca-certificates ; update-ca-trust; cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-bak cat << 'EOF' > /etc/yum.repos.d/CentOS-Base.repo # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # [阅读全文]

DOCKER学习

一、宿主机操作系统安装Ubuntu16.04 Centos 7.4 (需调驱动) 升级内核到4.4可选 rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm ;yum --enablerepo=elrepo-kernel install kernel-lt-devel kernel-lt -y #查看默认启动顺序 awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg CentOS Linux (4.4.4-1.el7.elrepo.x86_64) 7 (Core) [阅读全文]

Dockerfile实现修改docker容器hosts文件内容的方法

http://blog.realjf.com/archives/62 root@ycyl01:~/xkmicroservice/tm-registry# cat Dockerfile #pull down OS image FROM harbor.xikang.com/microservice/openjre8-base:v3 #copy src into image ADD ./tm-registry/ /opt/tm-registry ADD ./myhosts /opt/tm-registry/ WORKDIR /opt/tm-registry/ ENTRYPOINT ["./start.sh"] root@ycyl01:~/xkmicroservice/tm-registry# cat tm-registry/start.sh #!/bin/bash hostname=`hostname` cat myhosts >> /etc/hosts nohup java -jar xk-cloud-tm-registry-1.0-SNAPSHOT.jar --spring.profiles.active=prod > /opt/logs/$hostname.log 2>&1 & tail -f /opt/logs/$hostname.log root@ycyl01:~/xkmicroservice/tm-registry# cat tm-registry.yaml --- kind: Deployment apiVersion: extensions/v1beta1 metadata: name: tm-registry spec: replicas: 2 template: metadata: labels: name: tm-registry spec: containers: - name: tm-registry image: [阅读全文]

Kubernetes 使用 Weave Scope 监控集群

安装: kubectl apply -f "https://cloud.weave.works/<a href="http://yw8.tech/tag/k8s/" title="查看与 k8s 相关的文章" target="_blank">k8s</a>/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '\n')&k8s-service-type=NodePort" 查看暴露的web端口 kubectl --kubeconfig=/root/kubeconf-dl-xk get pod -n weave kubectl --kubeconfig=/root/kubeconf-dl-xk get svc -n weave kubectl --kubeconfig=/root/kubeconf-dl-xk get deploy -n weave 主 [阅读全文]

centos的基础镜像

在198上,解决中文乱码和程序时区的问题 root@rancher01:~/centos7<a href="http://yw8.tech/tag/docker/" title="查看与 docker 相关的文章" target="_blank">docker</a># cat Dockerfile # Docker file for date and locale set # VERSION 0.0.3 #基础镜像 FROM centos:7 #定 [阅读全文]

docker磁盘空间清理

清理日志脚本 #!/bin/sh echo “==================== start clean docker containers logs ==========================” logs=$(find /var/lib/docker/containers/ -name *-json.log) for log in $logs do echo “clean logs : $log” cat /dev/null > $log done echo “==================== end clean docker containers logs ==========================” 我们在使用docker的过程中发现基于swarm使用St [阅读全文]

fs服务的手工部署脚本\日志切割

#!/bin/bash current_date=`date -d "0 day" "+%Y%m%d"` #列出时间 echo $current_date docker build -t harbor.xikang.com/ycyltest/tm-fs:$current_date -- rm=true .sleep 10 docker push harbor.xikang.com/ycyltest/tm-fs:$current_date sed -i "s/image.*tm-fs.*/image: harbor.xikang.com\/ycyltest\/tm- fs:$current_date/g" /root/xkmicroservice/tm-fs/tm-fs.yamlkubectl apply -f /root/xkmicroservice/tm-fs/tm-fs.yaml 日志切割脚本 #!/bin/bash # this_path=$(cd `dirname $0`;pwd) #根据脚本所在路径 cd $this_path echo $this_path current_date=`date -d "-1 day" "+%Y%m%d"` #列出时间 echo $current_date split [阅读全文]

harbor镜像仓库

容器技术和镜像仓库介绍 2.选型原因 3.部署 4.高可用部署 目录 harbor镜像仓库搭建 容器技术和镜像仓库介绍 内核容器技术以一种完整形态最早出现 [阅读全文]