mirror of https://github.com/k3s-io/k3s
Merge pull request #76383 from xichengliudui/update-clien-docs
Update README.md files in client-gok3s-v1.15.3
commit
0cd40a6d51
|
@ -7,7 +7,7 @@ library install, don't mind getting HEAD (which may be less stable than a
|
|||
particular release), then simply:
|
||||
|
||||
```sh
|
||||
$ go get k8s.io/client-go@master
|
||||
go get k8s.io/client-go@master
|
||||
```
|
||||
|
||||
This will record a dependency on `k8s.io/client-go` in your go module.
|
||||
|
@ -24,12 +24,12 @@ If you are using a version of go prior to 1.11, or do not wish to use
|
|||
go modules, you can download `k8s.io/client-go` to your `$GOPATH` instead:
|
||||
|
||||
```sh
|
||||
$ go get -u k8s.io/client-go/...
|
||||
$ go get -u k8s.io/apimachinery/...
|
||||
$ cd $GOPATH/src/k8s.io/client-go
|
||||
$ git checkout v11.0.0
|
||||
$ cd $GOPATH/src/k8s.io/apimachinery
|
||||
$ git checkout kubernetes-1.14.0
|
||||
go get -u k8s.io/client-go/...
|
||||
go get -u k8s.io/apimachinery/...
|
||||
cd $GOPATH/src/k8s.io/client-go
|
||||
git checkout v11.0.0
|
||||
cd $GOPATH/src/k8s.io/apimachinery
|
||||
git checkout kubernetes-1.14.0
|
||||
```
|
||||
|
||||
This downloads a version of `k8s.io/client-go` prior to v1.12.0,
|
||||
|
|
|
@ -37,7 +37,7 @@ kubectl create clusterrolebinding default-view --clusterrole=view --serviceaccou
|
|||
|
||||
Then, run the image in a Pod with a single instance Deployment:
|
||||
|
||||
$ kubectl run --rm -i demo --image=in-cluster --image-pull-policy=Never
|
||||
kubectl run --rm -i demo --image=in-cluster --image-pull-policy=Never
|
||||
|
||||
There are 4 pods in the cluster
|
||||
There are 4 pods in the cluster
|
||||
|
|
|
@ -8,14 +8,14 @@ Run the following three commands in separate terminals. Each terminal needs a un
|
|||
|
||||
```bash
|
||||
# first terminal
|
||||
$ go run *.go -kubeconfig=/my/config -logtostderr=true -id=1
|
||||
go run *.go -kubeconfig=/my/config -logtostderr=true -id=1
|
||||
|
||||
# second terminal
|
||||
$ go run *.go -kubeconfig=/my/config -logtostderr=true -id=2
|
||||
go run *.go -kubeconfig=/my/config -logtostderr=true -id=2
|
||||
|
||||
# third terminal
|
||||
$ go run *.go -kubeconfig=/my/config -logtostderr=true -id=3
|
||||
go run *.go -kubeconfig=/my/config -logtostderr=true -id=3
|
||||
```
|
||||
> You can ignore the `-kubeconfig` flag if you are running these commands in the Kubernetes cluster.
|
||||
|
||||
Now kill the existing leader. You will see from the terminal outputs that one of the remaining two processes will be elected as the new leader.
|
||||
Now kill the existing leader. You will see from the terminal outputs that one of the remaining two processes will be elected as the new leader.
|
||||
|
|
|
@ -22,7 +22,7 @@ Run this application with:
|
|||
Running this application will use the kubeconfig file and then authenticate to the
|
||||
cluster, and print the number of pods in the cluster every 10 seconds:
|
||||
|
||||
$ ./app
|
||||
./app
|
||||
There are 3 pods in the cluster
|
||||
There are 3 pods in the cluster
|
||||
There are 3 pods in the cluster
|
||||
|
|
Loading…
Reference in New Issue