Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs improvement from module12 to module15 #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module12/istio/1.http-gw/httpserver.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kubectl create -f istio-specs.yaml -n simple
### Check ingress ip

```sh
k get svc -nistio-system
k get svc -n istio-system

istio-ingressgateway LoadBalancer 10.108.31.242
```
Expand Down
2 changes: 1 addition & 1 deletion module12/istio/3.https-gw/httpsserver.MD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kubectl apply -f istio-specs.yaml -n securesvc
### Check ingress ip

```sh
k get svc -nistio-system
k get svc -n istio-system

istio-ingressgateway LoadBalancer $INGRESS_IP
```
Expand Down
2 changes: 1 addition & 1 deletion module12/istio/tracing/readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kubectl apply -f istio-specs.yaml -n tracing
### Check ingress ip

```sh
k get svc -nistio-system
k get svc -n istio-system

istio-ingressgateway LoadBalancer $INGRESS_IP
```
Expand Down
6 changes: 3 additions & 3 deletions module13/clusternet/access-child-cluster.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```
```sh
# base64 encoded certificate from your child cluster. (PLEASE CHANGE ME!!!)
CHILDCLUSTERCERT="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJQW5PaUNCa2JzMHN3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdz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ThOcjcrNUJZQXFDMG0vRnVNWGphK2FOdgpBSTRTK3J2SDM1SHJVZ2pvZkhQQW9tZ1VxaGdiVDFSbUdlaFZ0bDZObStMZG16bC9jV2lmNEs5SmM2c09FRWd1ClZkczNWbFBnTkc3WHZxSzY4K003QkxXT3Y2d0Q5U01hbVRLa25laGVXQWJNZGNIMlgyRGNKNEIvTUp6OU1CSHgKNE1EaFhBNXJuSUwrQ1ZSQVdNZEdlWTVreTQwQ0FvNXdZd29SR2hkeHZ0ZlFMbGhJZ2c9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
# base64 encoded privatekey from your child cluster. (PLEASE CHANGE ME!!!)
Expand All @@ -15,7 +15,7 @@ curl -k -XGET -H "Accept: application/json" \
"${APISERVER}/apis/proxies.clusternet.io/v1alpha1/sockets/${CHILDCLUSTERID}/proxy/direct/api/v1/namespaces"
```

```
```sh
# Here the token is base64 decoded and from your child cluster. (PLEASE CHANGE ME!!!)
CHILDCLUSTERTOKEN="ZXlKaGJHY2lPaUpTVXpJMU5pSXNJbXRwWkNJNklsQlJMVWRzZVVoa1RtUnhOM04zU0dkNVFXOHRPVGRLYVRNMU16UnRWbXRYV25NMVFWQjJUWE5NUjJzaWZRLmV5SnBjM01pT2lKcmRXSmxjbTVsZEdWekwzTmxjblpwWTJWaFkyTnZkVzUwSWl3aWEzVmlaWEp1WlhSbGN5NXBieTl6WlhKMmFXTmxZV05qYjNWdWRDOXVZVzFsYzNCaFkyVWlPaUprWldaaGRXeDBJaXdpYTNWaVpYSnVaWFJsY3k1cGJ5OXpaWEoyYVdObFlXTmpiM1Z1ZEM5elpXTnlaWFF1Ym1GdFpTSTZJbVJsWm1GMWJIUXRkRzlyWlc0dGFEWnpjSG9pTENKcmRXSmxjbTVsZEdWekxtbHZMM05sY25acFkyVmhZMk52ZFc1MEwzTmxjblpwWTJVdFlXTmpiM1Z1ZEM1dVlXMWxJam9pWkdWbVlYVnNkQ0lzSW10MVltVnlibVYwWlhNdWFXOHZjMlZ5ZG1salpXRmpZMjkxYm5RdmMyVnlkbWxqWlMxaFkyTnZkVzUwTG5WcFpDSTZJalUwTURJMU1HSmpMVGN4T1dFdE5HUTNNUzA1TURkakxUZ3hNemsxTTJOa05UUTBOaUlzSW5OMVlpSTZJbk41YzNSbGJUcHpaWEoyYVdObFlXTmpiM1Z1ZERwa1pXWmhkV3gwT21SbFptRjFiSFFpZlEuU2lXa29RMkhlZ1lJSk8yY3RZTVZhWHgxWTZCWnllRW5MS1N6NXNpREpDSURUU09JQjlrdlNubDF4SFdsa1pPcUdidGVmU2FFSVU5RERCWTZ6SnBxc0MyazA4WllqOWJMQTcxR2ZrT0o4NzFXdG5yaXI4M0ZqaGNYNzFVSHd2WUtwcHV1V2ctTVFBMm5sd0JUdVhkTjloVHlJVHowenEwd09wNllRNnM1encxRDVBd0JPblBZWXphR0JQVXBEbGdNaXdSN0Q4VFRLY3h3c0JyYVVRVXhfUnhkUXNscDBUQk0xbmFRQWlZUFM4TDRVbGxRTEt2blhhRXlGb3VRV29CUVFNQjhNTm1UajBfdEFIYmZyWEpHeTFnMzlWZ254bHhubmdHcE1EdWEwYV9RR1VUbkhkcFE1ZHM3ODQwOVpxOWJ6YkpjVXliTkNGV0lFUnltdkppYVRn"

Expand All @@ -24,4 +24,4 @@ curl -k -XGET -H "Accept: application/json" \
-H "Authorization: ${PARENTCLUSTERAUTH}" \
-H "Impersonate-Extra-Clusternet-Token: ${CHILDCLUSTERTOKEN}" \
"${APISERVER}/apis/proxies.clusternet.io/v1alpha1/sockets/${CHILDCLUSTERID}/proxy/direct/api/v1/namespaces"
```
```
26 changes: 16 additions & 10 deletions module13/clusternet/deploy-app.MD
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
### create deployment in host cluster
```
### Create deployment in host cluster

