Adding documentation for updating k8s.
parent
4686db678d
commit
de9ee78fec
126
README.md
126
README.md
|
@ -237,6 +237,132 @@ export KUBERNETES_CONFORMANCE_TEST=y
|
||||||
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]" --check_version_skew=false --check_node_count=false
|
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]" --check_version_skew=false --check_node_count=false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Adding a New Dependency
|
||||||
|
|
||||||
|
Minikube uses `Godep` to manage vendored dependencies.
|
||||||
|
`Godep` can be a bit finnicky with a project with this many dependencies.
|
||||||
|
Here is a rough set of steps that usually works to add a new dependency.
|
||||||
|
|
||||||
|
1. Make a clean GOPATH, with minikube in it.
|
||||||
|
This isn't strictly necessary, but it usually helps.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mkdir -p $HOME/newgopath/src/k8s.io
|
||||||
|
export GOPATH=$HOME/newgopath
|
||||||
|
cd $HOME/newgopath/src/k8s.io
|
||||||
|
git clone https://github.com/kubernetes/minikube.git
|
||||||
|
```
|
||||||
|
|
||||||
|
2. `go get` your new dependency.
|
||||||
|
```shell
|
||||||
|
go get mynewdepenency
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Use it in code, build and test.
|
||||||
|
|
||||||
|
4. Import the dependency from GOPATH into vendor/
|
||||||
|
```shell
|
||||||
|
godep save ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
If it is a large dependency, please commit the vendor/ directory changes separately.
|
||||||
|
This makes review easier in Github.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git add vendor/
|
||||||
|
git commit -m "Adding dependency foo"
|
||||||
|
git add --all
|
||||||
|
git commit -m "Adding cool feature"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Updating Kubernetes
|
||||||
|
|
||||||
|
To update Kubernetes, follow these steps:
|
||||||
|
|
||||||
|
1. Make a clean GOPATH, with minikube in it.
|
||||||
|
This isn't strictly necessary, but it usually helps.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mkdir -p $HOME/newgopath/src/k8s.io
|
||||||
|
export GOPATH=$HOME/newgopath
|
||||||
|
cd $HOME/newgopath/src/k8s.io
|
||||||
|
git clone https://github.com/kubernetes/minikube.git
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Copy your vendor directory back out to the new GOPATH.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd minikube
|
||||||
|
godep restore ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Kubernetes should now be on your GOPATH. Check it out to the right version.
|
||||||
|
Make sure to also fetch tags, as Godep relies on these.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd $GOPATH/src/k8s.io/kubernetes
|
||||||
|
git fetch --tags
|
||||||
|
```
|
||||||
|
|
||||||
|
Then list all available Kubernetes tags:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git tag
|
||||||
|
...
|
||||||
|
v1.2.4
|
||||||
|
v1.2.4-beta.0
|
||||||
|
v1.3.0-alpha.3
|
||||||
|
v1.3.0-alpha.4
|
||||||
|
v1.3.0-alpha.5
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Then checkout the correct one and update its dependencies with:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git checkout $DESIREDTAG
|
||||||
|
godep restore ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Build and test minikube, making any manual changes necessary to build.
|
||||||
|
|
||||||
|
5. Update godeps
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd $GOPATH/src/k8s.io/minikube
|
||||||
|
rm -rf Godeps/ vendor/
|
||||||
|
godep save ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Verify that the correct tag is marked in the Godeps.json file by running this script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
python hack/get_k8s_version.py
|
||||||
|
-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitCommit=caf9a4d87700ba034a7b39cced19bd5628ca6aa3 -X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitVersion=v1.3.0-beta.2 -X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitTreeState=clean
|
||||||
|
```
|
||||||
|
|
||||||
|
The `-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitVersion` flag should contain the right tag.
|
||||||
|
|
||||||
|
Once you've build and started minikube, you can also run:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl version
|
||||||
|
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}
|
||||||
|
Server Version: version.Info{Major:"1", Minor:"3+", GitVersion:"v1.3.0-beta.2", GitCommit:"caf9a4d87700ba034a7b39cced19bd5628ca6aa3", GitTreeState:"clean"}
|
||||||
|
```
|
||||||
|
|
||||||
|
The Server Version should contain the right tag in `version.Info.GitVersion`.
|
||||||
|
|
||||||
|
If any manual changes were required, please commit the vendor changes separately.
|
||||||
|
This makes the change easier to view in Github.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git add vendor/
|
||||||
|
git commit -m "Updating Kubernetes to foo"
|
||||||
|
git add --all
|
||||||
|
git commit -m "Manual changes to update Kubernetes to foo"
|
||||||
|
```
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
Contributions, questions, and comments are all welcomed and encouraged! minkube developers hang out on [Slack](https://kubernetes.slack.com) in the #minikube channel (get an invitation [here](http://slack.kubernetes.io/)). We also have the [kubernetes-dev Google Groups mailing list](https://groups.google.com/forum/#!forum/kubernetes-dev). If you are posting to the list please prefix your subject with "minikube: ".
|
Contributions, questions, and comments are all welcomed and encouraged! minkube developers hang out on [Slack](https://kubernetes.slack.com) in the #minikube channel (get an invitation [here](http://slack.kubernetes.io/)). We also have the [kubernetes-dev Google Groups mailing list](https://groups.google.com/forum/#!forum/kubernetes-dev). If you are posting to the list please prefix your subject with "minikube: ".
|
||||||
|
|
Loading…
Reference in New Issue