From 444ac6673c7ed04c98ec834116a7ff293ad46457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szczepan=20R=C4=99dzioch?= <> Date: Tue, 14 Jan 2025 00:01:36 +0100 Subject: [PATCH] feat: prefix for deploying in subpath --- charts/httpbingo/Chart.yaml | 4 ++-- charts/httpbingo/README.md | 5 +++-- charts/httpbingo/templates/deployment.yaml | 11 +++++++++-- charts/httpbingo/values.yaml | 3 +++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/charts/httpbingo/Chart.yaml b/charts/httpbingo/Chart.yaml index b6bdc34..e235898 100644 --- a/charts/httpbingo/Chart.yaml +++ b/charts/httpbingo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: httpbingo description: A reasonably complete and well-tested golang port of httpbin, with zero dependencies outside the go stdlib. type: application -version: 0.1.1 +version: 0.2.0 appVersion: "v2.2.2" home: https://github.com/estahn/charts/tree/main/charts/httpbingo keywords: @@ -13,7 +13,7 @@ maintainers: name: estahn annotations: artifacthub.io/changes: | - - "Update README.md" + - "feat: prefix for deploying in subpath" artifacthub.io/images: | - name: go-httpbin image: mccutchen/go-httpbin:v2.2.2 diff --git a/charts/httpbingo/README.md b/charts/httpbingo/README.md index a61fcdf..e141cab 100644 --- a/charts/httpbingo/README.md +++ b/charts/httpbingo/README.md @@ -1,6 +1,6 @@ # httpbingo -![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.2.2](https://img.shields.io/badge/AppVersion-v2.2.2-informational?style=flat-square) +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.2.2](https://img.shields.io/badge/AppVersion-v2.2.2-informational?style=flat-square) A reasonably complete and well-tested golang port of httpbin, with zero dependencies outside the go stdlib. @@ -17,6 +17,7 @@ A reasonably complete and well-tested golang port of httpbin, with zero dependen | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | +| appConfig.prefix | string | `"/"` | | | autoscaling.enabled | bool | `false` | | | autoscaling.maxReplicas | int | `100` | | | autoscaling.minReplicas | int | `1` | | @@ -48,4 +49,4 @@ A reasonably complete and well-tested golang port of httpbin, with zero dependen | tolerations | list | `[]` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/httpbingo/templates/deployment.yaml b/charts/httpbingo/templates/deployment.yaml index d31d48d..17d7219 100644 --- a/charts/httpbingo/templates/deployment.yaml +++ b/charts/httpbingo/templates/deployment.yaml @@ -33,18 +33,25 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- if ne .Values.appConfig.prefix "/" }} + - name: PREFIX + value: {{ .Values.appConfig.prefix }} + {{- end }} ports: - name: http containerPort: 8080 protocol: TCP livenessProbe: httpGet: - path: / + path: {{ .Values.appConfig.prefix }}{{ if ne .Values.appConfig.prefix "/" }}/{{ end }} port: http readinessProbe: httpGet: - path: / + path: {{ .Values.appConfig.prefix }}{{ if ne .Values.appConfig.prefix "/" }}/{{ end }} port: http + {{- if false }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/charts/httpbingo/values.yaml b/charts/httpbingo/values.yaml index b74fdbf..09a4700 100644 --- a/charts/httpbingo/values.yaml +++ b/charts/httpbingo/values.yaml @@ -36,6 +36,9 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +appConfig: + prefix: / + service: type: ClusterIP port: 80