Last active
May 12, 2021 03:38
-
-
Save leganck/3f15dbd5669f692d62bfb1d8084a445b to your computer and use it in GitHub Desktop.
wsl2_config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# windows 主机ip设置 | |
export HOSTIP=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }') | |
# xserver 设置 | |
export DISPLAY=$HOSTIP:0 | |
export LIBGL_ALWAYS_INDIRECT=1 | |
#自动挂载cgroup | |
if [ ! -d /sys/fs/cgroup/systemd ]; then | |
sudo mkdir /sys/fs/cgroup/systemd | |
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd | |
fi | |
# 启动docker | |
docker_status=$(service docker status) | |
if [[ $docker_status = *"is not running"* ]]; then | |
sudo service docker start | |
fi | |
# 启动dbus | |
dbus_status=$(service dbus status) | |
if [[ $docker_status = *"is not running"* ]]; then | |
sudo service dbus start | |
fi | |
#设置completion | |
source <(kubectl completion bash) | |
source <(kind completion bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 设置docker services启动文件允许远程访问docker 文件路径 /lib/systemd/system/docker.service | |
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
networking: | |
apiServerAddress: "0.0.0.0" | |
apiServerPort: 6443 | |
disableDefaultCNI: true | |
nodes: | |
- role: control-plane | |
kubeadmConfigPatches: | |
- | | |
kind: InitConfiguration | |
nodeRegistration: | |
kubeletExtraArgs: | |
node-labels: "ingress-ready=true" | |
extraPortMappings: | |
- containerPort: 80 | |
hostPort: 10080 | |
protocol: TCP | |
- containerPort: 10443 | |
hostPort: 443 | |
protocol: TCP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment