Skip to content

Commit 0c8e208

Browse files
oliverbaehlerDonatien26
authored andcommitted
feat(helm): add values and helm-docs
1 parent 422aea4 commit 0c8e208

File tree

5 files changed

+71
-19
lines changed

5 files changed

+71
-19
lines changed

.github/workflows/ci-chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
python-version: "3.x"
3131
check-latest: true
3232

33+
- name: Run docs-testing (helm-docs)
34+
id: helm-docs
35+
run: |
36+
make helm-docs
37+
if [[ $(git diff --stat) != '' ]]; then
38+
echo -e '\033[0;31mDocumentation outdated! (Run make helm-docs locally and commit)\033[0m ❌'
39+
git diff --color
40+
exit 1
41+
else
42+
echo -e '\033[0;32mDocumentation up to date\033[0m ✔'
43+
fi
44+
3345
- name: Set up chart-testing
3446
uses: helm/[email protected]
3547

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,21 @@ catalog-push: ## Push a catalog image.
283283
.PHONY: go-unittest
284284
go-unittest: ## Build the bundle image.
285285
go test -v ./...
286+
287+
.PHONY: helm-docs
288+
helm-docs: helm-doc
289+
$(HELM_DOCS) --chart-search-root ./deploy/charts
290+
291+
HELM_DOCS := $(LOCALBIN)/helm-docs
292+
HELM_DOCS_VERSION := v1.14.1
293+
HELM_DOCS_LOOKUP := norwoodj/helm-docs
294+
helm-doc:
295+
@test -s $(HELM_DOCS) || $(call go-install-tool,$(HELM_DOCS),github.com/$(HELM_DOCS_LOOKUP)/cmd/helm-docs@$(HELM_DOCS_VERSION))
296+
297+
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
298+
define go-install-tool
299+
[ -f $(1) ] || { \
300+
set -e ;\
301+
GOBIN=$(LOCALBIN) go install $(2) ;\
302+
}
303+
endef
Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
# s3-operator
22

