Kubespray v2.22.1 在线部署 kubernetes v1.26.5 集群

news2024/12/24 20:24:03

在这里插入图片描述

文章目录

    • 1. 介绍
    • 2. 预备条件
    • 3. 配置 hostname
    • 4. yum
    • 5. 下载介质
      • 5.1 git 下载
      • 5.2 下载 kubespray v2.22.1
    • 6. 编写 inventory.ini
    • 7. 配置互信
    • 8. 安装 ansible
    • 9. 关闭防火墙
    • 10. 安装 docker
    • 11. 配置内核参数
    • 12. 启动容器 kubespray
    • 13. 部署
    • 14. 配置连接集群

1. 介绍

kubespray​ 是 Kubernetes incubator 中的项目,目标是提供 Production Ready Kubernetes 部署方案,该项目基础是通过 Ansible Playbook 来定义系统与 Kubernetes 集群部署的任务,具有以下几个特点:
可以部署在 AWS, GCE, Azure, OpenStack 以及裸机上.
部署 High Available Kubernetes 集群.
可组合性 (Composable),可自行选择 Network Plugin (flannel, calico, canal, weave) 来部署.
支持多种 Linux distributions(CoreOS, Debian Jessie, Ubuntu 16.04, CentOS/RHEL7).
本篇将说明如何通过 Kubespray 部署 Kubernetes 至裸机节点,安装版本如下所示:

  • kubespray v2.22.1
  • Kubernetes v1.26.5
  • Etcd 3.5.6
  • calico v3.25.1
  • containerd v1.7.1

2. 预备条件

通过 vSphere client 创建虚拟机,vSphere client 如何创建虚拟机请看这里。

需求:

系统: Rocky Linux 8.7

CPU: 4

MEM: 8G

DISK1: 30G
DISK2: 50G

配置地址与主机名分别为:

192.168.10.40  bastion01
192.168.10.41  kube-master01
192.168.10.42  kube-master02
192.168.10.43  kube-master03
192.168.10.44  kube-node01
192.168.10.45  kube-node02
192.168.10.46  kube-node03
192.168.10.47  kube-node04

注意:以下操作内容均为:192.168.10.40(bastion01) 节点

3. 配置 hostname

192.168.10.40:
hostnamctl set-hostname bastion01
192.168.10.41:
hostnamctl set-hostname kube-master01
192.168.10.42:
hostnamctl set-hostname kube-master02
192.168.10.43:
hostnamctl set-hostname kube-master03
192.168.10.44:
hostnamctl set-hostname kube-node01
192.168.10.45:
hostnamctl set-hostname kube-node02
192.168.10.46:
hostnamctl set-hostname kube-node03
192.168.10.47:
hostnamctl set-hostname kube-node04

4. yum

(bastion01操作)

yum -y update
yum -y install wget vim socat wget bash-completion net-tools zip bzip2 bind-utils

5. 下载介质

(bastion01操作)

5.1 git 下载

默认最快安装

dnf -y install git

或者 编译安装 git

  • git 安装

5.2 下载 kubespray v2.22.1

git clone -b v2.22.1 https://github.com/kubernetes-sigs/kubespray.git

或者
从 https://github.com/kubernetes-sigs/kubespray/releases 指定版本下载

wget https://github.com/kubernetes-sigs/kubespray/archive/refs/tags/v2.22.1.zip
unzip v2.22.1.zip
cd kubespray-v2.22.1

6. 编写 inventory.ini

(bastion01操作)

$ vim inventory/sample/inventory.ini
[all]
kube-master01 ansible_host=192.168.10.41 
kube-master02 ansible_host=192.168.10.42
kube-master03 ansible_host=192.168.10.43 
kube-node01 ansible_host=192.168.10.44
kube-node02 ansible_host=192.168.10.45
kube-node03 ansible_host=192.168.10.46
kube-node04 ansible_host=192.168.10.47

[bastion]
bastion ansible_host=192.168.10.40 ansible_user=root

[kube_control_plane]
kube-master01
kube-master02
kube-master03

[etcd]
kube-master01
kube-master02
kube-master03

[kube_node]
kube-node01
kube-node02
kube-node03
kube-node04

