32/64/1600

基础操作系统镜像

Linux OS Initial

  • timezone
date -s "20730503 19:30:00"
hwclock -w
  • sysctl
cat <<EOF | sudo tee /etc/sysctl.d/custom.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
EOF
  • ulimit
cat <<EOF |tee /etc/security/limits.d/custom.conf
*        soft    noproc 10240
*        hard    noproc 10240
*        soft    nofile 10240
*        hard    nofile 10240
EOF
  • modules probe
#!/bin/bash

mods_probe_conf="/etc/modules-load.d/k8s.conf"

ipvs_mods_dir="/usr/lib/modules/$(uname -r)/kernel/net/netfilter/ipvs"
for mod in $(ls $ipvs_mods_dir |grep -o "^[^.]*");do
    /sbin/modinfo -F filename $mod &>/dev/null
    if [ $? -eq 0 ];then
        /sbin/modprobe $mod
        lsmod | grep $mod
        if ! grep -w $mod $mods_probe_conf > /dev/null 2>&1;then
            echo $mod >> $mods_probe_conf
        fi
    fi
done

other_mods_list=("overlay" "br_netfilter")
for other_mod in ${other_mods_list[@]};do
    /sbin/modprobe $other_mod
    lsmod | grep $other_mod
    if ! grep -w $mod $mods_probe_conf > /dev/null 2>&1;then
        echo $mod >> $mods_probe_conf
    fi
done
  • apparmor

  • ufw

  • system packages

    • mtr
    • curl
    • file
    • bash-completion
    • net-tools
    • inetutils-ping
    • netcat
    • unzip
    • python3-pip
    • python3-venv
    • lsof
    • ipvsadm
    • btop
  • docker env

    • docker
    • containerd
  • node env

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 
nvm install --lts 
  • golang env
  • python env
cd /opt/python
python3 -m venv default-env

mkdir -p miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3/miniconda.sh
bash miniconda3/miniconda.sh -b -u -p miniconda3
rm -rf ~/miniconda3/miniconda.sh

./miniconda3/bin/conda init bash
conda config --set auto_activate_base false
  • java env
  • promethues exporters
    • node-exporter

    • blackbox exporter

    • process-exporter

    • systemd exporter

    • netdata

    • cadvisor

    • pushgateway

    • filebeat exporter

    • filebeat