Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit e52b9e2

Browse files
committed
docs: detailed docs with links
1 parent 0d90d55 commit e52b9e2

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

core/src/main/java/io/javaoperatorsdk/jenvtest/KubeAPIServerConfigBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
public final class KubeAPIServerConfigBuilder {
88

9-
public static final String JENVTEST_DOWNLOAD_BINARIES = "JENVTEST_DOWNLOAD_BINARIES";
9+
// environment variables
10+
public static final String JENVTEST_DOWNLOAD_BINARIES = "JENVTEST_OFFLINE_MODE";
1011
public static final String JENVTEST_DIR_ENV_VAR = "JENVTEST_DIR";
1112
public static final String JENVTEST_API_SERVER_VERSION_ENV_VAR = "JENVTEST_API_SERVER_VERSION";
1213

docs/README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1+
# User Documentation
12

3+
jenvtest is a relatively simple test that support integration testing with Kubernetes API Server.
4+
The whole concept and implementation is relatively simple, this doc describes some high level concepts
5+
and provides some more detailed information.
26

37
## Configuration Options
48

9+
See available configuration options documented in [KubeAPIServerConfig](https://github.com/java-operator-sdk/jenvtest/blob/main/core/src/main/java/io/javaoperatorsdk/jenvtest/KubeAPIServerConfig.java#L6-L6)
510

11+
Not all those properties can be overridden using [`@EnableKubeAPIServer`](https://github.com/java-operator-sdk/jenvtest/blob/main/core/src/main/java/io/javaoperatorsdk/jenvtest/junit/EnableKubeAPIServer.java)
12+
annotation, since might not make sense to do it for an individual test case. However, those can be passed to
13+
[`KubeApiServer`](https://github.com/java-operator-sdk/jenvtest/blob/main/core/src/main/java/io/javaoperatorsdk/jenvtest/junit/EnableKubeAPIServer.java)
14+
and also configured globally using environment variables, see [KubeAPIServerConfigBuilder](https://github.com/java-operator-sdk/jenvtest/blob/main/core/src/main/java/io/javaoperatorsdk/jenvtest/KubeAPIServerConfigBuilder.java)
615

16+
### Updating kube config file
717

18+
In general, it is not advised but if instructed kube config file (~/kube/config) is updated by the framework.
19+
See related property in [`@EnableKubeAPIServer`](https://github.com/java-operator-sdk/jenvtest/blob/main/core/src/main/java/io/javaoperatorsdk/jenvtest/junit/EnableKubeAPIServer.java#L27-L27)
20+
annotation. The config file is automatically cleaned up on stop.
821

922
## How does it work
1023

1124
In the background Kubernetes and etcd (and kubectl) binaries are downloaded if not found locally.
12-
13-
All the certificates for the Kube API Server and for the client is generated. The client config file
14-
(`~/kube/config`) file is updated, to any client can be used to talk to the API Server.
25+
All the certificates for the Kube API Server and for the client is generated.
26+
The client certificates are generated with group `system:masters`;
1527

1628
## Downloading binaries
1729

@@ -20,4 +32,4 @@ If there are multiple binaries found, the latest if selected (unless a target ve
2032

2133
Also [`setup-envtest`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest#section-readme) can be used
2234
to download binaries manually. By executing `setup-envtest use --bin-dir ~/.jenvtest` will download the latest required
23-
binaries to the default directory. This is useful if always running the tests in offline mode.
35+
binaries to the default directory. This is useful if always running the tests in offline mode.

0 commit comments

Comments
 (0)