generated from bing/readnotes
feat update sth.
This commit is contained in:
parent
e06605cbf2
commit
5b72b7944c
|
@ -15,3 +15,4 @@
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
|
|
||||||
|
.vscode
|
|
@ -36,7 +36,7 @@ controller-gen crd --paths=/git/demo/api/... output:dir=/git/demo/crd
|
||||||
安装
|
安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.2.0/kubebuilder_linux_amd64 -O ${HOME}/go/bin/kubebuilder
|
wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.4.1/kubebuilder_linux_amd64 -O ${HOME}/go/bin/kubebuilder
|
||||||
chmod +x ${HOME}/go/bin/kubebuilder
|
chmod +x ${HOME}/go/bin/kubebuilder
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -425,3 +425,9 @@ kubebuilder edit --multigroup
|
||||||
kubebuilder create api --group group1 --version ${CRD_VERSION} --kind Demo --crd-version ${CRD_VERSION} --controller --resource
|
kubebuilder create api --group group1 --version ${CRD_VERSION} --kind Demo --crd-version ${CRD_VERSION} --controller --resource
|
||||||
kubebuilder create api --group group2 --version ${CRD_VERSION} --kind Demo --crd-version ${CRD_VERSION} --controller --resource
|
kubebuilder create api --group group2 --version ${CRD_VERSION} --kind Demo --crd-version ${CRD_VERSION} --controller --resource
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 创建clientset
|
||||||
|
|
||||||
|
```bash
|
||||||
|
client-gen --clientset-name="slmclient" --input-dirs="./pkg/api/v1alpha1" -h hack/boilerplate.go.txt --output-package pkg/slmclient
|
||||||
|
```
|
|
@ -82,7 +82,7 @@ nmcli connection reload
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir /etc/cni/net.d -p
|
mkdir /etc/cni/net.d -p
|
||||||
cat <<EOF >/etc/cni/net.d/172-my.conf
|
cat <<EOF >/etc/cni/net.d/10-my.conf
|
||||||
{
|
{
|
||||||
"cniVersion": "0.2.0",
|
"cniVersion": "0.2.0",
|
||||||
"name": "mynet",
|
"name": "mynet",
|
||||||
|
@ -92,7 +92,7 @@ cat <<EOF >/etc/cni/net.d/172-my.conf
|
||||||
"ipMasq": true,
|
"ipMasq": true,
|
||||||
"ipam": {
|
"ipam": {
|
||||||
"type": "host-local",
|
"type": "host-local",
|
||||||
"subnet": "172.17.0.0/16",
|
"subnet": "10.0.1.0/16",
|
||||||
"routes": [
|
"routes": [
|
||||||
{ "dst": "0.0.0.0/0" }
|
{ "dst": "0.0.0.0/0" }
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,17 +4,48 @@
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# 配置kubelet使用systemd作为cgroups驱动
|
# 配置kubelet使用systemd作为cgroups驱动
|
||||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
apiVersion: kubeadm.k8s.io/v1beta3
|
||||||
kind: KubeletConfiguration
|
bootstrapTokens:
|
||||||
cgroupDriver: systemd
|
- groups:
|
||||||
|
- system:bootstrappers:kubeadm:default-node-token
|
||||||
|
token: lzt4rs.qj01ga221rmws3ip
|
||||||
|
ttl: 24h0m0s
|
||||||
|
usages:
|
||||||
|
- signing
|
||||||
|
- authentication
|
||||||
|
kind: InitConfiguration
|
||||||
|
localAPIEndpoint:
|
||||||
|
advertiseAddress: 192.168.0.20
|
||||||
|
bindPort: 6443
|
||||||
|
nodeRegistration:
|
||||||
|
criSocket: unix:///var/run/containerd/containerd.sock
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
name: dev
|
||||||
|
taints:
|
||||||
|
- effect: NoSchedule
|
||||||
|
key: node-role.kubernetes.io/master
|
||||||
|
- effect: NoSchedule
|
||||||
|
key: node-role.kubernetes.io/control-plane
|
||||||
---
|
---
|
||||||
apiVersion: kubeadm.k8s.io/v1beta2
|
apiServer:
|
||||||
|
timeoutForControlPlane: 4m0s
|
||||||
|
apiVersion: kubeadm.k8s.io/v1beta3
|
||||||
|
certificatesDir: /etc/kubernetes/pki
|
||||||
|
clusterName: kubernetes
|
||||||
|
controlPlaneEndpoint: 192.168.0.20:6443
|
||||||
|
controllerManager: {}
|
||||||
|
dns: {}
|
||||||
|
etcd:
|
||||||
|
local:
|
||||||
|
dataDir: /var/lib/etcd
|
||||||
|
imageRepository: ccr.ccs.tencentyun.com/kgcrio
|
||||||
kind: ClusterConfiguration
|
kind: ClusterConfiguration
|
||||||
kubernetesVersion: stable
|
kubernetesVersion: v1.24.1
|
||||||
controlPlaneEndpoint: "192.168.0.200:8443"
|
|
||||||
imageRepository: registry.bing89.com/kubernetes
|
|
||||||
networking:
|
networking:
|
||||||
|
dnsDomain: cluster.local
|
||||||
podSubnet: 10.244.0.0/16
|
podSubnet: 10.244.0.0/16
|
||||||
|
serviceSubnet: 10.96.0.0/12
|
||||||
|
scheduler: {}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 基于堆叠etcd的cluster
|
## 基于堆叠etcd的cluster
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
HTTPS_PROXY=$1
|
||||||
|
IMAGE_REGISTRY=$2
|
||||||
|
IMAGE_REGISTRY_USER=$3
|
||||||
|
IMAGES=$(kubeadm config images list)
|
||||||
|
for IMAGE in ${IMAGES[@]}
|
||||||
|
do
|
||||||
|
echo "pull image ${IMAGE}"
|
||||||
|
https_proxy=${HTTPS_PROXY} ctr images pull --all-platforms ${IMAGE}
|
||||||
|
IMAGE_NAME=$(echo ${IMAGE}|sed -e 's|.*/||g')
|
||||||
|
ctr images tag ${IMAGE} ${IMAGE_REGISTRY}/${IMAGE_NAME}
|
||||||
|
ctr images push -k -u ${IMAGE_REGISTRY_USER} ${IMAGE_REGISTRY}/${IMAGE_NAME}
|
||||||
|
# ctr images rm ${IMAGE}
|
||||||
|
done
|
||||||
|
#192.168.0.144:1080 ccr.ccs.tencentyun.com/kgcrio 100004225373:Hello2022
|
|
@ -10,3 +10,8 @@
|
||||||
```bash
|
```bash
|
||||||
kubectl create secret docker-registry myregistrykey --docker-server=registry.bing89.com --docker-username=admin --docker-password=abcd1234 --docker-email=kun1.huang@outlook.com
|
kubectl create secret docker-registry myregistrykey --docker-server=registry.bing89.com --docker-username=admin --docker-password=abcd1234 --docker-email=kun1.huang@outlook.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
kubectl -n soulma-k8s-system create secret docker-registry txcloud --docker-server=ccr.ccs.tencentyun.com --docker-username=100004225373 --docker-password=Hello2022 --docker-email=766619031@qq.com
|
||||||
|
```
|
Loading…
Reference in New Issue