mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #94052 from jeremyje/windoc
Simplify and de-lint GCE Windows kube-up docs.
This commit is contained in:
commit
2b4c03b6ae
@ -1,6 +1,7 @@
|
|||||||
# Starting a Windows Kubernetes cluster on GCE using kube-up
|
# Starting a Windows Kubernetes cluster on GCE using kube-up
|
||||||
|
|
||||||
## IMPORTANT PLEASE NOTE!
|
## IMPORTANT PLEASE NOTE
|
||||||
|
|
||||||
Any time the file structure in the `windows` directory changes, `windows/BUILD`
|
Any time the file structure in the `windows` directory changes, `windows/BUILD`
|
||||||
and `k8s.io/release/lib/releaselib.sh` must be manually updated with the
|
and `k8s.io/release/lib/releaselib.sh` must be manually updated with the
|
||||||
changes. We HIGHLY recommend not changing the file structure, because consumers
|
changes. We HIGHLY recommend not changing the file structure, because consumers
|
||||||
@ -15,7 +16,7 @@ Prerequisites: a Google Cloud Platform project.
|
|||||||
Clone this repository under your `$GOPATH/src` directory on a Linux machine.
|
Clone this repository under your `$GOPATH/src` directory on a Linux machine.
|
||||||
Then, optionally clean/prepare your environment using these commands:
|
Then, optionally clean/prepare your environment using these commands:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# Remove files that interfere with get-kube / kube-up:
|
# Remove files that interfere with get-kube / kube-up:
|
||||||
rm -rf ./kubernetes/; rm -f kubernetes.tar.gz; rm -f ~/.kube/config
|
rm -rf ./kubernetes/; rm -f kubernetes.tar.gz; rm -f ~/.kube/config
|
||||||
|
|
||||||
@ -44,19 +45,15 @@ release`. However, that builds binaries for all supported platforms, and can be
|
|||||||
slow. You can speed up the process by following the instructions below to only
|
slow. You can speed up the process by following the instructions below to only
|
||||||
build the necessary binaries.
|
build the necessary binaries.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# Apply https://github.com/yujuhong/kubernetes/commit/27e608a050a997be5ab736a7cdeb29aa68f3b7ee to your tree:
|
|
||||||
curl \
|
|
||||||
https://github.com/yujuhong/kubernetes/commit/27e608a050a997be5ab736a7cdeb29aa68f3b7ee.patch | \
|
|
||||||
git apply
|
|
||||||
|
|
||||||
# Build binaries for both Linux and Windows:
|
# Build binaries for both Linux and Windows:
|
||||||
make quick-release
|
KUBE_BUILD_PLATFORMS="linux/amd64 windows/amd64" make quick-release
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Create a Kubernetes cluster
|
### 2. Create a Kubernetes cluster
|
||||||
|
|
||||||
You can create a regular Kubernetes cluster or an end-to-end test cluster.<br />
|
You can create a regular Kubernetes cluster or an end-to-end test cluster.
|
||||||
|
|
||||||
Only end-to-end test clusters support running the Kubernetes e2e tests (as both [e2e cluster creation](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/e2e-internal/e2e-up.sh#L24) and [e2e test scripts](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/ginkgo-e2e.sh#L42) are setup based on `cluster/gce/config-test.sh`), also enables some debugging features such as SSH access on the Windows nodes.
|
Only end-to-end test clusters support running the Kubernetes e2e tests (as both [e2e cluster creation](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/e2e-internal/e2e-up.sh#L24) and [e2e test scripts](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/ginkgo-e2e.sh#L42) are setup based on `cluster/gce/config-test.sh`), also enables some debugging features such as SSH access on the Windows nodes.
|
||||||
|
|
||||||
Please make sure you set the environment variables properly following the
|
Please make sure you set the environment variables properly following the
|
||||||
@ -69,7 +66,7 @@ Linux worker node is required and two are recommended because many default
|
|||||||
cluster-addons (e.g., `kube-dns`) need to run on Linux nodes. The master control
|
cluster-addons (e.g., `kube-dns`) need to run on Linux nodes. The master control
|
||||||
plane only runs on Linux.
|
plane only runs on Linux.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
export NUM_NODES=2 # number of Linux nodes
|
export NUM_NODES=2 # number of Linux nodes
|
||||||
export NUM_WINDOWS_NODES=2
|
export NUM_WINDOWS_NODES=2
|
||||||
export KUBE_GCE_ENABLE_IP_ALIASES=true
|
export KUBE_GCE_ENABLE_IP_ALIASES=true
|
||||||
@ -81,7 +78,7 @@ Now bring up a cluster using one of the following two methods:
|
|||||||
|
|
||||||
#### 2a. Create a regular Kubernetes cluster
|
#### 2a. Create a regular Kubernetes cluster
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# Invoke kube-up.sh with these environment variables:
|
# Invoke kube-up.sh with these environment variables:
|
||||||
# PROJECT: text name of your GCP project.
|
# PROJECT: text name of your GCP project.
|
||||||
# WINDOWS_NODE_OS_DISTRIBUTION: the Windows version you want your nodes to
|
# WINDOWS_NODE_OS_DISTRIBUTION: the Windows version you want your nodes to
|
||||||
@ -94,21 +91,24 @@ PROJECT=${CLOUDSDK_CORE_PROJECT} WINDOWS_NODE_OS_DISTRIBUTION=win2019 \
|
|||||||
|
|
||||||
To teardown the cluster run:
|
To teardown the cluster run:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
PROJECT=${CLOUDSDK_CORE_PROJECT} ./cluster/kube-down.sh
|
PROJECT=${CLOUDSDK_CORE_PROJECT} ./cluster/kube-down.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2b. Create a Kubernetes end-to-end (E2E) test cluster
|
#### 2b. Create a Kubernetes end-to-end (E2E) test cluster
|
||||||
|
|
||||||
If you have built your own release binaries following step 1, run the following
|
If you have built your own release binaries following step 1, run the following
|
||||||
command:
|
command:
|
||||||
```
|
|
||||||
|
```bash
|
||||||
PROJECT=${CLOUDSDK_CORE_PROJECT} WINDOWS_NODE_OS_DISTRIBUTION=win2019 \
|
PROJECT=${CLOUDSDK_CORE_PROJECT} WINDOWS_NODE_OS_DISTRIBUTION=win2019 \
|
||||||
./hack/e2e-internal/e2e-up.sh
|
./hack/e2e-internal/e2e-up.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
If any e2e cluster exists already, this command will prompt you to tear down and
|
If any e2e cluster exists already, this command will prompt you to tear down and
|
||||||
create a new one. To teardown existing e2e cluster only, run the command:
|
create a new one. To teardown existing e2e cluster only, run the command:
|
||||||
```
|
|
||||||
|
```bash
|
||||||
PROJECT=${CLOUDSDK_CORE_PROJECT} ./hack/e2e-internal/e2e-down.sh
|
PROJECT=${CLOUDSDK_CORE_PROJECT} ./hack/e2e-internal/e2e-down.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ and `NUM_WINDOWS_NODES` Windows worker nodes.
|
|||||||
Invoke this script to run a smoke test that verifies that the cluster has been
|
Invoke this script to run a smoke test that verifies that the cluster has been
|
||||||
brought up correctly:
|
brought up correctly:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
cluster/gce/windows/smoke-test.sh
|
cluster/gce/windows/smoke-test.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -138,13 +138,13 @@ use the steps below to run K8s e2e tests. These steps are based on
|
|||||||
* Build the necessary test binaries. This must be done after every change to
|
* Build the necessary test binaries. This must be done after every change to
|
||||||
test code.
|
test code.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
make WHAT=test/e2e/e2e.test
|
make WHAT=test/e2e/e2e.test
|
||||||
```
|
```
|
||||||
|
|
||||||
* Set necessary environment variables and fetch the `run-e2e.sh` script:
|
* Set necessary environment variables and fetch the `run-e2e.sh` script:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
export KUBECONFIG=~/.kube/config
|
export KUBECONFIG=~/.kube/config
|
||||||
export WORKSPACE=$(pwd)
|
export WORKSPACE=$(pwd)
|
||||||
export ARTIFACTS=${WORKSPACE}/e2e-artifacts
|
export ARTIFACTS=${WORKSPACE}/e2e-artifacts
|
||||||
@ -165,7 +165,7 @@ use the steps below to run K8s e2e tests. These steps are based on
|
|||||||
should be passed to the `run-e2e` script; escape the ginkgo arguments by
|
should be passed to the `run-e2e` script; escape the ginkgo arguments by
|
||||||
adding quotes around them. For example:
|
adding quotes around them. For example:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./run-e2e.sh --node-os-distro=windows \
|
./run-e2e.sh --node-os-distro=windows \
|
||||||
--ginkgo.focus="\[Conformance\]|\[NodeConformance\]|\[sig-windows\]" \
|
--ginkgo.focus="\[Conformance\]|\[NodeConformance\]|\[sig-windows\]" \
|
||||||
--ginkgo.skip="\[LinuxOnly\]|\[Serial\]|\[Feature:.+\]" --minStartupPods=8
|
--ginkgo.skip="\[LinuxOnly\]|\[Serial\]|\[Feature:.+\]" --minStartupPods=8
|
||||||
@ -174,7 +174,7 @@ use the steps below to run K8s e2e tests. These steps are based on
|
|||||||
* Run a single test by setting the ginkgo focus to match your test name; for
|
* Run a single test by setting the ginkgo focus to match your test name; for
|
||||||
example, the "DNS should provide DNS for the cluster" test can be run using:
|
example, the "DNS should provide DNS for the cluster" test can be run using:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./run-e2e.sh --node-os-distro=windows \
|
./run-e2e.sh --node-os-distro=windows \
|
||||||
--ginkgo.focus="provide\sDNS\sfor\sthe\scluster"
|
--ginkgo.focus="provide\sDNS\sfor\sthe\scluster"
|
||||||
```
|
```
|
||||||
@ -184,3 +184,9 @@ use the steps below to run K8s e2e tests. These steps are based on
|
|||||||
|
|
||||||
After the test run completes, log files can be found under the `${ARTIFACTS}`
|
After the test run completes, log files can be found under the `${ARTIFACTS}`
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
## E2E Testing
|
||||||
|
|
||||||
|
Once you've created a pull request you can comment,
|
||||||
|
`/test pull-kubernetes-e2e-windows-gce` to run the integration tests that cover
|
||||||
|
the changes in this directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user