diff --git a/enterprise/blocky/1.0.6/CHANGELOG.md b/enterprise/blocky/1.0.7/CHANGELOG.md similarity index 87% rename from enterprise/blocky/1.0.6/CHANGELOG.md rename to enterprise/blocky/1.0.7/CHANGELOG.md index 29655e5166..5876588995 100644 --- a/enterprise/blocky/1.0.6/CHANGELOG.md +++ b/enterprise/blocky/1.0.7/CHANGELOG.md @@ -2,6 +2,20 @@ +## [blocky-1.0.7](https://github.com/truecharts/charts/compare/blocky-1.0.6...blocky-1.0.7) (2022-09-26) + +### Chore + +- Auto-update chart README [skip ci] + - Auto-update chart README [skip ci] + + ### Fix + +- fix GUI apiurl and prometheus metrics ([#3908](https://github.com/truecharts/charts/issues/3908)) + + + + ## [blocky-1.0.6](https://github.com/truecharts/charts/compare/blocky-1.0.5...blocky-1.0.6) (2022-09-25) ### Chore @@ -83,17 +97,3 @@ ### Chore - move blocky to enterprise ([#3875](https://github.com/truecharts/charts/issues/3875)) - - - - -## [blocky-0.0.4](https://github.com/truecharts/charts/compare/blocky-0.0.3...blocky-0.0.4) (2022-09-24) - -### Chore - -- Auto-update chart README [skip ci] - - ### Fix - -- Finish up UI ([#3866](https://github.com/truecharts/charts/issues/3866)) - diff --git a/enterprise/blocky/1.0.6/Chart.lock b/enterprise/blocky/1.0.7/Chart.lock similarity index 100% rename from enterprise/blocky/1.0.6/Chart.lock rename to enterprise/blocky/1.0.7/Chart.lock diff --git a/enterprise/blocky/1.0.6/Chart.yaml b/enterprise/blocky/1.0.7/Chart.yaml similarity index 98% rename from enterprise/blocky/1.0.6/Chart.yaml rename to enterprise/blocky/1.0.7/Chart.yaml index e0ee85d47f..48e78d3509 100644 --- a/enterprise/blocky/1.0.6/Chart.yaml +++ b/enterprise/blocky/1.0.7/Chart.yaml @@ -26,7 +26,7 @@ sources: - https://github.com/0xERR0R/blocky - https://github.com/Mozart409/blocky-frontend - https://hub.docker.com/r/spx01/blocky -version: 1.0.6 +version: 1.0.7 annotations: truecharts.org/catagories: | - network diff --git a/enterprise/blocky/1.0.6/README.md b/enterprise/blocky/1.0.7/README.md similarity index 100% rename from enterprise/blocky/1.0.6/README.md rename to enterprise/blocky/1.0.7/README.md diff --git a/enterprise/blocky/1.0.6/app-readme.md b/enterprise/blocky/1.0.7/app-readme.md similarity index 100% rename from enterprise/blocky/1.0.6/app-readme.md rename to enterprise/blocky/1.0.7/app-readme.md diff --git a/enterprise/blocky/1.0.6/charts/common-10.6.1.tgz b/enterprise/blocky/1.0.7/charts/common-10.6.1.tgz similarity index 100% rename from enterprise/blocky/1.0.6/charts/common-10.6.1.tgz rename to enterprise/blocky/1.0.7/charts/common-10.6.1.tgz diff --git a/enterprise/blocky/1.0.6/charts/redis-3.0.84.tgz b/enterprise/blocky/1.0.7/charts/redis-3.0.84.tgz similarity index 100% rename from enterprise/blocky/1.0.6/charts/redis-3.0.84.tgz rename to enterprise/blocky/1.0.7/charts/redis-3.0.84.tgz diff --git a/enterprise/blocky/1.0.6/ci/k8sgateway-values.yaml b/enterprise/blocky/1.0.7/ci/k8sgateway-values.yaml similarity index 100% rename from enterprise/blocky/1.0.6/ci/k8sgateway-values.yaml rename to enterprise/blocky/1.0.7/ci/k8sgateway-values.yaml diff --git a/enterprise/blocky/1.0.6/ci/standalone-values.yaml b/enterprise/blocky/1.0.7/ci/standalone-values.yaml similarity index 100% rename from enterprise/blocky/1.0.6/ci/standalone-values.yaml rename to enterprise/blocky/1.0.7/ci/standalone-values.yaml diff --git a/enterprise/blocky/1.0.6/ix_values.yaml b/enterprise/blocky/1.0.7/ix_values.yaml similarity index 87% rename from enterprise/blocky/1.0.6/ix_values.yaml rename to enterprise/blocky/1.0.7/ix_values.yaml index 84853e033f..030c56084c 100644 --- a/enterprise/blocky/1.0.6/ix_values.yaml +++ b/enterprise/blocky/1.0.7/ix_values.yaml @@ -31,8 +31,17 @@ blockyConfig: {} # default: # - 1.1.1.1 +# -- Configures blocky webUI +# Requires apiURL or ingress +webUI: + # -- Enable the WebUI + enabled: true + # -- url to the api, used by the WebUI. Only required when not using ingress + apiURL: "127.0.0.1:4000" + +# -- some general blocky settings blocky: - enableWebUI: true + # -- Enable prometheus annotations enablePrometheus: true probes: @@ -338,6 +347,33 @@ k8sgateway: - name: tls_servername value: cloudflare-dns.com +metrics: + # -- Enable and configure a Prometheus serviceMonitor for the chart under this key. + # @default -- See values.yaml + enabled: false + serviceMonitor: + interval: 1m + scrapeTimeout: 30s + labels: {} + # -- Enable and configure Prometheus Rules for the chart under this key. + # @default -- See values.yaml + prometheusRule: + enabled: false + labels: {} + # -- Configure additionial rules for the chart under this key. + # @default -- See prometheusrules.yaml + rules: + [] + # - alert: UnifiPollerAbsent + # annotations: + # description: Unifi Poller has disappeared from Prometheus service discovery. + # summary: Unifi Poller is down. + # expr: | + # absent(up{job=~".*unifi-poller.*"} == 1) + # for: 5m + # labels: + # severity: critical + redis: enabled: true existingSecret: "rediscreds" diff --git a/enterprise/blocky/1.0.6/questions.yaml b/enterprise/blocky/1.0.7/questions.yaml similarity index 99% rename from enterprise/blocky/1.0.6/questions.yaml rename to enterprise/blocky/1.0.7/questions.yaml index 12b912f033..3a4ad35b8a 100644 --- a/enterprise/blocky/1.0.6/questions.yaml +++ b/enterprise/blocky/1.0.7/questions.yaml @@ -164,25 +164,25 @@ questions: label: Arg schema: type: string - - variable: blocky + - variable: webUI group: Container Configuration - label: Blocky Configuration + label: WebUI Configuration schema: additional_attrs: true type: dict attrs: - - variable: enableWebUI + - variable: enabled label: Enable Web UI description: Enables Web UI schema: type: boolean default: true - - variable: enablePrometheus - label: Enable Prometheus Endpoint - description: Enables Prometheus Endpoint + - variable: apiURL + label: API URL + description: API URL for webUI, including port. Only used when not using ingress schema: - type: boolean - default: true + type: string + default: "http://127.0.0.1:4000" - variable: overrideDefaults group: Container Configuration label: Override Default Upstreams @@ -2628,6 +2628,41 @@ questions: $ref: - "definitions/gpuConfiguration" attrs: [] + - variable: metrics + group: Metrics + label: Prometheus Metrics + schema: + additional_attrs: true + type: dict + attrs: + - variable: enabled + label: Enabled + description: Enable Prometheus Metrics + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: serviceMonitor + label: Service Monitor Settings + schema: + additional_attrs: true + type: dict + attrs: + - variable: interval + label: Scrape Interval + description: Scrape interval time + schema: + type: string + default: 1m + required: true + - variable: scrapeTimeout + label: Scrape Timeout + description: Scrape timeout Time + schema: + type: string + default: 30s + required: true # - variable: autoscaling # group: Advanced # label: (Advanced) Horizontal Pod Autoscaler diff --git a/enterprise/blocky/1.0.6/templates/_blockyConfig.tpl b/enterprise/blocky/1.0.7/templates/_blockyConfig.tpl similarity index 99% rename from enterprise/blocky/1.0.6/templates/_blockyConfig.tpl rename to enterprise/blocky/1.0.7/templates/_blockyConfig.tpl index 59153071dd..dda147e093 100644 --- a/enterprise/blocky/1.0.6/templates/_blockyConfig.tpl +++ b/enterprise/blocky/1.0.7/templates/_blockyConfig.tpl @@ -22,11 +22,9 @@ redis: required: true connectionAttempts: 10 connectionCooldown: 3s -{{- if .Values.blocky.enablePrometheus }} prometheus: enable: true path: /metrics -{{- end }} upstream: default: {{- .Values.defaultUpstreams | toYaml | nindent 8 }} diff --git a/enterprise/blocky/1.0.6/templates/_k8sgateway.tpl b/enterprise/blocky/1.0.7/templates/_k8sgateway.tpl similarity index 100% rename from enterprise/blocky/1.0.6/templates/_k8sgateway.tpl rename to enterprise/blocky/1.0.7/templates/_k8sgateway.tpl diff --git a/enterprise/blocky/1.0.6/templates/_webui.tpl b/enterprise/blocky/1.0.7/templates/_webui.tpl similarity index 83% rename from enterprise/blocky/1.0.6/templates/_webui.tpl rename to enterprise/blocky/1.0.7/templates/_webui.tpl index 881bee2058..4aab724576 100644 --- a/enterprise/blocky/1.0.6/templates/_webui.tpl +++ b/enterprise/blocky/1.0.7/templates/_webui.tpl @@ -33,4 +33,16 @@ startupProbe: timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }} periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }} failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }} +env: + - name: NODE_ENV + value: "production" +{{- $url := .Values.webUI.apiURL }} +{{- if .Values.ingress.main.enabled }} + {{- with (first .Values.ingress.main.hosts) }} + {{- $url = ( printf "https://%s" .host ) }} + {{- end }} +{{- else }} +{{- end }} + - name: API_URL + value: "{{ $url }}" {{- end -}} diff --git a/enterprise/blocky/1.0.6/templates/common.yaml b/enterprise/blocky/1.0.7/templates/common.yaml similarity index 64% rename from enterprise/blocky/1.0.6/templates/common.yaml rename to enterprise/blocky/1.0.7/templates/common.yaml index deeed907d3..771a3d532c 100644 --- a/enterprise/blocky/1.0.6/templates/common.yaml +++ b/enterprise/blocky/1.0.7/templates/common.yaml @@ -34,9 +34,9 @@ volumeSpec: {{- $_ := set .Values.podAnnotations "prometheus.io/scrape" "true" -}} {{- $_ := set .Values.podAnnotations "prometheus.io/path" "/metrics" -}} -{{- $_ := set .Values.podAnnotations "prometheus.io/port" (.Values.service.http.ports.http.targetPort | toString) -}} +{{- $_ := set .Values.podAnnotations "prometheus.io/port" (.Values.service.http.ports.http.port | toString) -}} -{{- if .Values.blocky.enableWebUI -}} +{{- if .Values.webUI.enabled -}} {{- $_ := set .Values.additionalContainers "frontend" (include "blocky.frontend" . | fromYaml) -}} {{- end -}} @@ -46,5 +46,32 @@ volumeSpec: {{- $_ := set .Values.additionalContainers "k8sgateway" (include "k8sgateway.container" . | fromYaml) -}} {{- end -}} +{{/* Define path for api */}} +{{- define "blocky.api" -}} +{{- $fullname := include "tc.common.names.fullname" . -}} +path: "/api" +# -- Ignored if not kubeVersion >= 1.14-0 +pathType: Prefix +service: + # -- Overrides the service name reference for this path + name: {{ printf "%s-http" $fullname }} + port: {{ .Values.service.http.ports.http.port }} +{{- end -}} + +{{/* inject websocket path to all main ingress hosts*/}} +{{- define "blocky.apiinjector" -}} +{{- $path := list (include "blocky.api" . | fromYaml) -}} +{{- if .Values.ingress.main.enabled }} +{{- range .Values.ingress.main.hosts }} +{{- $newpaths := list }} +{{- $newpaths := concat .paths $path }} +{{- $_ := set . "paths" ( deepCopy $newpaths ) -}} +{{- end }} +{{- end }} +{{- end -}} + +{{/* inject api paths in ingress */}} +{{- include "blocky.apiinjector" . }} + {{/* Render the templates */}} {{ include "tc.common.loader.apply" . }} diff --git a/enterprise/blocky/1.0.7/templates/prometheusrules.yaml b/enterprise/blocky/1.0.7/templates/prometheusrules.yaml new file mode 100644 index 0000000000..35b77edf0f --- /dev/null +++ b/enterprise/blocky/1.0.7/templates/prometheusrules.yaml @@ -0,0 +1,18 @@ +{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ include "tc.common.names.fullname" . }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} + {{- with .Values.metrics.prometheusRule.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + groups: + - name: {{ include "tc.common.names.fullname" . }} + rules: + {{- with .Values.metrics.prometheusRule.rules }} + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/enterprise/blocky/1.0.7/templates/servicemonitor.yaml b/enterprise/blocky/1.0.7/templates/servicemonitor.yaml new file mode 100644 index 0000000000..8b6244bb3a --- /dev/null +++ b/enterprise/blocky/1.0.7/templates/servicemonitor.yaml @@ -0,0 +1,24 @@ +{{- if .Values.metrics.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "tc.common.names.fullname" . }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} + {{- with .Values.metrics.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "tc.common.labels.selectorLabels" . | nindent 6 }} + endpoints: + - port: {{ .Values.service.http.ports.http.port }} + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + path: /metrics +{{- end }} diff --git a/enterprise/blocky/1.0.6/values.yaml b/enterprise/blocky/1.0.7/values.yaml similarity index 100% rename from enterprise/blocky/1.0.6/values.yaml rename to enterprise/blocky/1.0.7/values.yaml