Skip to content

Commit 4c2f291

Browse files
Merge pull request #61 from cybozu-go/modify-document
Add the maintenance procedure
2 parents bdd6784 + 5698e8e commit 4c2f291

9 files changed

+134
-47
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,39 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4848

4949
This release updates the base image and the packages used by rebuilding the image.
5050
This fixes git vulnerabilities
51+
5152
- USN-5810-1: Git vulnerabilities
5253
- USN-5810-2: Git regression
5354

5455
## [0.1.4] - 2022-12-15
56+
5557
### Fix
58+
5659
- Refer avdc creationTimestamp when next start time is nil (#39)
5760
- Validate avdc template when startSchedule is not set (#40)
5861

5962
## [0.1.3] - 2022-10-19
63+
6064
### Fix
65+
6166
- Replace CMD to ENTRYPOINT in Dockerfile.Runner (#33)
6267
- Defaulting by controller instead admission webhook (#35)
68+
6369
### Added
70+
6471
- Add shorthand `avdc` (#34)
6572

6673
## [0.1.2] - 2022-09-28
74+
6775
### Fix
76+
6877
- Fix config (#32)
6978
- Inherit pod metadata of pod_template (#33)
7079

7180
## [0.1.1] - 2022-09-26
81+
7282
### Removed
83+
7384
- kube-rbac-proxy is removed (#30)
7485

7586
## [0.1.0] - 2022-09-16

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
[![PkgGoDev](https://pkg.go.dev/badge/github.com/cybozu-go/nyamber?tab=overview)](https://pkg.go.dev/github.com/cybozu-go/nyamber?tab=overview)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/cybozu-go/nyamber)](https://goreportcard.com/report/github.com/cybozu-go/nyamber)
55

6-
Nyamber
7-
============================
6+
# Nyamber
7+
88
Nyamber is a custom controller to create Neco environment
99

1010
## Features
11+
1112
- Run a dctest in a pod
1213
- Created a pod which runs dctest and a service to access the pod corresponding to vdc custom resources
1314
- Run user-defined command
1415
- Reflect status of executed command in the vdc resource.
1516
- Create dctest pods on the specified schedule
1617

1718
## Supported Software
19+
1820
- Kubernetes: 1.28, 1.29, 1.30
1921

2022
## Documentation

docs/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
# Template documentation
1+
# Nyamber documentation
2+
3+
Nyamber is a custom controller to create Neco environment.
4+
It is currently developed and maintained by [Cybozu](https://cybozu-global.com/).
5+
6+
The repository is at <https://github.com/cybozu-go/nyamber>.

docs/SUMMARY.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Summary
22

3-
[Template](README.md)
3+
[Nyamber](README.md)
4+
5+
## User manual
46

5-
# User manual
67
[UserManual](user-manual.md)
78

8-
# Developer documents
9+
## Developer documents
910

11+
- [Design notes](design.md)
12+
- [Development procedure](development.md)
13+
- Custom Resources
14+
- [VirtualDC](crd_virtualdc.md)
15+
- [AutoVirtualDC](crd_autovirtualdc.md)
1016
- [Release procedure](release.md)

docs/design.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ This is custom resource to automate deployment dctest pod.
2424
Nyamber create `VirtualDC` custom resource from its definition according to the schedule field.
2525
You can specify the `VirtualDC` startSchedule and stopSchedule with cron format.
2626

27-
2827
### Kubernetes workloads
2928

3029
#### `virtualdc-controller`
@@ -36,6 +35,7 @@ It create Runner pod which runs dctest and service to access Runner pod.
3635

3736
A deployment that create and delete VirutualDC resources according to set schedules.
3837
*You can't specify only one schedule. You should specify both schedules or leave both schedules empty*
38+
3939
- startSchedule and stopSchedule are empty: controller create virtualdc immediately
4040
- startSchedule and stopSchedule are set: calculate NextTime from those schedule and set time to status
4141
- nextStartTime < now and nextstopTime < now: do nothing

docs/development.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,45 @@
33
1. Prepare a Linux box running Docker.
44
2. Checkout this repository.
55

6-
```console
7-
$ git clone https://github.com/cybozu-go/nyamber
6+
```bash
7+
git clone https://github.com/cybozu-go/nyamber
88
```
99

1010
## Setup CLI tools
1111

1212
1. Install [aqua][].
1313

14-
https://aquaproj.github.io/docs/tutorial-basics/quick-start
14+
<https://aquaproj.github.io/docs/tutorial-basics/quick-start>
1515

1616
2. Install CLI tools.
1717

18-
```console
19-
$ cd cybozu-go/nyamber
20-
$ aqua i -l
18+
```bash
19+
cd cybozu-go/nyamber
20+
aqua i -l
2121
```
2222

2323
## Development & Debug
2424

2525
1. Launch local Kubernetes cluster.
2626

27-
```console
28-
$ cd cybozu-go/nyamber
29-
$ make start
27+
```bash
28+
cd cybozu-go/nyamber
29+
make start
3030
```
3131

3232
2. Start [Tilt][].
3333

34-
```console
35-
$ cd cybozu-go/nyamber
36-
$ tilt up
34+
```bash
35+
cd cybozu-go/nyamber
36+
tilt up
3737
```
3838

39-
3. Access: http://localhost:10350/
39+
3. Access: `http://localhost:10350/`
4040
4. Stop the Kubernetes cluster.
4141

42-
```console
43-
$ cd cybozu-go/nyamber
44-
$ make stop
42+
```bash
43+
cd cybozu-go/nyamber
44+
make stop
4545
```
4646

4747
[aqua]: https://aquaproj.github.io

docs/maintenance.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Maintenance
2+
3+
## How to update supported Kubernetes
4+
5+
Nyamber supports the three latest Kubernetes versions.
6+
If a new Kubernetes version is released, please update the followings:
7+
8+
### 1. Update supported kubernetes and dependencies versions
9+
10+
- Kubernetes versions:
11+
- `k8s-version` in [.github/workflows/ci.yaml](/.github/workflows/ci.yaml): You can check the available versions at <https://hub.docker.com/r/kindest/node/tags>.
12+
- "Supported software" in [README.md](/README.md)
13+
- Kubernetes tools versions:
14+
- Update `KUSTOMIZE_VERSION` in [Makefile](/Makefile) to the latest version from <https://github.com/kubernetes-sigs/kustomize/releases>.
15+
- Update `E2ETEST_K8S_VERSION` in [e2e/Makefile](/e2e/Makefile) to the latest supported version of kubernetes.
16+
- After saving the changes above, update `ENVTEST_K8S_VERSION` in [Makefile](/Makefile) to the latest patch version among the latest supported kubernetes minor versions listed by running `make setup && tmp/bin/setup-envtest list` at the root of this repository. If the latest minor supported version is `1.30.Z`, find `1.30.Z+` from the output but not `1.31.Z`.
17+
- Run `aqua update` to update tools in [aqua.yaml](/aqua.yaml). Then, manually align the minor versions of kubernetes and kubectl in `aqua.yaml`. If the minor version of `kubernetes/kubectl` in `aqua.yaml` precedes the latest supported minor versions of kubernetes, adjust it to match.
18+
_e.g._, If `kubernetes/kubectl` is `1.31.Z` and the latest supported version is `1.30.Z`, modify `kubernetes/kubectl` version to `1.30.Z`.
19+
- Other tools versions:
20+
- Update `PLACEMAT_VERSION` in [Dockerfile](/Dockerfile) to the latest version from <https://github.com/cybozu-go/placemat/releases>.
21+
- Update `CONTROLLER_TOOLS_VERSION` in [Makefile](/Makefile) to the latest version from <https://github.com/kubernetes-sigs/controller-tools/releases>.
22+
- Update `CERT_MANAGER_VERSION` in [e2e/Makefile](/e2e/Makefile) to the latest version from <https://github.com/cert-manager/cert-manager/releases>.
23+
- Other dependencies versions:
24+
- Update actions in [.github/workflows/ci.yaml](/.github/workflows/ci.yaml) and [.github/workflows/release.yaml](/.github/workflows/release.yaml)
25+
- Update `ghcr.io/cybozu/golang` image and `GO_VERSION` in [Dockerfile](/Dockerfile) and [Dockerfile.runner](/Dockerfile.runner) to the latest version from <https://github.com/cybozu/neco-containers/pkgs/container/golang>.
26+
- `go.mod` and `go.sum`:
27+
- Run `go get -u ./...`.
28+
29+
If Kubernetes or related APIs have changed, please update the relevant source code accordingly.
30+
31+
### 2. Update nyamber by running `make`
32+
33+
You can update nyamber by running the following `make` commands:
34+
35+
```sh
36+
make setup
37+
make manifests
38+
make build
39+
```
40+
41+
### 3. Fix test code if tests fail
42+
43+
After pushing the change, if the CI fails, fix the tests and push the changes again.
44+
45+
_e.g._, <https://github.com/cybozu-go/nyamber/pull/59>
46+
47+
### 4. Release the new version
48+
49+
After merging the changes above, follow the procedures written in [docs/release.md](/docs/release.md) and release the new version.
50+
51+
_e.g._, <https://github.com/cybozu-go/nyamber/pull/60>

docs/release.md

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Release procedure
2-
=================
1+
# Release procedure
32

43
This document describes how to release a new version.
54

@@ -32,42 +31,42 @@ It should look like:
3231

3332
1. Determine a new version number. Then set `VERSION` variable.
3433

35-
```console
34+
```bash
3635
# Set VERSION and confirm it. It should not have "v" prefix.
37-
$ VERSION=x.y.z
38-
$ echo $VERSION
36+
VERSION=x.y.z
37+
echo $VERSION
3938
```
4039

4140
2. Make a branch to release
4241

43-
```console
44-
$ git neco dev "bump-$VERSION"
42+
```bash
43+
git switch -c "bump-$VERSION"
4544
```
4645

4746
3. Edit `CHANGELOG.md` for the new version ([example][]).
4847
4. Commit the change and push it.
4948

50-
```console
51-
$ git commit -a -m "Bump version to $VERSION"
52-
$ git neco review
49+
```bash
50+
git commit -a -m "Bump version to $VERSION"
51+
git push origin "bump-$VERSION"
5352
```
5453

5554
5. Merge this branch.
5655
6. Add a git tag to the main HEAD, then push it.
5756

58-
```console
57+
```bash
5958
# Set VERSION again.
60-
$ VERSION=x.y.z
61-
$ echo $VERSION
59+
VERSION=x.y.z
60+
echo $VERSION
6261
63-
$ git checkout main
64-
$ git pull
65-
$ git tag -a -m "Release v$VERSION" "v$VERSION"
62+
git checkout main
63+
git pull
64+
git tag -a -m "Release v$VERSION" "v$VERSION"
6665
6766
# Make sure the release tag exists.
68-
$ git tag -ln | grep $VERSION
67+
git tag -ln | grep $VERSION
6968
70-
$ git push origin "v$VERSION"
69+
git push origin "v$VERSION"
7170
```
7271

7372
GitHub actions will build and push artifacts such as container images and

docs/user-manual.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
## create VirtualDC Automatically
44

55
### Create AutoVirtualDC Resource
6+
67
Apply the AutoVirtualDC manifest like this.
7-
```
8+
9+
```yaml
810
apiVersion: nyamber.cybozu.io/v1beta1
911
kind: AutoVirtualDC
1012
metadata:
@@ -20,38 +22,49 @@ spec:
2022
stopSchedule: "0 1 * * *"
2123
timeoutDuration: "20m"
2224
```
25+
2326
If this manifest is applied, Nyamber creates virtualdc pods at 0:00 every day.
24-
```
27+
28+
```console
2529
$ kubectl get pod -n nyamber-pod
2630
NAME READY STATUS RESTARTS AGE
2731
auto-virtual-dc2 1/1 Running 0 4s
2832
```
33+
2934
You can access the pod with service
30-
```
35+
36+
```console
3137
$ kubectl get service -n nyamber-pod
3238
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
3339
auto-virtual-dc2 ClusterIP 10.96.178.115 <none> 80/TCP 21s
3440
```
3541

3642
## create VirtualDC manually
43+
3744
### Create VirtualDC Resource
45+
3846
Apply the VirtualDC manifest like this.
39-
```
47+
48+
```yaml
4049
apiVersion: nyamber.cybozu.io/v1beta1
4150
kind: VirtualDC
4251
metadata:
4352
name: vdc-sample
4453
spec:
4554
skipNecoApps: true
4655
```
56+
4757
Nyamber create virtualdc pods immediately
48-
```
58+
59+
```console
4960
$ kubectl get pod -n nyamber-pod
5061
NAME READY STATUS RESTARTS AGE
5162
vdc-sample 1/1 Running 0 2s
5263
```
64+
5365
You can access the pod with service
54-
```
66+
67+
```console
5568
$ kubectl get service -n nyamber-pod
5669
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
5770
vdc-sample ClusterIP 10.96.233.168 <none> 80/TCP 13s

0 commit comments

Comments
 (0)