Skip to content

Commit eb781ff

Browse files
Merge pull request #935 from wking/api-stability
docs/user/versioning: Document APIs covered by our Semantic Versioning
2 parents 94746bd + 28592d0 commit eb781ff

File tree

4 files changed

+62
-26
lines changed

4 files changed

+62
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
138138
- The user-facing `OPENSHIFT_INSTALL_*` environment variables are
139139
gone. Instead, users who want to skip the wizard are encouraged to
140140
[provide their own
141-
install-config](docs/user/tips-and-tricks.md#reusing-an-install-config).
141+
install-config](docs/user/overview.md#multiple-invocations).
142142
- On AWS, the option to install a cluster into an existing VPC is
143143
gone. Users who would have previously done this can use [VPC
144144
peering][aws-vpc-peering].

docs/user/overview.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ The OpenShift Installer operates on the notion of creating and destroying target
3636
The following targets can be created by the installer:
3737

3838
- `install-config` - The install config contains the main parameters for the installation process. This configuration provides the user with more options than the interactive prompts and comes pre-populated with default values.
39+
- `manifest-templates` - These are the unrendered Kubernetes manifest templates that feed the `manifests` target.
40+
This target is [unstable](versioning.md).
3941
- `manifests` - This target outputs all of the Kubernetes manifests that will be installed on the cluster.
42+
This target is [unstable](versioning.md).
4043
- `ignition-configs` - These are the three Ignition Configs for the bootstrap, master, and worker machines.
4144
- `cluster` - This target provisions the cluster and its associated infrastructure.
4245

@@ -47,6 +50,38 @@ The following targets can be destroyed by the installer:
4750

4851
### Multiple Invocations
4952

50-
In order to allow users to customize their installation, the installer can be invoked multiple times. The state is stored in a hidden file in the target directory and contains all of the intermediate artifacts. This allows the installer to pause during the installation and wait for the user to modify intermediate artifacts.
53+
In order to allow users to customize their installation, the installer can be invoked multiple times. The state is stored in a hidden file in the asset directory and contains all of the intermediate artifacts. This allows the installer to pause during the installation and wait for the user to modify intermediate artifacts.
5154

52-
For example, if changes to the install config were desired (e.g. the number of worker machines to create), the user would first invoke the installer with the `install-config` target: `openshift-install create install-config`. After prompting the user for the base parameters, the installer writes the install config into the target directory. The user can then make the desired modifications to the install config and invoke the installer with the `cluster` target: `openshift-install create cluster`. The installer will consume the install config from disk, removing it from the target directory, and proceed to create a cluster using the provided configuration.
55+
For example, you can create an install config and save it in a cluster-agnostic location:
56+
57+
```sh
58+
openshift-install --dir=initial create install-config
59+
mv initial/install-config.yaml .
60+
rm -rf initial
61+
```
62+
63+
You can use the saved install-config for future clusters by copying it that install config into the asset directory and then invoking the installer:
64+
65+
```sh
66+
mkdir cluster-0
67+
cp install-config.yaml cluster-0/
68+
openshift-install --dir=cluster-0 create cluster
69+
```
70+
71+
Supplying a previously-generated install-config like this is [explicitly part of the stable API](versioning.md).
72+
73+
You can also edit the assets in the asset directory during a single run.
74+
For example, you can adjust [the cluster-version operator's configuration][cluster-version]:
75+
76+
```sh
77+
mkdir cluster-1
78+
cp install-config.yaml cluster-1/
79+
openshift-install --dir=cluster-1 create manifests # warning: this target is unstable
80+
"${EDITOR}" cluster-1/manifests/cvo-overrides.yaml
81+
openshift-install --dir=cluster-1 create cluster
82+
```
83+
84+
As the unstable warning suggests, the presence of `manifests` and the names and content of its output [is an unstable API](versioning.md).
85+
It is occasionally useful to make alterations like this as one-off changes, but don't expect them to work on subsequent installer releases.
86+
87+
[cluster-version]: https://github.com/openshift/cluster-version-operator/blob/master/docs/dev/clusterversion.md

docs/user/tips-and-tricks.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/user/versioning.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Versioning
2+
3+
The installer uses [Semantic Versioning][semver] for its user-facing API.
4+
Covered by the versioning are:
5+
6+
* `openshift-install [options] create install-config`, which will always create `install-config.yaml` in the asset directory, although the version of the generated install-config may change.
7+
* `openshift-install [options] create ignition-configs`, which will always create `bootstrap.ign`, `master.ign`, and `worker.ign` in the asset directory, although the content of the generated files may change.
8+
* `openshift-install [options] create cluster`, which will always launch a new cluster.
9+
* `openshift-install [options] destroy bootstrap`, which will always destroy any bootstrap resources created for the cluster.
10+
* `openshift-install [options] destroy cluster`, which will always destroy the cluster resources.
11+
* `openshift-install [options] help`, which will always show help for the command, although available options and unstable commands may change.
12+
* `openshift-install [options] version`, which will always show sufficient version information for maintainers to identify the installer, although the format and content of its output may change.
13+
* The install-config format. New versions of this format may be released, but within a minor version series, the `openshift-install` will continue to be able to read previous versions.
14+
15+
The following are explicitly not covered:
16+
17+
* `openshift-install [options] graph`
18+
* `openshift-install [options] create manifest-templates`
19+
* `openshift-install [options] create manifests`
20+
21+
That means that the only stable install-time configuration is [via the install-config](overview.md#multiple-invocations).
22+
If you want a reliable way to alter, add, or remove Kubernetes objects, you should perform those actions as day-2 operations.
23+
24+
[semver]: https://semver.org/spec/v2.0.0.html

0 commit comments

Comments
 (0)