离线安装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="查看 [阅读全文]

微服务部署-k8s-yaml

[TOC] 增加了hostalias、configmap、java启动参数等等,优先级高于Dockerfile --- apiVersion: v1 data: common: |- server: tomcat: uri-encoding: UTF-8 accesslog: enabled: true directory: /logs pattern: '%h %l %u %t [阅读全文]

在K8S上安装nacos

[TOC] 下载 git clone https://github.com/nacos-group/nacos-k8s.git 安装nfs yum -y install nfs-utils rpcbind systemctl enable rpcbind nfs-server nfs-lock nfs-idmap echo "/data/nfs-share *(rw,no_root_squash,sync)" >> /etc/exports echo "/data/mysql *(rw,no_root_squash,sync)" >> /etc/exports systemctl start rpcbind nfs-server nfs-lock nfs-idmap #在其他节点安装nfs客户端 yum install nfs-utils -y 安装nacos kubectl --kubeconfig=/root/kubeconf-dl-xk label node xkdlk8s02 app=nfs-client-provisioner kubectl [阅读全文]

yum安装kubectl

yum安装kubectl

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

yum install -y kubectl

安装docker脚本

Dabin10 proxmox安装指定版本docker 指定版本 export docker_version=18.09.9; apt-get remove docker docker-engine docker.io containerd runc -y; apt-get -y install apt-transport-https ca-certificates curl software-properties-common bash-completion gnupg-agent; curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | apt-key add - add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable" apt-get update apt-cache madison docker-ce install_version=$( apt-cache madison docker-ce | grep ${docker_version} | [阅读全文]

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 #定 [阅读全文]