k8s on windows 10

1. install the docker desktop
2. open docker desktop, on setting page, click the kubernets, enable kubernets.
3. all certificate are store at C:\Users\username\AppData\Local\Docker\pki
4. hyper-v disk store at C:\Users\seplinus\AppData\Local\Docker\wsl\disk\docker_data.vhdx
5. logs file at C:\ProgramData\DockerDesktop\
6. install folder at C:\Program Files\Docker\Docker
7. iso file at C:\Program Files\Docker\Docker\resources\docker-desktop.iso
8. WSL2 use itself ext4 filesystem(stored in .vhdx), this bring high I/O performance.
through 9P protocol server,Windows access WSL2 file(\\wsl$\),but WSL2 access Windows file(/mnt/c/)performance will be lower. from Windows get WSL file(\\wsl$), reverse at WSL2 access Windows file (/mnt/c/).

group policy remove software installation met error event 108

1. remove the register value
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Appmgmt\{2c0cf1fc-3ec1-4c9c-87ec-7eee5bea3503}

2. delete the sysvol share related .aas file
\\lookdata.cn\SYSVOL\lookdata.cn\Policies\{EBB86C99-BC22-4FFF-8EF2-6AA3FBC01977}\Machine\Applications

terraform alicloud import security group rule

ecs

%appdata%\terraform.rc
provider_installation {
filesystem_mirror {
path = “C:/Users/Linus/tf/mirror”
}
}

main.cf
provider “alicloud” {
access_key = “xxxxxxxxxxxxxxxx”
secret_key = “xxxxxxxxxxxxxxxx”
region = “cn-beijing”
}

resource “alicloud_vpc” “testvpc” {
vpc_name = “testvpc”
cidr_block = “192.168.0.0/16”
}

resource “alicloud_vswitch” “vswitch” {
vpc_id = alicloud_vpc.testvpc.id
cidr_block = “192.168.100.0/24”
zone_id = “cn-beijing-d”
}

resource “alicloud_security_group” “testgroup” {
name = “sg-test”
description = “test security group”
vpc_id = “${alicloud_vpc.testvpc.id}”
}

resource “alicloud_security_group_rule” “allow_22” {
type = “ingress”
ip_protocol = “tcp”
nic_type = “intranet”
policy = “accept”
port_range = “22/22”
priority = 1
security_group_id = “${alicloud_security_group.testgroup.id}”
cidr_ip = “10.56.8.13/32”
}

resource “alicloud_instance” “test” {
description = “test”
host_name = “test”
image_id = “ubuntu_20_04_x64_20G_alibase_20220727.vhd”
instance_name = “test”
instance_charge_type = “PostPaid”
security_groups = alicloud_security_group.testgroup.*.id
instance_type = “ecs.xn4.small”
vswitch_id = alicloud_vswitch.vswitch.id
internet_charge_type = “PayByBandwidth”
internet_max_bandwidth_out = 1
}

terraform init
terraform show
terraform plan
terraform state pull
terraform import alicloud_security_group_rule.allow_22 sg-2zefwtrsg4df3r4cy80:ingress:tcp:22/22:intranet:x.x.x.x/32:accept:2

rsync over nfs

rsync -aP source/ target/

if you meet some performance issue during ext4 to nfs mounted to local filesystem, try below command replace rsync
1. ssh-copy-id user@x.x.x.x
2. find folder/ -mindepth 1 -maxdepth 4 -type d -exec bash -c ‘tar cz {} | ssh user@x.x.x.x tar -xzf – -C backup’ \;