3-
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.0](https://img.shields.io/badge/AppVersion-0.8.0-informational?style=flat-square)
3+
![Version: 0.9.0-rc1](https://img.shields.io/badge/Version-0.9.0--rc1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.13.0-rc1](https://img.shields.io/badge/AppVersion-v0.13.0--rc1-informational?style=flat-square)
44

55
A Helm chart for deploying an operator to manage S3 resources (eg buckets, policies)
66

77
## Values
88

99
| Key | Type | Default | Description |
1010
|-----|------|---------|-------------|
11-
| controllerManager.manager.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
12-
| controllerManager.manager.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | |
11+
| controllerManager.manager.containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | Set the Container securityContext |
12+
| controllerManager.manager.extraArgs | list | `[]` | Additional Arguments |
13+
| controllerManager.manager.extraEnv | object | `{}` | Additional Environment Variables |
1314
| controllerManager.manager.image.repository | string | `"inseefrlab/s3-operator"` | |
14-
| controllerManager.manager.image.tag | string | `"latest"` | |
15+
| controllerManager.manager.image.tag | string | `nil` | |
1516
| controllerManager.manager.imagePullPolicy | string | `"IfNotPresent"` | |
16-
| controllerManager.manager.imagePullSecrets | list | `[]` | |
17-
| controllerManager.manager.resources.limits.cpu | string | `"1000m"` | |
18-
| controllerManager.manager.resources.limits.memory | string | `"512Mi"` | |
19-
| controllerManager.manager.resources.requests.cpu | string | `"50m"` | |
20-
| controllerManager.manager.resources.requests.memory | string | `"64Mi"` | |
21-
| controllerManager.replicas | int | `1` | |
17+
| controllerManager.manager.imagePullSecrets | list | `[]` | Configuration for `imagePullSecrets` so that you can use a private images registry. |
18+
| controllerManager.manager.podAnnotations | object | `{}` | Annotations to add to the pod. |
19+
| controllerManager.manager.podLabels | object | `{}` | Labels to add to the pod. |
20+
| controllerManager.manager.podSecurityContext | object | `{"runAsNonRoot":true}` | Set the Pod securityContext |
21+
| controllerManager.manager.priorityClassName | string | `""` | Set the priority class name |
22+
| controllerManager.manager.resources | object | `{"limits":{"cpu":"1000m","memory":"512Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}` | Set the resources |
23+
| controllerManager.replicas | int | `1` | Amount of Replicas |
2224
| crds.install | bool | `true` | Install and upgrade CRDs |
2325
| crds.keep | bool | `true` | Keep CRDs on chart uninstall |
24-
| kubernetesClusterDomain | string | `"cluster.local"` | |
25-
| s3.deletion.bucket | bool | `false` | |
26-
| s3.deletion.path | bool | `false` | |
27-
| s3.deletion.policy | bool | `false` | |
28-
| s3.endpointUrl | string | `"localhost:9000"` | |
29-
| s3.existingSecret | string | `"my-s3-operator-auth-secret"` | |
26+
| kubernetes.clusterDomain | string | `"cluster.local"` | |
27+
| kubernetes.overrideExistingSecret | bool | `false` | |
28+
| s3 | object | `{"default":{"accessKey":"accessKey","deletion":{"bucket":true,"path":false,"policy":false,"s3user":false},"enabled":false,"region":"us-east-1","s3Provider":"minio","secretKey":"secretKey","url":"https://localhost:9000"}}` | Default S3 Instance |
3029

31-
----------------------------------------------
32-
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

deploy/charts/s3-operator/templates/deployment.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ spec:
1919
labels:
2020
control-plane: controller-manager
2121
{{- include "s3-operator.selectorLabels" . | nindent 8 }}
22+
{{- with .Values.podLabels }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
2225
annotations:
2326
kubectl.kubernetes.io/default-container: manager
27+
{{- with .Values.podAnnotations }}
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
2430
spec:
2531
{{- with .Values.controllerManager.manager.imagePullSecrets }}
2632
imagePullSecrets:
@@ -68,6 +74,7 @@ spec:
6874
securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext
6975
| nindent 10 }}
7076
securityContext:
71-
runAsNonRoot: true
77+
{{- toYaml .Values.controllerManager.manager.podSecurityContext | nindent 10 }}
78+
priorityClassName: {{ .Values.priorityClassName }}
7279
serviceAccountName: {{ include "s3-operator.fullname" . }}-controller-manager
7380
terminationGracePeriodSeconds: 10

deploy/charts/s3-operator/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,50 @@ crds:
66

77
controllerManager:
88
manager:
9+
# -- Set the priority class name
10+
priorityClassName: '' # system-cluster-critical
11+
# -- Set the Pod securityContext
12+
podSecurityContext:
13+
runAsNonRoot: true
14+
# -- Annotations to add to the pod.
15+
podAnnotations: {}
16+
# -- Labels to add to the pod.
17+
podLabels: {}
18+
# -- Set the Container securityContext
919
containerSecurityContext:
1020
allowPrivilegeEscalation: false
1121
capabilities:
1222
drop:
1323
- ALL
1424
image:
25+
# Image Repository
1526
repository: inseefrlab/s3-operator
1627
# Use the charts appVersion as a default
1728
tag: null
29+
# -- Set the image pull policy
1830
imagePullPolicy: IfNotPresent
31+
# -- Configuration for `imagePullSecrets` so that you can use a private images registry.
1932
imagePullSecrets: []
33+
# -- Set the resources
2034
resources:
2135
limits:
2236
cpu: 1000m
2337
memory: 512Mi
2438
requests:
2539
cpu: 50m
2640
memory: 64Mi
41+
# -- Additional Arguments
2742
extraArgs: []
43+
# -- Additional Environment Variables
2844
extraEnv: {}
45+
# -- Amount of Replicas
2946
replicas: 1
3047

3148
kubernetes:
3249
clusterDomain: cluster.local
3350
overrideExistingSecret: false
3451

52+
# -- Default S3 Instance
3553
s3:
3654
default:
3755
enabled: false

0 commit comments

Comments
 (0)