[calico_rr]

[k8s_cluster:children]
kube_control_plane
kube_node
calico_rr

7. 配置互信

(bastion01操作)

ssh-keygen
for i in `cat inventory/sample/inventory.ini |grep host| awk '{print $2}' | awk -F '=' '{print $2}'`;do ssh-copy-id root@$i;done

8. 安装 ansible

(bastion01操作)

sudo dnf update
sudo dnf -y install epel-release
sudo dnf -y install ansible

9. 关闭防火墙

(bastion01操作)

ansible all -i inventory/sample/inventory.ini -s -m ping
ansible all -i inventory/sample/inventory.ini -s -m systemd -a "name=firewalld state=stopped enabled=no"

10. 安装 docker

(bastion01操作)

sudo dnf check-update
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf -y install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl status docker
sudo systemctl enable docker

docker pull quay.io/kubespray/kubespray:v2.22.1

11. 配置内核参数

(bastion01操作)

modprobe bridge
modprobe br_netfilter
cat <<EOF>> /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sysctl -p /etc/sysctl.conf

12. 启动容器 kubespray

(bastion01操作)

docker run --rm -it --net=host --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory \
  --mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa \
  quay.io/kubespray/kubespray:v2.22.1 bash

查看默认的集群配置

root@38261b1472a7:/kubespray# cat /inventory/group_vars/k8s_cluster/k8s-cluster.yml |grep -v "#" |grep -v "^$"
---
kube_config_dir: /etc/kubernetes
kube_script_dir: "{{ bin_dir }}/kubernetes-scripts"
kube_manifest_dir: "{{ kube_config_dir }}/manifests"
kube_cert_dir: "{{ kube_config_dir }}/ssl"
kube_token_dir: "{{ kube_config_dir }}/tokens"
kube_api_anonymous_auth: true
kube_version: v1.26.5
local_release_dir: "/tmp/releases"
retry_stagger: 5
kube_owner: kube
kube_cert_group: kube-cert
kube_log_level: 2
credentials_dir: "{{ inventory_dir }}/credentials"
kube_network_plugin: calico
kube_network_plugin_multus: false
kube_service_addresses: 10.233.0.0/18
kube_pods_subnet: 10.233.64.0/18
kube_network_node_prefix: 24
enable_dual_stack_networks: false
kube_service_addresses_ipv6: fd85:ee78:d8a6:8607::1000/116
kube_pods_subnet_ipv6: fd85:ee78:d8a6:8607::1:0000/112
kube_network_node_prefix_ipv6: 120
kube_apiserver_ip: "{{ kube_service_addresses|ipaddr('net')|ipaddr(1)|ipaddr('address') }}"
kube_proxy_mode: ipvs
kube_proxy_strict_arp: false
kube_proxy_nodeport_addresses: >-
  {%- if kube_proxy_nodeport_addresses_cidr is defined -%}
  [{{ kube_proxy_nodeport_addresses_cidr }}]
  {%- else -%}
  []
  {%- endif -%}
kube_encrypt_secret_data: false
cluster_name: cluster.local
ndots: 2
dns_mode: coredns
enable_nodelocaldns: true
enable_nodelocaldns_secondary: false
nodelocaldns_ip: 169.254.25.10
nodelocaldns_health_port: 9254
nodelocaldns_second_health_port: 9256
nodelocaldns_bind_metrics_host_ip: false
nodelocaldns_secondary_skew_seconds: 5
enable_coredns_k8s_external: false
coredns_k8s_external_zone: k8s_external.local
enable_coredns_k8s_endpoint_pod_names: false
resolvconf_mode: host_resolvconf
deploy_netchecker: false
skydns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(3)|ipaddr('address') }}"
skydns_server_secondary: "{{ kube_service_addresses|ipaddr('net')|ipaddr(4)|ipaddr('address') }}"
dns_domain: "{{ cluster_name }}"
container_manager: containerd
kata_containers_enabled: false
kubeadm_certificate_key: "{{ lookup('password', credentials_dir + '/kubeadm_certificate_key.creds length=64 chars=hexdigits') | lower }}"
k8s_image_pull_policy: IfNotPresent
kubernetes_audit: false
default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
podsecuritypolicy_enabled: false
volume_cross_zone_attachment: false
persistent_volumes_enabled: false
event_ttl_duration: "1h0m0s"
auto_renew_certificates: false
kubeadm_patches:
  enabled: false
  source_dir: "{{ inventory_dir }}/patches"
  dest_dir: "{{ kube_config_dir }}/patches"

