Skip to content

Commit

Permalink
feat: add install manifest (#48)
Browse files Browse the repository at this point in the history
* feat: add install manifest

Signed-off-by: Vishal Choudhary <[email protected]>

* fix: lint

Signed-off-by: Vishal Choudhary <[email protected]>

* fix: codegen

Signed-off-by: Vishal Choudhary <[email protected]>

* Update Makefile

Co-authored-by: Charles-Edouard Brétéché <[email protected]>
Signed-off-by: Vishal Choudhary <[email protected]>

* fix: update manifest

Signed-off-by: Vishal Choudhary <[email protected]>

---------

Signed-off-by: Vishal Choudhary <[email protected]>
Co-authored-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
vishal-chdhry and eddycharly authored Feb 2, 2024
1 parent f9aa26d commit 78ed2cc
Show file tree
Hide file tree
Showing 5 changed files with 539 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ KO_VERSION := v0.14.1
HELM := $(TOOLS_DIR)/helm
HELM_VERSION := v3.10.1
TOOLS := $(REGISTER_GEN) $(OPENAPI_GEN) $(KIND) $(KO) $(HELM)
ifeq ($(GOOS), darwin)
SED := gsed
else
SED := sed
endif

$(REGISTER_GEN):
@echo Install register-gen... >&2
Expand Down Expand Up @@ -129,10 +134,18 @@ codegen-helm-docs: ## Generate helm docs
@echo Generate helm docs... >&2
@docker run -v ${PWD}/charts:/work -w /work jnorwood/helm-docs:v1.11.0 -s file

.PHONY: codegen-manifest-install-latest
codegen-install-manifest: $(HELM) ## Create install manifest
@echo Generate latest install manifest... >&2
@$(HELM) template reports-server --namespace reports-server ./charts/reports-server/ \
| $(SED) -e '/^#.*/d' \
> ./config/install.yaml

.PHONY: codegen
codegen: ## Rebuild all generated code and docs
codegen: codegen-helm-docs
codegen: codegen-openapi
codegen: codegen-install-manifest

.PHONY: verify-codegen
verify-codegen: codegen ## Verify all generated code and docs are up to date
Expand Down
3 changes: 2 additions & 1 deletion charts/reports-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ helm install reports-server --namespace reports-server --create-namespace report
| postgresql.enabled | bool | `true` | Deploy postgresql dependency chart |
| postgresql.auth.postgresPassword | string | `"reports"` | |
| postgresql.auth.database | string | `"reportsdb"` | |
| ephemeralReportsStorage.enabled | bool | `true` | Store ephemeral reports in reports-server |
| apiServices.enabled | bool | `true` | Store reports in reports-server |
| apiServices.installEphemeralReportsService | bool | `true` | Store ephemeral reports in reports-server |
| nameOverride | string | `""` | Name override |
| fullnameOverride | string | `""` | Full name override |
| replicaCount | int | `1` | Number of pod replicas |
Expand Down
5 changes: 4 additions & 1 deletion charts/reports-server/templates/api-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.apiServices.enabled }}
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
Expand All @@ -16,7 +18,7 @@ spec:
version: v1alpha2
versionPriority: 100

{{- if .Values.ephemeralReportsStorage.enabled }}
{{- if .Values.apiServices.installEphemeralReportsService }}
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
Expand All @@ -35,4 +37,5 @@ spec:
namespace: {{ $.Release.Namespace }}
version: v1
versionPriority: 100
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions charts/reports-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ postgresql:

database: reportsdb

ephemeralReportsStorage:
apiServices:

# -- Store ephemeral reports in reports-server
# -- Store reports in reports-server
enabled: true

# -- Store ephemeral reports in reports-server
installEphemeralReportsService: true

# -- Name override
nameOverride: ""

Expand Down
Loading

0 comments on commit 78ed2cc

Please sign in to comment.