Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/sophora-ugc-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ description: A Helm chart for Kubernetes to install Sophora UGC Proxy connected

type: application

version: 1.6.0
version: 1.7.0
annotations:
artifacthub.io/changes: |
- kind: added
description: "Add support for supplying API basic-auth credentials from a Kubernetes Secret"
description: "ServiceMonitor object for UGC proxy"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 2 additions & 1 deletion charts/sophora-ugc-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
{{- include "sophora-ugc-proxy.selectorLabels" . | nindent 4 }}
type: {{ .Values.service.type }}
ports:
- protocol: TCP
- name: http
protocol: TCP
targetPort: proxy
port: {{ .Values.service.port }}
15 changes: 15 additions & 0 deletions charts/sophora-ugc-proxy/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.serviceMonitor.enabled -}}
{{- $fullName := include "sophora-ugc-proxy.fullname" . -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $fullName }}
labels: {{- include "sophora-ugc-proxy.labels" . | nindent 8 }}
spec:
selector:
matchLabels: {{- include "sophora-ugc-proxy.selectorLabels" . | nindent 12 }}
endpoints:
- interval: {{ .Values.serviceMonitor.interval }}
port: http
path: {{ .Values.serviceMonitor.path }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/sophora-ugc-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,12 @@ gcp:

# extraDeploy is a list of full Kubernetes manifests that will be rendered additionally by this chart
extraDeploy: []


# serviceMonitor.enabled Whether the serviceMonitor resource should be deployed
# serviceMonitor.interval Prometheus scrape interval
# serviceMonitor.path HTTP path prometheus should use to scrape the application's metrics
serviceMonitor:
enabled: false
interval: 10s
path: "/actuator/prometheus"
12 changes: 9 additions & 3 deletions charts/sophora-ugc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.10.4
version: 2.11.0
annotations:
artifacthub.io/changes: |
- kind: fixed
description: "fix linting issue on enabled GCPHealthChecks and GCPBackendPolicies"
- kind: added
description: "ServiceMonitor objects for UGC and UGC multimedia"
- kind: changed
description: "The parameter `service.jolokia.clusterIP` is now `service.management.clusterIP`. The deployed service and the corresponding container port are now named `management` instead of `jolokia`."
- kind: changed
description: "The `gcp` parameters can now be configured for UGC and UGC multimedia independently at `ugc.gcp` and `ugcMultimedia.gcp`."


artifacthub.io/links: |
- name: Documentation for Sophora UGC
url: https://subshell.com/docs/ugc/
Expand Down
19 changes: 14 additions & 5 deletions charts/sophora-ugc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ For details, check the [UGC Multimedia Service documentation page](https://subsh

```yaml
service:
jolokia:
clusterIP: None
# Options for the services exposing UGC Webapp and UGC Multimedia
webapp:
type: LoadBalancer
# Options for the service exposing the UGC management port
management:
# Whether to deploy a management service
enabled: true
# Port on which the management service should listen
# Must match Spring's management.server.port property in ugc.config.
port: 1694
# ClusterIP for the management service
clusterIP: None

ingress:
enabled: false
Expand Down Expand Up @@ -59,9 +67,6 @@ ugc:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"
binariesStorage:
size: 1G
storageClass: standard

logback: |
<?xml version="1.0" encoding="UTF-8"?>
Expand Down Expand Up @@ -123,6 +128,10 @@ ugc:
rating:
primaryTypes: ["sophora-content-nt:story"]

healthCheck:
# Which port to use for Kubernetes liveness/readiness probes at the ugc container, "webapp" or "management"
port: webapp

ugcMultimedia:
enabled: false # enable to deploy UGC Multimedia Service
image:
Expand Down
36 changes: 34 additions & 2 deletions charts/sophora-ugc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,47 @@ spec:
ports:
- containerPort: {{ default 8080 (.Values.ugc.config.server).port }}
name: webapp
- containerPort: 1694
name: jolokia
{{- with .Values.service.management.port }}
- containerPort: {{ . }}
name: management
Comment thread
DanielRaapDev marked this conversation as resolved.
{{- end }}
volumeMounts:
- name: logback-xml
mountPath: /config/logback
- name: application-yml
mountPath: /config/application
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.startupProbe }}
startupProbe:
httpGet:
port: {{ $.Values.ugc.healthCheck.port }}
path: /actuator/health/liveness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
httpGet:
port: {{ $.Values.ugc.healthCheck.port }}
path: /actuator/health/liveness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
httpGet:
port: {{ $.Values.ugc.healthCheck.port }}
path: /actuator/health/readiness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
{{- if .Values.ugc.extraContainers }}
{{ include "common.tplvalues.render" (dict "value" .Values.ugc.extraContainers "context" $) | nindent 8 }}
{{- end }}
Expand Down
14 changes: 7 additions & 7 deletions charts/sophora-ugc/templates/gcpBackendPolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.gcp.enabled .Values.gcp.backendPolicy.enabled }}
{{- if and .Values.ugc.gcp.enabled .Values.ugc.gcp.backendPolicy.enabled }}
{{- $fullName := printf "%s-webapp" (include "sophora-ugc.fullname" .) -}}
{{- $labels := include "sophora-ugc.labels" . -}}
apiVersion: networking.gke.io/v1
Expand All @@ -9,27 +9,27 @@ metadata:
{{- $labels | nindent 4 }}
spec:
default:
{{- with .Values.gcp.backendPolicy.logging }}
{{- with .Values.ugc.gcp.backendPolicy.logging }}
logging:
enabled: {{ .enabled | default false }}
{{- if .enabled }}
sampleRate: {{ .sampleRate | default 1000000 }}
{{- end }}
{{- end }}
{{- with .Values.gcp.backendPolicy.sessionAffinity }}
{{- with .Values.ugc.gcp.backendPolicy.sessionAffinity }}
sessionAffinity:
type: {{ .type | default "NONE" }}
{{- if or (eq .type "GENERATED_COOKIE") (eq .type "HTTP_COOKIE") }}
cookieTtlSec: {{ .cookieTtlSec | default 0 }}
{{- end }}
{{- end }}
connectionDraining:
drainingTimeoutSec: {{ dig "drainingTimeoutSec" 0 (.Values.gcp.backendPolicy.connectionDraining | default dict) }}
timeoutSec: {{ .Values.gcp.backendPolicy.timeoutSec | default 30 }}
{{- with .Values.gcp.backendPolicy.securityPolicy }}
drainingTimeoutSec: {{ dig "drainingTimeoutSec" 0 (.Values.ugc.gcp.backendPolicy.connectionDraining | default dict) }}
timeoutSec: {{ .Values.ugc.gcp.backendPolicy.timeoutSec | default 30 }}
{{- with .Values.ugc.gcp.backendPolicy.securityPolicy }}
securityPolicy: {{ . | quote }}
{{- end }}
{{- with .Values.gcp.backendPolicy.iap }}
{{- with .Values.ugc.gcp.backendPolicy.iap }}
iap:
enabled: {{ .enabled | default false }}
{{- if .enabled }}
Expand Down
10 changes: 5 additions & 5 deletions charts/sophora-ugc/templates/gcpHealthCheck.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.gcp.enabled .Values.gcp.healthCheck.enabled }}
{{- if and .Values.ugc.gcp.enabled .Values.ugc.gcp.healthCheck.enabled }}
{{- $fullName := include "sophora-ugc.fullname" . -}}
{{- $labels := include "sophora-ugc.labels" . -}}
apiVersion: networking.gke.io/v1
Expand All @@ -12,15 +12,15 @@ spec:
config:
type: HTTP
httpHealthCheck:
{{- with .Values.gcp.healthCheck.port }}
{{- with .Values.ugc.gcp.healthCheck.port }}
port: {{ . }}
{{- end }}
{{- with .Values.gcp.healthCheck.portName }}
{{- with .Values.ugc.gcp.healthCheck.portName }}
portName: {{ . | quote }}
{{- end }}
requestPath: {{ .Values.gcp.healthCheck.path | quote }}
requestPath: {{ .Values.ugc.gcp.healthCheck.path | quote }}
logConfig:
enabled: {{ .Values.gcp.healthCheck.logging }}
enabled: {{ .Values.ugc.gcp.healthCheck.logging }}
targetRef:
group: ""
kind: Service
Expand Down
15 changes: 0 additions & 15 deletions charts/sophora-ugc/templates/jolokia-service.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions charts/sophora-ugc/templates/management-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.service.management.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "sophora-ugc.fullname" . }}-management
labels:
{{- include "sophora-ugc.labels" . | nindent 4 }}
sophora-ugc.service-type: management
spec:
clusterIP: {{ .Values.service.management.clusterIP }}
ports:
- name: management
port: {{ .Values.service.management.port }}
targetPort: {{ .Values.service.management.port }}
protocol: TCP
selector:
{{- include "sophora-ugc.selectorLabels" . | nindent 4 }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/sophora-ugc/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.ugc.serviceMonitor.enabled -}}
{{- $fullName := include "sophora-ugc.fullname" . -}}

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $fullName }}
labels: {{- include "sophora-ugc.labels" . | nindent 8 }}
spec:
selector:
matchLabels:
{{- include "sophora-ugc.selectorLabels" . | nindent 12 }}
sophora-ugc.service-type: {{ .Values.ugc.serviceMonitor.target }}
endpoints:
- interval: {{ .Values.ugc.serviceMonitor.interval }}
port: {{ .Values.ugc.serviceMonitor.target }}
path: {{ .Values.ugc.serviceMonitor.path }}
Comment thread
DanielRaapDev marked this conversation as resolved.
{{- end }}
10 changes: 5 additions & 5 deletions charts/sophora-ugc/templates/ugc-multimedia/gcpHealthCheck.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.ugcMultimedia.enabled .Values.gcp.enabled .Values.gcp.healthCheck.enabled }}
{{- if and .Values.ugcMultimedia.enabled .Values.ugcMultimedia.gcp.enabled .Values.ugcMultimedia.gcp.healthCheck.enabled }}
{{- $fullName := include "sophora-ugc-multimedia.fullname" . -}}
{{- $labels := include "sophora-ugc-multimedia.labels" . -}}
apiVersion: networking.gke.io/v1
Expand All @@ -12,15 +12,15 @@ spec:
config:
type: HTTP
httpHealthCheck:
{{- with .Values.gcp.healthCheck.port }}
{{- with .Values.ugcMultimedia.gcp.healthCheck.port }}
port: {{ . }}
{{- end }}
{{- with .Values.gcp.healthCheck.portName }}
{{- with .Values.ugcMultimedia.gcp.healthCheck.portName }}
portName: {{ . | quote }}
{{- end }}
requestPath: {{ .Values.gcp.healthCheck.path | quote }}
requestPath: {{ .Values.ugcMultimedia.gcp.healthCheck.path | quote }}
logConfig:
enabled: {{ .Values.gcp.healthCheck.logging }}
enabled: {{ .Values.ugcMultimedia.gcp.healthCheck.logging }}
targetRef:
group: ""
kind: Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ spec:
type: {{ .Values.service.webapp.type }}
loadBalancerIP: {{ .Values.service.webapp.loadBalancerIP }}
ports:
- port: 80
- name: http
port: 80
targetPort: {{ default 8080 (.Values.ugcMultimedia.config.server).port }}
protocol: TCP
selector:
Expand Down
15 changes: 15 additions & 0 deletions charts/sophora-ugc/templates/ugc-multimedia/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.ugcMultimedia.enabled .Values.ugcMultimedia.serviceMonitor.enabled -}}
{{- $fullName := include "sophora-ugc-multimedia.fullname" . -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $fullName }}
labels: {{- include "sophora-ugc-multimedia.labels" . | nindent 8 }}
spec:
selector:
matchLabels: {{- include "sophora-ugc-multimedia.selectorLabels" . | nindent 12 }}
endpoints:
- interval: {{ .Values.ugcMultimedia.serviceMonitor.interval }}
port: http
path: {{ .Values.ugcMultimedia.serviceMonitor.path }}
{{- end }}
30 changes: 30 additions & 0 deletions charts/sophora-ugc/templates/ugc-multimedia/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,36 @@ spec:
{{ end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.startupProbe }}
startupProbe:
httpGet:
port: ugc-multimedia
path: /actuator/health/liveness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
httpGet:
port: ugc-multimedia
path: /actuator/health/liveness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
httpGet:
port: ugc-multimedia
path: /actuator/health/readiness
failureThreshold: {{ .failureThreshold }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
{{- end }}
volumes:
- name: application-yml
configMap:
Expand Down
4 changes: 3 additions & 1 deletion charts/sophora-ugc/templates/webapp-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "sophora-ugc.fullname" . }}-webapp
labels:
{{- include "sophora-ugc.labels" . | nindent 4 }}
sophora-ugc.service-type: webapp
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -14,7 +15,8 @@ spec:
loadBalancerIP: {{ .Values.service.webapp.loadBalancerIP }}
{{- end }}
ports:
- port: 80
- name: webapp
port: 80
targetPort: {{ default 8080 (.Values.ugc.config.server).port }}
protocol: TCP
selector:
Expand Down
Loading
Loading