配置代理,否则 registry.k8s.io 镜像无法下载

$ cat /inventory/group_vars/all/all.yml 
...
http_proxy: "http://192.168.10.105:7890"
https_proxy: "http://192.168.10.105:7890"
no_proxy: "localhost,127.0.0.0/8,169.0.0.0/8,10.0.0.0/8,192.168.0.0/16,*.coding.net,*.tencentyun.com,*.myqcloud.com"
...

13. 部署

ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml

输出:

PLAY RECAP ***************************************************************************************************************************************************************************************
bastion01                  : ok=7    changed=1    unreachable=0    failed=0    skipped=13   rescued=0    ignored=0   
kube-master01              : ok=715  changed=66   unreachable=0    failed=0    skipped=1267 rescued=0    ignored=7   
kube-master02              : ok=618  changed=56   unreachable=0    failed=0    skipped=1107 rescued=0    ignored=2   
kube-master03              : ok=620  changed=57   unreachable=0    failed=0    skipped=1105 rescued=0    ignored=2   
kube-node01                : ok=496  changed=32   unreachable=0    failed=0    skipped=772  rescued=0    ignored=1   
kube-node02                : ok=496  changed=32   unreachable=0    failed=0    skipped=771  rescued=0    ignored=1   
kube-node03                : ok=496  changed=32   unreachable=0    failed=0    skipped=771  rescued=0    ignored=1   
kube-node04                : ok=496  changed=32   unreachable=0    failed=0    skipped=771  rescued=0    ignored=1   
localhost                  : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Sunday 16 July 2023  13:10:35 +0000 (0:00:00.475)       0:45:56.422 *********** 
=============================================================================== 
etcd : Gen_certs | Write etcd member/admin and kube_control_plane client certs to other etcd nodes --------------------------------------------------------------------------------------- 58.21s
kubernetes/control-plane : Joining control plane node to the cluster. -------------------------------------------------------------------------------------------------------------------- 45.75s
kubernetes-apps/ansible : Kubernetes Apps | Lay Down CoreDNS templates ------------------------------------------------------------------------------------------------------------------- 30.58s
kubernetes-apps/ansible : Kubernetes Apps | Start Resources ------------------------------------------------------------------------------------------------------------------------------ 30.37s
kubernetes/control-plane : kubeadm | Initialize first master ----------------------------------------------------------------------------------------------------------------------------- 23.72s
container-engine/containerd : containerd | Unpack containerd archive --------------------------------------------------------------------------------------------------------------------- 20.86s
kubernetes/preinstall : Ensure kube-bench parameters are set ----------------------------------------------------------------------------------------------------------------------------- 20.26s
container-engine/validate-container-engine : Populate service facts ---------------------------------------------------------------------------------------------------------------------- 20.00s
network_plugin/calico : Calico | Create calico manifests --------------------------------------------------------------------------------------------------------------------------------- 19.06s
container-engine/crictl : extract_file | Unpacking archive ------------------------------------------------------------------------------------------------------------------------------- 18.65s
network_plugin/cni : CNI | Copy cni plugins ---------------------------------------------------------------------------------------------------------------------------------------------- 17.99s
container-engine/crictl : download_file | Validate mirrors ------------------------------------------------------------------------------------------------------------------------------- 17.95s
container-engine/containerd : download_file | Validate mirrors --------------------------------------------------------------------------------------------------------------------------- 17.91s
container-engine/runc : download_file | Validate mirrors --------------------------------------------------------------------------------------------------------------------------------- 17.35s
kubernetes/kubeadm : Join to cluster ----------------------------------------------------------------------------------------------------------------------------------------------------- 16.92s
container-engine/containerd : containerd | Remove orphaned binary ------------------------------------------------------------------------------------------------------------------------ 16.90s
network_plugin/calico : Start Calico resources ------------------------------------------------------------------------------------------------------------------------------------------- 16.07s
container-engine/nerdctl : download_file | Validate mirrors ------------------------------------------------------------------------------------------------------------------------------ 16.03s
container-engine/nerdctl : extract_file | Unpacking archive ------------------------------------------------------------------------------------------------------------------------------ 15.75s
etcd : Gen_certs | Gather etcd member/admin and kube_control_plane client certs from first etcd node ------------------------------------------------------------------------------------- 15.07s

