Skip to content

Commit 21bedc2

Browse files
committed
docs / missing goreleaser config
1 parent b73d89a commit 21bedc2

File tree

7 files changed

+98
-36
lines changed

7 files changed

+98
-36
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Current situation
2+
<!--- Shortly describe the current situation -->
3+
4+
## Proposal
5+
<!--- Describe what this PR is intended to achieve -->

.goreleaser.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
project_name: k8sdb-controller
2+
3+
builds:
4+
- skip: true
5+
6+
release:
7+
prerelease: "true"
8+
extra_files:
9+
- glob: config/release/*.yaml
10+
11+
checksum:
12+
extra_files:
13+
- glob: config/release/*.yaml
14+
15+
source:
16+
enabled: true
17+
name_template: "{{ .ProjectName }}_{{ .Version }}_source_code"
18+
19+
sboms:
20+
- id: source
21+
artifacts: source
22+
documents:
23+
- "{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json"
24+
25+
# signs the checksum file
26+
# all files (including the sboms) are included in the checksum
27+
# https://goreleaser.com/customization/sign
28+
#signs:
29+
# - cmd: cosign
30+
# env:
31+
# - COSIGN_EXPERIMENTAL=1
32+
# certificate: "${artifact}.pem"
33+
# args:
34+
# - sign-blob
35+
# - "--output-certificate=${certificate}"
36+
# - "--output-signature=${signature}"
37+
# - "${artifact}"
38+
# artifacts: checksum
39+
# output: true

CHANGELOG.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
## 0.1.0
44

5-
**Release date:** xxxx-xx-xx
5+
**Release date:** 2022-02-24
66

7-
description
8-
9-
Improvements:
10-
* xxx
11-
12-
Fixes:
13-
* xxx
7+
Initial oss release

CONTRIBUTING.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
## Release process
22

3+
### Controller release
34
1. Merge all pr's to master which need to be part of the new release
45
2. Create pr to master with these changes:
6+
1. Bump kustomization
7+
2. Create CHANGELOG.md entry with release and date
8+
3. Merge pr
9+
4. Push a tag following semantic versioning prefixed by 'v'. Do not create a github release, this is done automatically.
10+
5. Create new branch and add the following changes:
511
1. Bump chart version
612
2. Bump charts app version
7-
3. Bump kustomization
8-
4. Create CHANGELOG.md entry with release and date
9-
3. Merge pr
10-
4. Push a tag following semantic versioning prefixed by 'v'.
11-
Do not create a github release, this is done automatically.
13+
6. Create pr to master and merge
14+
15+
### Helm chart change only
16+
1. Create branch with changes
17+
2. Bump chart version
18+
3. Create pr to master and merge

README.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Database controller
22

3-
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4787/badge)](https://bestpractices.coreinfrastructure.org/projects/4787)
3+
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5643/badge)](https://bestpractices.coreinfrastructure.org/projects/5643)
44
[![e2e](https://github.com/DoodleScheduling/k8sdb-controller/workflows/e2e/badge.svg)](https://github.com/DoodleScheduling/k8sdb-controller/actions)
55
[![report](https://goreportcard.com/badge/github.com/DoodleScheduling/k8sdb-controller)](https://goreportcard.com/report/github.com/DoodleScheduling/k8sdb-controller)
6-
[![license](https://img.shields.io/github/license/DoodleScheduling/k8sdb-controller.svg)](https://github.com/DoodleScheduling/k8sdb-controller/blob/main/LICENSE)
6+
[![license](https://img.shields.io/github/license/DoodleScheduling/k8sdb-controller.svg)](https://github.com/DoodleScheduling/k8sdb-controller/blob/master/LICENSE)
77
[![release](https://img.shields.io/github/release/DoodleScheduling/k8sdb-controller/all.svg)](https://github.com/DoodleScheduling/k8sdb-controller/releases)
88

99
Kubernetes Controller for database and user provisioning.
10-
11-
**Note**: This controller does not deploy database servers. It is meant for managing existing ones either deployed by other controllers or manually.
10+
Currently the controller supports Postgres and MongoDB (as well as MongoDB Atlas).
11+
Using the controller you can deploy databases and users defined as code on top of kubernetes.
12+
How to deploy database servers is out of scope of this project.
1213

1314
## Example for PostgreSQL
1415

16+
Example of how to deploy a Postgres database called my-app as well as a user to the server localhost:5432.
17+
1518
```yaml
1619
apiVersion: v1
1720
kind: Secret
@@ -54,6 +57,9 @@ data:
5457
```
5558
5659
## Example for MongoDB
60+
61+
Example of how to deploy a MongoDB database called my-app as well as a user to the server localhost:5432.
62+
5763
```yaml
5864
apiVersion: v1
5965
kind: Secret
@@ -97,29 +103,40 @@ data:
97103
username: MTIzNA==
98104
```
99105
100-
## Helm chart
106+
## Installation
107+
108+
### Helm
109+
110+
Please see [chart/k8sdb-controller](https://github.com/DoodleScheduling/k8sdb-controller/tree/master/chart/k8stcpmap-controller) for the helm chart docs.
111+
112+
### Manifests/kustomize
101113
102-
Please see [chart/k8sdb-controller](https://github.com/DoodleScheduling/k8sdb-controller) for the helm chart docs.
114+
Alternatively you may get the bundled manifests in each release to deploy it using kustomize or use them directly.
115+
116+
## Limitations
117+
118+
By design there is no garbage collection implemented for databases. Meaning a database does not get dropped if the kubernetes resources is removed.
119+
However this is not the case for users. Users will be removed from the corresponding databases if the referenced kubernetes resource gets removed.
120+
We might reconsider this in the future.
103121
104122
## Profiling
105-
To profile controller, access web server on #profilerPort (default 6060).
123+
To profile controller, access web server on #profilerPort (default 6060).
106124
107125
In Kubernetes, port-forward to this port, and open the `/debug/pprof` URL in browser. For example, if you port-forward 6060 from container to 6060 on your machine, access:
108126
```
109127
http://localhost:6060/debug/pprof/
110128
```
111129
112-
## Limitations
113-
114-
Currently there is no garbage collection implemented, meaning all the things created are not removed.
115-
This will be at least implemented for user provisioning. Discussion will stay open for databases.
116-
117130
## Configure the controller
118131
119-
ENV Variable | Argument | Default value | Example | Purpose |
120-
-------------|----------|---------------|---------|---------|
121-
METRICS_ADDR | --metrics-addr | :8080 | :8080 | Metrics port |
122-
ENABLE_LEADER_ELECTION | --enable-leader-election | false | true | Enable leader election |
123-
LEADER_ELECTION_NAMESPACE | --leader-election-namespace | "" | devops | Leader election namespace. Default is the same as controller.
124-
NAMESPACES | --namespaces | "" | devops,default | Namespaces to watch. Default: watch all namespaces |
125-
MAX_CONCURRENT_RECONCILES | --max-concurrent-reconciles | 1 | 5 | Maximum concurrent reconciles per controller. This config covers all controllers. |
132+
You may change base settings for the controller using env variables (or alternatively command line arguments).
133+
Available env variables:
134+
135+
| Name | Description | Default |
136+
|-------|-------------| --------|
137+
| `METRICS_ADDR` | The address of the metric endpoint binds to. | `:9556` |
138+
| `PROBE_ADDR` | The address of the probe endpoints binds to. | `:9557` |
139+
| `ENABLE_LEADER_ELECTION` | Enable leader election for controller manager. | `false` |
140+
| `LEADER_ELECTION_NAMESPACE` | Change the leader election namespace. This is by default the same where the controller is deployed. | `` |
141+
| `NAMESPACES` | The controller listens by default for all namespaces. This may be limited to a comma delimited list of dedicated namespaces. | `` |
142+
| `CONCURRENT` | The number of concurrent reconcile workers. | `1` |

chart/k8sdb-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ keywords:
1212
name: k8sdb-controller
1313
sources:
1414
- https://github.com/DoodleScheduling/k8sdb-controller
15-
version: 0.1.0
15+
version: 0.1.1

chart/k8sdb-controller/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Installs the [k8sdb-controller](https://github.com/DoodleScheduling/k8sdb-contro
77
To install the chart with the release name `k8sdb-controller`:
88

99
```console
10+
helm repo add k8sdb-controller https://doodlescheduling.github.io/k8sdb-controller/
1011
helm upgrade --install k8sdb-controller chart/k8sdb-controller
1112
```
1213

1314
This command deploys the k8sdb-controller with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
1415

1516
## Using the Chart
1617

17-
The chart comes with a ServiceMonitor for use with the [Prometheus Operator](https://github.com/helm/charts/tree/master/stable/prometheus-operator).
18-
If you're not using the Prometheus Operator, you can disable the ServiceMonitor by setting `serviceMonitor.enabled` to `false` and instead
19-
populate the `podAnnotations` as below:
18+
The chart comes with a ServiceMonitor/PodMonitor for use with the [Prometheus Operator](https://github.com/coreos/prometheus-operator) which are disabled by default.
19+
If you're not using the Prometheus Operator, you can populate the `podAnnotations` as below:
2020

2121
```yaml
2222
podAnnotations:

0 commit comments

Comments
 (0)