当前位置:网站首页>云原生DevOps环境搭建
云原生DevOps环境搭建
2022-08-01 23:12:00 【YMY_666】
Docker安装
1.移除以前docker相关包
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-engine
2.配置yum源
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3.安装docker
sudo yum install -y docker-ce docker-ce-cli containerd.io
4.启动
systemctl enable docker --now
5.配置加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"], "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2" } EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Dockerfile构建Java应用镜像
FROM openjdk:8-jdk-slim
#作者
LABEL maintainer=xxx
#复制targer目录下的jar到容器中小型linux系统里
COPY target/*jar /app.jar
#应用启动命令
ENTRYPOINT ["java","-jar","/app.jar"]

Kubernetes集群搭建
- 集群中所有机器网络彼此能互相连接
- 所有节点主机名不能重复
- 禁用交换分区
#各个机器设置自己的域名
hostnamectl set-hostname xxxx
# 将 SELinux 设置为 permissive 模式(相当于将其禁用)
sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
#关闭swap
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
#允许 iptables 检查桥接流量
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf br_netfilter EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF
sudo sysctl --system
边栏推荐
- chrome复制一张图片的base64数据
- Graph Theory - Strongly Connected Component Condensation + Topological Sort
- 数据库表设计规则
- 【C补充】链表专题 - 单向链表
- vscode hide menu bar
- PDF转Word有那么难吗?做一个文件转换器,都解决了
- Additional Features for Scripting
- 论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》
- A. Doremy‘s IQ-- Codeforces Round #808 (Div. 1)
- Chapter 12 End-User Task As Shell Scripts
猜你喜欢
随机推荐
excel edit a cell without double clicking
【数据分析03】
The monthly salary of the test post is 5-9k, how to increase the salary to 25k?
excel edit a cell without double clicking
【C语言进阶】文件操作(二)
2022/7/31
PostgreSQL Basics--Common Commands
华为无线设备配置全局双链路冷备份(AC全局配置方式)
excel vertical to horizontal
perspectiveTransform warpPerspective getPerspectiveTransform findHomography
Avoid , ,
, and tagsIDEA common plugins
excel split text into different rows
CF1703G Good Key, Bad Key
SRv6 L3VPN的工作原理
excel clear format
xctf attack and defense world web master advanced area webshell
对于在新标签页中打开的链接,始终使用“noopener”或“noreferrer”
bat 之 特殊字符&转义
得物客服热线的演进之路