exit 退出部署容器

14. 配置连接集群

(bastion01操作)

安装 kubectl

dnf -y install golang
curl -LO https://dl.k8s.io/release/v1.26.5/bin/linux/amd64/kubectl
chmod 755 kubectl
mv kubectl /usr/local/bin

bastion01 配置 kubeconfig

mkdir /root/.kube

kube-master01 节点 /etc/kubernetes/admin.conf 拷贝至bastion01节点 /root/.kube/config
并修改https://127.0.0.1:6443https://192.168.10.41:6443

$ vim /root/.kube/config
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1EY3hOakV5TlRjeE1sb1hEVE16TURjeE16RXlOVGN4TWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTTBWCkhjRVVoT2twa0xyM3F5V3BrZnJyalpNQ1UwdGFPZi83VHYyMWduRFF6d2IzZnpiU1piTlhrc3A5YW9IbUtZKz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otLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://192.168.10.41:6443
  name: cluster.local
contexts:
- context:
    cluster: cluster.local
    user: kubernetes-admin
  name: kubernetes-admin@cluster.local
current-context: kubernetes-admin@cluster.local
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJYkwzWTJmaFBreUF3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TXpBM01UWXhNalUzTVRKYUZ3MHlOREEzTVRVeE1qVTNNVFphTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXZvbzVxd1ZvL1hxbnNrVWUKZlRObHl5TjRMdCtGV2c3VldZMTJJSEt2ZXVRa1JnRW1aNGF0eFMvQjJIdEIrczJqZmRPRlkrK1hxZmlZeTdJZApSN3JEdEgxV2pjSFBjeTZqWHVrVHdTT09HS2VnbzlsbkZCVm8xWmtFQk9icHlvM0Exdk1KaEFqek8zdk0zMXA3ClR2aFp3Q0dnYysvMEtqV204SnY5UVZyQ2t5U2l3aG9zTlNPcDRsRW5ieGcwd0xPY28xNTV0VEFjRXBWSE1MREgKdy9GSTRkVlBJYUZPSXpBazhIdldHdmhMWTMyN3lvOUtKdG54cEZNV1NvNmtHQmJDaDJQRmRjbVU4UTNvaUI5MQpubjQ2eFFBL1JqWlNBNk1OM25lSStNa0FWcGJaMjFnRGVsMEhUWEw3Q0dYSEJqOW5TQjBRYVRRWVR2ckpBT1hQCjFlR3B1UUlEQVFBQm8xWXdWREFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbE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VErZEgvNituS0Q1WGhBb0dBSmJwNnFTYWUyK0JRWFo3dzhTaGoKTGZZbUZvMFRDK2IwQVI3R25uSW5nZDNJVGJiUnN3V1cyQlVVdVFXaVExN09GUDMydVZvTFQ5OFhsbGVlZk5RNQpjYlZYaEdFZ3ovUmZORTNMWGhSemNiMjNPM2hRb2pybU44K3pnZDYyWVRIVXdkME40OHpQaWg0Y3ROeUZyTTVXCmtManVLWWR3RTh4VnNvTmlsYkVlUHlrQ2dZRUFxOFQ1L0p0dVpGMm5WRUFUYm9yNGd5d3FzYzk2YnhnYS9kSDQKblVOazI0Zm90STRmcGtVWk1DL0gyZ0xISkhrQldtWS9CV2UyeVFFZDBtbkNkU1hlSlFyd2RiQUxTdnArQVhxcwplajRFWnh0cVF1WWRNcnU0N05wWTBsNU1rK3dFRmI3ZGVzN0hEUkxxZDZXaGJTSCtuQjQ1Q0hCajNIUXAzY3BhCnpTRjF3bUVDZ1lFQW8xMFBHWmREcTNCaHJodjd5NHhiUkJyQldCZTJqNGV2S3pRVUtYeHNmV3pjZ2g2ZGF5NE4KK2VqWFhHaEtaTWRoSzZ0VkVTcFpuRVFrU3VMRFJab2Rra1B6cjBEWDd1bE5iY2JqeXpRR1VWdDV2L0MreWlkYgplcDRzelNuWFVpUDZiaExpL3V0VlRZdXZVT3BXazRXRS80NitDWWJzck1mUWR6SFQ4eHNwaE1NPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