```sh
kubectl clusternet apply -f deployment.yaml
```
### where the object being stored, as manifest object in clusternet-reserved
```

### Where the object being stored, as manifest object in clusternet-reserved

```sh
k get manifest -A
NAMESPACE NAME AGE
clusternet-reserved deployments-foo-my-nginx 9h
clusternet-reserved namespaces-foo 9h
```
### link the deployment and target cluster
```

### Link the deployment and target cluster

```sh
kubectl apply -f localization.yaml
kubectl apply -f subscription.yaml

```
### check generated obj
```

### Check generated obj

```sh
k get base -A
NAMESPACE NAME AGE
clusternet-bmqv4 app-demo 9h
Expand All @@ -26,7 +32,7 @@ NAMESPACE NAME DEPLOYER STATUS AGE
clusternet-bmqv4 app-demo-generic Generic Success 9h
```

```
```sh
etcdctl --endpoints https://127.0.0.1:2379 \
--cacert /etc/kubernetes/pki/etcd/ca.crt \
--cert /etc/kubernetes/pki/etcd/server.crt \
Expand Down
43 changes: 27 additions & 16 deletions module13/clusternet/installation.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## install kubectl clusternet plugin
### install krew
```
## Install kubectl clusternet plugin

### Install krew

```sh
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
Expand All @@ -10,35 +12,44 @@
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)

```
### setup krew
```

### Setup krew

```sh
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
kubectl krew
```
### install clusternet plugin
```

### Install clusternet plugin

```sh
kubectl krew update
kubectl krew install clusternet
kubectl clusternet version
```
## setup clusternet control plane
### parent cluster
```

## Setup clusternet control plane

### Parent cluster

```sh
helm repo add clusternet https://clusternet.github.io/charts
helm install clusternet-hub -n clusternet-system --create-namespace clusternet/clusternet-hub
kubectl apply -f https://raw.githubusercontent.com/clusternet/clusternet/main/manifests/samples/cluster_bootstrap_token.yaml
```
### child cluster, registrationToken is installed in kube-system
```

### Child cluster, registrationToken is installed in kube-system

```sh
helm install clusternet-agent -n clusternet-system --create-namespace \
--set parentURL=https://192.168.34.2:6443 \
--set registrationToken=07401b.f395accd246ae52d \
clusternet/clusternet-agent
```
### check managed clusters
```

### Check managed clusters

```sh
kubectl get managedcluster -A
```

83 changes: 50 additions & 33 deletions module13/federation/readme.MD
Original file line number Diff line number Diff line change
@@ -1,64 +1,81 @@
## install kubefed by kind
### 下载federation代码
```
### 下载 federation 代码

```sh
git clone https://github.com/kubernetes-sigs/kubefed.git
```
### 选择HostCluster,确认kubeconfig符合federatio命名规范,用vi编辑kubeconfig,确保context属性没用@字符
```
vi ~/.kube/config

### 选择 HostCluster,确认 kubeconfig 符合 federatio 命名规范,用 vi 编辑 kubeconfig,确保 context 属性没用@字符

```sh
vi ~/.kube/config
```

```yaml
contexts:
- context:
cluster: kubernetes
user: kubernetes-admin
cluster: kubernetes
user: kubernetes-admin
name: `cluster1`
current-context: `cluster1`
current-context: `cluster1`
```

### 安装
```

```sh
kind create cluster
make deploy.kind
kubectl -n kube-federation-system get kubefedcluster -oyaml
```
### fix
```
k get po -n kube-system kube-apiserver-kind-control-plane -owide

### Fix

```sh
k get po -n kube-system kube-apiserver-kind-control-plane
kube-system kube-apiserver-kind-control-plane 1/1 Running 0 24m 172.18.0.2 kind-control-plane <none> <none>
172.18.0.2
```
#### edit kubefedcluster and change apiEndpoint to 172.18.0.2:6443
```
kubectl -n kube-federation-system edit kubefedcluster
```
### 安装完成后查看federation
```

### 安装完成后查看 federation

```sh
kubectl get all -n kube-federation-system
```
### 将namespace设置为联邦对象
```

### 将 namespace 设置为联邦对象

```sh
kubectl create ns federate-me
./bin/kubefedctl federate ns federate-me

```
### 创建FederatedDeployment
```

### 创建 FederatedDeployment

```sh
kubectl apply -f test-deployment.yaml -n federate-me
```
### 查看membercluster中的deployment对象
```

### 查看 membercluster 中的 deployment 对象

```sh
kubectl get deployment test-deployment -n federate-me
```
### 创建RSP对象
```

### 创建 RSP 对象

```sh
kubectl apply -f test-deployment-rsp.yaml -n federate-me
```
### 查看membercluster中的deployment对象
```

### 查看 membercluster 中的 deployment 对象

```sh
kubectl get deployment test-deployment -n federate-me
```
### 查看federatedployment,会发现因为rsp,federateddeployment的override属性被更新了
```

### 查看 federatedployment,会发现因为 rsp,federateddeployment 的 override 属性被更新了

```sh
kubectl get federateddeployment test-deployment -n federate-me
```
### 删除rsp,发现override没有被拿掉

### 删除 rsp,发现 override 没有被拿掉
Loading