#cloud-config
users:
- name: etcd
homedir: /var/etcd
lock_passwd: true
ssh_redirect_user: true
write_files:
# Setup containerd.
- path: /etc/systemd/system/containerd-installation.service
permissions: 0644
owner: root
content: |
# installed by cloud-init
[Unit]
Description=Download and install containerd binaries and configurations.
After=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /home/containerd
ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
ExecStartPre=/bin/mount -o remount,exec /home/containerd
ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
ExecStart=/home/containerd/configure.sh
[Install]
WantedBy=containerd.target
- path: /etc/systemd/system/containerd.service
permissions: 0644
owner: root
content: |
# installed by cloud-init
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=containerd-installation.service
[Service]
Restart=always
RestartSec=5
Delegate=yes
KillMode=process
OOMScoreAdjust=-999
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
ExecStartPre=/sbin/modprobe overlay
ExecStart=/home/containerd/usr/local/bin/containerd
[Install]
WantedBy=containerd.target
- path: /etc/systemd/system/containerd.target
permissions: 0644
owner: root
content: |
[Unit]
Description=Containerd
[Install]
WantedBy=kubernetes.target
# Setup kubernetes.
- path: /etc/systemd/system/kube-master-installation.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Download and install k8s binaries and configurations
After=network-online.target containerd.target
Wants=network-online.target containerd.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /home/kubernetes/bin
ExecStartPre=/bin/mount --bind /home/kubernetes/bin /home/kubernetes/bin
ExecStartPre=/bin/mount -o remount,exec /home/kubernetes/bin
ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/kubernetes/bin/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/configure-sh
ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure.sh
ExecStart=/home/kubernetes/bin/configure.sh
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kube-master-configuration.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Configure kubernetes master
After=kube-master-installation.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure-helper.sh
ExecStart=/home/kubernetes/bin/configure-helper.sh
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kube-container-runtime-monitor.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Kubernetes health monitoring for container runtime
After=kube-master-configuration.service
[Service]
Restart=always
RestartSec=10
RemainAfterExit=yes
RemainAfterExit=yes
ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
ExecStart=/home/kubernetes/bin/health-monitor.sh container-runtime
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kubelet-monitor.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Kubernetes health monitoring for kubelet
After=kube-master-configuration.service
[Service]
Restart=always
RestartSec=10
RemainAfterExit=yes
ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
ExecStart=/home/kubernetes/bin/health-monitor.sh kubelet
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kube-logrotate.timer
permissions: 0644
owner: root
content: |
[Unit]
Description=Hourly kube-logrotate invocation
[Timer]
OnCalendar=hourly
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kube-logrotate.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Kubernetes log rotation
After=kube-master-configuration.service
[Service]
Type=oneshot
ExecStart=-/usr/sbin/logrotate /etc/logrotate.conf
[Install]
WantedBy=kubernetes.target
- path: /etc/systemd/system/kubernetes.target
permissions: 0644
owner: root
content: |
[Unit]
Description=Kubernetes
[Install]
WantedBy=multi-user.target
runcmd:
# Stop the existing containerd service if there is one. (for Docker 18.09+)
- systemctl is-active containerd && systemctl stop containerd
- systemctl daemon-reload
- systemctl enable containerd-installation.service
- systemctl enable containerd.service
- systemctl enable containerd.target
- systemctl enable kube-master-installation.service
- systemctl enable kube-master-configuration.service
- systemctl enable kubelet-monitor.service
- systemctl enable kube-container-runtime-monitor.service
- systemctl enable kube-logrotate.timer
- systemctl enable kube-logrotate.service
- systemctl enable kubernetes.target
- systemctl start kubernetes.target
# Start docker after containerd is running. (for Docker 18.09+)
- systemctl is-enabled docker && (systemctl is-active docker || systemctl start docker)

fittec_vb
- 粉丝: 7
最新资源
- (源码)基于React框架的Cosmjs前端交互项目.zip
- (源码)基于React框架的博客管理系统.zip
- (源码)基于PIC微控制器的温湿度数字指示器设计.zip
- 修改谷歌提供的样例量子卷积神经网络模型,基于KDD99数据集进行训练,实现了网络攻击分类检测
- (源码)基于Spring Boot和Vue的在线性能压测系统.zip
- 基于 ResNet 与 DenseNet 的 38 类植物病害识别及简易 UI 界面构建
- (源码)基于Python的房价预测系统.zip
- (源码)基于C语言的Tiny C编译器.zip
- 基于 JAVA GUI 的神经网络手写数字识别与目标定位(含 CNN 卷积神经网络)
- (源码)基于Spring Boot和Vue的图书管理系统.zip
- 物理中的几何方法:前沿研究与应用
- (源码)基于AtTiny2313和ESP8266的齿轮时钟系统.zip
- (源码)基于Qt框架的在线小精灵对战系统.zip
- (源码)基于C语言的Linux终端MP3播放器.zip
- 神经网络,手写识别,数字识别,repositories内有CNN卷积神经网络和目标识别(目标i定位),全基于JAVA GUI
- 《神经网络与深度学习学习笔记汇总》
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



评论0