测试

[root@bastion01 ~]# kubectl get pod -A 
NAMESPACE     NAME                                      READY   STATUS    RESTARTS      AGE
kube-system   calico-kube-controllers-6dfcdfb99-lx6mt   1/1     Running   0             18m
kube-system   calico-node-2n7gm                         1/1     Running   0             20m
kube-system   calico-node-5774s                         1/1     Running   0             20m
kube-system   calico-node-bdr75                         1/1     Running   0             20m
kube-system   calico-node-gfw9h                         1/1     Running   0             20m
kube-system   calico-node-mx9wq                         1/1     Running   0             20m
kube-system   calico-node-q84fm                         1/1     Running   0             20m
kube-system   calico-node-xmn2q                         1/1     Running   0             20m
kube-system   coredns-645b46f4b6-6nr7r                  1/1     Running   0             17m
kube-system   coredns-645b46f4b6-qtdqc                  1/1     Running   0             17m
kube-system   dns-autoscaler-659b8c48cb-85rz5           1/1     Running   0             17m
kube-system   kube-apiserver-kube-master01              1/1     Running   1             25m
kube-system   kube-apiserver-kube-master02              1/1     Running   1             24m
kube-system   kube-apiserver-kube-master03              1/1     Running   1             23m
kube-system   kube-controller-manager-kube-master01     1/1     Running   2             25m
kube-system   kube-controller-manager-kube-master02     1/1     Running   3             24m
kube-system   kube-controller-manager-kube-master03     1/1     Running   3             24m
kube-system   kube-proxy-2b9n6                          1/1     Running   0             22m
kube-system   kube-proxy-5tdcr                          1/1     Running   0             22m
kube-system   kube-proxy-6mm8v                          1/1     Running   0             22m
kube-system   kube-proxy-8s982                          1/1     Running   0             22m
kube-system   kube-proxy-lfl5x                          1/1     Running   0             22m
kube-system   kube-proxy-pmn67                          1/1     Running   0             22m
kube-system   kube-proxy-v7gjq                          1/1     Running   0             22m
kube-system   kube-scheduler-kube-master01              1/1     Running   2 (12m ago)   25m
kube-system   kube-scheduler-kube-master02              1/1     Running   1             23m
kube-system   kube-scheduler-kube-master03              1/1     Running   1             24m
kube-system   nginx-proxy-kube-node01                   1/1     Running   0             21m
kube-system   nginx-proxy-kube-node02                   1/1     Running   0             21m
kube-system   nginx-proxy-kube-node03                   1/1     Running   0             22m
kube-system   nginx-proxy-kube-node04                   1/1     Running   0             22m
kube-system   nodelocaldns-4r9vj                        1/1     Running   0             17m
kube-system   nodelocaldns-gcfds                        1/1     Running   0             17m
kube-system   nodelocaldns-k5sgg                        1/1     Running   0             17m
kube-system   nodelocaldns-l2vxf                        1/1     Running   0             17m
kube-system   nodelocaldns-t2t89                        1/1     Running   0             17m
kube-system   nodelocaldns-x2fbm                        1/1     Running   0             17m
kube-system   nodelocaldns-zfl2s                        1/1     Running   0             17m

