Skip to content

Commit

Permalink
Merge pull request #39 from WDaan/main
Browse files Browse the repository at this point in the history
perf: allow yaml config format
  • Loading branch information
GeorgeMac authored Mar 3, 2023
2 parents 347ee93 + 623b53b commit 6a6f7e8
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fi
- name: Run chart-testing (lint)
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
run: ct lint --lint-conf lintconf.yaml --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
uses: helm/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion charts/flipt/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: flipt
home: https://flipt.io
description: Flipt is an open source, self-hosted feature flag solution.
type: application
version: 0.25.0
version: 0.25.1
appVersion: v1.19.1
maintainers:
- name: Flipt
Expand Down
12 changes: 11 additions & 1 deletion charts/flipt/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,14 @@ Return the proper Storage Class
{{- printf "storageClassName: %s" $storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Pod annotations
*/}}
{{- define "common.classes.podAnnotations" }}
{{- if .Values.podAnnotations -}}
{{- tpl (toYaml .Values.podAnnotations) . | nindent 0 -}}
{{- end -}}
{{- printf "checksum/config: %v" (join "," .Values.flipt | sha256sum) -}}
{{- end -}}
9 changes: 1 addition & 8 deletions charts/flipt/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,4 @@ metadata:
{{- include "flipt.labels" . | nindent 4 }}
data:
default.yml: |
log:
level: WARN
server:
protocol: http
host: 0.0.0.0
http_port: 8080
grpc_port: 9000
{{ toYaml .Values.flipt.config | nindent 4 }}
9 changes: 3 additions & 6 deletions charts/flipt/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ spec:
{{- include "flipt.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations: {{- include "common.classes.podAnnotations" . | nindent 8 }}
labels:
{{- include "flipt.selectorLabels" . | nindent 8 }}
spec:
Expand All @@ -35,10 +32,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ coalesce .Values.flipt.httpPort .Values.containerPorts.http }}
containerPort: {{ coalesce ((.Values.flipt.config).server).http_port .Values.flipt.httpPort .Values.containerPorts.http }}
protocol: TCP
- name: grpc
containerPort: {{ coalesce .Values.flipt.grpcPort .Values.containerPorts.grpc }}
containerPort: {{ coalesce ((.Values.flipt.config).server).grpc_port .Values.flipt.grpcPort .Values.containerPorts.grpc }}
protocol: TCP
env:
- name: FLIPT_META_STATE_DIRECTORY
Expand Down
54 changes: 48 additions & 6 deletions charts/flipt/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ service:
type: ClusterIP
httpPort: 8080
grpcPort: 9000
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/path: "/metrics"
# prometheus.io/port: "8080"

ingress:
enabled: false
className: ""
annotations:
{}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
Expand All @@ -58,8 +61,7 @@ ingress:
# hosts:
# - chart-example.local

resources:
{}
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
Expand All @@ -75,9 +77,7 @@ autoscaling:
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

## Container ports
Expand Down Expand Up @@ -123,3 +123,45 @@ flipt:
# - name: FLIPT_LOG_LEVEL
# value: debug
extraEnvVars: []
config:
log:
level: INFO
encoding: console
grpc_level: ERROR

ui:
enabled: true

cors:
enabled: false
allowed_origins: "*"

cache:
enabled: false
backend: memory
ttl: 60s
redis:
host: localhost
port: 6379
memory:
eviction_interval: 5m # Evict Expired Items Every 5m

server:
protocol: http
host: 0.0.0.0
https_port: 443
http_port: 8080
grpc_port: 9000

db:
url: file:/var/opt/flipt/flipt.db
max_idle_conn: 2
max_open_conn: 0 # unlimited
conn_max_lifetime: 0 # unlimited

tracing:
enabled: false
exporter: jaeger
jaeger:
host: localhost
port: 6831

0 comments on commit 6a6f7e8

Please sign in to comment.