当前位置:网站首页>Building a cloud-native DevOps environment
Building a cloud-native DevOps environment
2022-08-01 23:21: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目录下的jarsmall to mediumlinux系统里
COPY target/*jar /app.jar
#应用启动命令
ENTRYPOINT ["java","-jar","/app.jar"]

Kubernetes集群搭建
- All machine networks in the cluster can connect to each other
- All node hostnames cannot be duplicated
- 禁用交换分区
#各个机器设置自己的域名
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
边栏推荐
猜你喜欢

CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架

y84. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (15)

Access the selected node in the console

测试岗月薪5-9k,如何实现涨薪到25k?

【C语言进阶】文件操作(二)

程序员如何优雅地解决线上问题?

From 0 to 100: Notes on the Development of Enrollment Registration Mini Programs

解决端口占用

美赞臣EDI 940仓库装运订单详解

TCP 可靠吗?为什么?
随机推荐
【好书推荐】第一本无人驾驶技术书
Check if point is inside rectangle
TCP 可靠吗?为什么?
毕业作业
excel change cell size
程序员如何优雅地解决线上问题?
软技能之UML图
Solve the port to take up
B. Difference Array--Codeforces Round #808 (Div. 1)
计算由两点定义的线的角度
6132. All the elements in the array is equal to zero - quick sort method
When using DocumentFragments add a large number of elements
excel vertical to horizontal
【C语言进阶】文件操作(二)
论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》
浅析多服务在分布式系统下多事务通信处理机制方案
chrome copies the base64 data of an image
Additional Features for Scripting
基于JAX的激活函数、softmax函数和交叉熵函数
Making a Simple 3D Renderer