[root@bastion01 ~]# kubectl get node
NAME            STATUS   ROLES           AGE   VERSION
kube-master01   Ready    control-plane   26m   v1.26.5
kube-master02   Ready    control-plane   25m   v1.26.5
kube-master03   Ready    control-plane   25m   v1.26.5
kube-node01     Ready    <none>          23m   v1.26.5
kube-node02     Ready    <none>          23m   v1.26.5
kube-node03     Ready    <none>          23m   v1.26.5
kube-node04     Ready    <none>          23m   v1.26.5


[root@bastion01 ~]# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.5", GitCommit:"890a139214b4de1f01543d15003b5bda71aae9c7", GitTreeState:"clean", BuildDate:"2023-05-17T14:14:46Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.5", GitCommit:"890a139214b4de1f01543d15003b5bda71aae9c7", GitTreeState:"clean", BuildDate:"2023-05-17T14:08:49Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}
[root@bastion01 ~]# kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.26.5
Kustomize Version: v4.5.7
Server Version: v1.26.5

kube-master01

[root@kube-master01 ~]#  /usr/local/bin/etcd --version
etcd Version: 3.5.6
Git SHA: cecbe35ce
Go Version: go1.16.15
Go OS/Arch: linux/amd64

参考:

  • https://github.com/kubernetes-sigs/kubespray
  • https://kubespray.io/#/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/761180.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Ubuntu18.04 安装vscode 配置C#编译器

环境&#xff1a; ubuntu 18.04 依赖库&#xff1a; SDK .net-7 安装对象&#xff1a; vscode 在终端&#xff1a; ./dotnet-install.sh --channel 7.0 遇见如下提示&#xff1a; dotnet&#xff1a;未找到命令 如下操作&#xff1a; 下载–解压–安装 wget https://pa…

Python 自学 day04 函数为参数传递, 匿名函数, 文件操作

1. 函数作为参数传递 &#xff08;类似C 函数指针&#xff09; def func(x):mm x(1,2);#print(f"mm的值是{mm}")return mmdef add(x,y): #加法return xy def reduce(x,y): # 减法return x-ydef ride(x,y): # 乘法return x*ydef divide(x,y): #带有小数点除法…

详解DDPG算法:解决对大量的超参数、随机重启、任务环境敏感问题,完成月球着陆器,双足机器人demo、以及超参数调优教学

0.demo展示 当我复现强化学习算法 DDPG 时,我发现论文中缺少必要的实现细节,例如:Gamma、噪声方差、最大训练步数等参数的取值。此外,在我调整参数,成功完成某次训练后,当我对随机种子进行修改,发现训练时长有很大变化,甚至有时候无法完成训练。更别提把在某个任务上 w…

1、linux中安装tomcat

1、创建目录 cd /opt ls mkdir tomcat 2、将文件拖入tomcat目录中 3、解压安装包 cd /opt/tomcat ls tar -zxvf apache-tomcat-8.5.59.tar.gz 4、启动tomcat cd /opt/tomcat/apache-tomcat-8.5.59/bin ./startup.sh 5、在linux中访问 http://localhost:8080/ 6、开放端口 …

为什么选择孟德尔随机化来写文章

为什么选择孟德尔随机化来写文章

【日常BUG】批量插入数据时报错: There is no setter for proerty named uptByd‘ in ‘class ...

前提&#xff1a;定义了自动填充策略&#xff0c;使用mybatis-plus 配置了属性自动注入 实体类上也定义了需要自动填充的字段。 但是在使用批量插入数据时报错&#xff1a; There is no setter for proerty named uptByd’ in class …&#xff0c; 排查过后发现是实体类中没…

QT QTableView添加CheckBox

需求&#xff1a;QTableView中指定列所有Item均为CheckBox项&#xff0c;要求CheckBox居中显示 显示效果如下&#xff1a;三种表现效果 实现方式&#xff1a; 系统控件QCheckBox 自绘制CheckBox CheckBox的图片 实现代码&#xff1a;(原理&#xff1a;利用委托自绘的方式)…

FasterViT实战:使用FasterViT实现图像分类任务(一)

文章目录 摘要安装包安装timm安装 grad-cam 数据增强Cutout和MixupEMA项目结构计算mean和std生成数据集 摘要 论文翻译&#xff1a;https://blog.csdn.net/m0_47867638/article/details/131542132 官方源码&#xff1a;https://github.com/NVlabs/FasterViT 这是一篇来自英伟…

Flask_使用flask_marshmallow序列化数据

代码如下&#xff1a; from flask import Flask from flask_marshmallow import Marshmallow from flask_sqlalchemy import SQLAlchemy from marshmallow import fieldsapp Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] "mysqlpymysql://root:12…

JavaFx 用户界面控件2——ListView

1.列表显示ListView 下面是一个JavaFX ListView的示例代码和使用方法&#xff1a; public class ListViewExample extends Application {Overridepublic void start(Stage primaryStage) {// 创建一个可观察的列表&#xff0c;用于存储ListView中的数据ObservableList<Str…

【深度学习笔记】正则化与 Dropout

本专栏是网易云课堂人工智能课程《神经网络与深度学习》的学习笔记&#xff0c;视频由网易云课堂与 deeplearning.ai 联合出品&#xff0c;主讲人是吴恩达 Andrew Ng 教授。感兴趣的网友可以观看网易云课堂的视频进行深入学习&#xff0c;视频的链接如下&#xff1a; 神经网络和…

如何手动初始化项目目录结构,并在命令行用gradle编译运行项目

父目录 Android 开发入门 - wuyujin1997 文章目录 Intro纯手动手动创建项目目录结构源码gradle tasksgradle wrapper执行前&#xff1a;执行后&#xff1a;执行前后对比&#xff1a; gradle wrappergradlew 和 gradlew.batplugin java编译Java项目【重点】如何通过 gradle run …

【GAMES202】Real-Time Shadows1—实时阴影1

一、Shadow Mapping回顾 [计算机图形学]光线追踪前瞻&#xff1a;阴影图(前瞻预习/复习回顾)__Yhisken的博客-CSDN博客 关于Shadow Mapping我们在GAMES101中学过&#xff0c;如果不知道可以参考我的博客。 Shadow Mapping是光栅化时为了实现阴影的一种算法&#xff0c;而它实…

python将dataframe数据导入MySQL

文章目录 mysql操作pymysql操作导入数据并启动使用pandas导入MySQL数据库连接引擎使用to_sql方法pandas读取sqlread_sql_tableread_sql_query mysql操作 创建数据库test和table create database test;CREATE TABLE car (文章ID int, 链接 VARCHAR(255), 标题 VARCHAR(255),发…

ts中setState的类型

两种方法: 例子: 父组件 const [value, setValue] useState(); <ChildsetValue{setValue} />子组件 interface Ipros {setValue: (value: string) > void } const Child: React.FC<Ipros> (props) > {}

应用层协议设计及ProtoBuf

文章目录 一、协议概述二、消息的完整性三、协议设计3.1 协议设计实例IM即时通讯的协议设计nginx协议HTTP协议redis协议 3.2 序列化方法3.3 协议安全3.4 协议压缩3.5 协议升级 四、Protobuf4.1 安装编译4.2 工作流程4.3 标量数值类型4.4 编码原理4.4.1 Varints 编码4.4.2 Zigza…

soci源码解析

结构 use_type into_type statement backend 针对不同数据库后端的抽象 session

vue对象复制(使用es6对象扩展运算符,深拷贝)

vue3es6语法 直接上代码 const objA { name: 小飞, age: 18 };const objACopy { ...objA };console.log(对比objA与objACopy的引用地址是否相同);console.log(objA objACopy); //falseconsole.log(objA);console.log(objACopy);//对象包含对象&#xff0c;浅拷贝const objB …

pytorch cv自带预训练模型再微调

参考&#xff1a; https://pytorch.org/docs/0.4.1/torchvision/models.html https://zhuanlan.zhihu.com/p/436574436 https://blog.csdn.net/u014297502/article/details/125884141 Network Top-1 error Top-5 error AlexNet 43.45 20.91 VGG-11 30.98 11.37 VGG-13 30.07 …

动态规划完全背包之518零钱兑换 II

题目&#xff1a; 给你一个整数数组 coins 表示不同面额的硬币&#xff0c;另给一个整数 amount 表示总金额。 请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额&#xff0c;返回 0 。 假设每一种面额的硬币有无限个。 题目数据保证结果符合 …