-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
604c84b
commit f965fe1
Showing
65 changed files
with
11,058 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{- define "plgd-hub.snippetservice.fullname" -}} | ||
{{- if .Values.snippetservice.fullnameOverride }} | ||
{{- .Values.snippetservice.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Values.snippetservice.name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s-%s" .Release.Name $name .Values.snippetservice.name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "plgd-hub.snippetservice.image" -}} | ||
{{- $registryName := .Values.snippetservice.image.registry | default "" -}} | ||
{{- $repositoryName := .Values.snippetservice.image.repository -}} | ||
{{- $tag := .Values.snippetservice.image.tag | default .Chart.AppVersion | toString -}} | ||
{{- printf "%s%s:%s" $registryName $repositoryName $tag -}} | ||
{{- end -}} | ||
|
||
{{- define "plgd-hub.snippetservice.configName" -}} | ||
{{- $fullName := include "plgd-hub.snippetservice.fullname" . -}} | ||
{{- printf "%s-cfg" $fullName }} | ||
{{- end -}} | ||
|
||
{{- define "plgd-hub.snippetservice.createServiceCertByCm" }} | ||
{{- $serviceTls := .Values.snippetservice.apis.grpc.tls.certFile }} | ||
{{- if $serviceTls }} | ||
{{- printf "" -}} | ||
{{- else }} | ||
{{- printf "true" -}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "plgd-hub.snippetservice.domain" -}} | ||
{{- if .Values.snippetservice.domain }} | ||
{{- printf "%s" .Values.snippetservice.domain }} | ||
{{- else }} | ||
{{- printf "api.%s" .Values.global.domain }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "plgd-hub.snippetservice.serviceCertName" -}} | ||
{{- $fullName := include "plgd-hub.snippetservice.fullname" . -}} | ||
{{- printf "%s-crt" $fullName -}} | ||
{{- end }} | ||
|
||
{{- define "plgd-hub.snippetservice.domainCertName" -}} | ||
{{- if .Values.snippetservice.ingress.secretName }} | ||
{{- printf "%s" .Values.snippetservice.ingress.secretName -}} | ||
{{- else }} | ||
{{- $fullName := include "plgd-hub.snippetservice.fullname" . -}} | ||
{{- printf "%s-domain-crt" $fullName -}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "plgd-hub.snippetservice.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ .Values.snippetservice.name }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{{- if .Values.snippetservice.enabled }} | ||
{{- $cert := "/certs" }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "plgd-hub.snippetservice.configName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
{{ .Values.snippetservice.config.fileName }}: | | ||
{{- with .Values.snippetservice }} | ||
hubID: {{ required "snippetservice.hubId or global.hubId is required" ( .hubId | default $.Values.global.hubId) | quote }} | ||
log: | ||
level: {{ .log.level }} | ||
dumpBody: {{ .log.dumpBody }} | ||
encoding: {{ .log.encoding }} | ||
stacktrace: | ||
enabled: {{ .log.stacktrace.enabled }} | ||
level: {{ .log.stacktrace.level }} | ||
encoderConfig: | ||
timeEncoder: {{ .log.encoderConfig.timeEncoder }} | ||
apis: | ||
grpc: | ||
address: {{ .apis.grpc.address | default (printf "0.0.0.0:%v" .port) | quote }} | ||
sendMsgSize: {{ int64 .apis.grpc.sendMsgSize | default 4194304 }} | ||
recvMsgSize: {{ int64 .apis.grpc.recvMsgSize | default 4194304 }} | ||
enforcementPolicy: | ||
minTime: {{ .apis.grpc.enforcementPolicy.minTime }} | ||
permitWithoutStream: {{ .apis.grpc.enforcementPolicy.permitWithoutStream }} | ||
keepAlive: | ||
# 0s - means infinity | ||
maxConnectionIdle: {{ .apis.grpc.keepAlive.maxConnectionIdle }} | ||
# 0s - means infinity | ||
maxConnectionAge: {{ .apis.grpc.keepAlive.maxConnectionIdle }} | ||
# 0s - means infinity | ||
maxConnectionAgeGrace: {{ .apis.grpc.keepAlive.maxConnectionAgeGrace }} | ||
time: {{ .apis.grpc.keepAlive.maxConnectionIdle }} | ||
timeout: {{ .apis.grpc.keepAlive.maxConnectionIdle }} | ||
tls: | ||
{{- $tls := .apis.grpc.tls }} | ||
{{- include "plgd-hub.certificateConfig" (list $ $tls $cert ) | indent 8 }} | ||
clientCertificateRequired: {{ .apis.grpc.tls.clientCertificateRequired }} | ||
authorization: | ||
{{- $authorization := .apis.grpc.authorization }} | ||
{{- include "plgd-hub.authorizationConfig" (list $ $authorization "snippetservice" ) | indent 8 }} | ||
http: | ||
maxIdleConns: {{ .apis.grpc.authorization.http.maxIdleConns }} | ||
maxConnsPerHost: {{ .apis.grpc.authorization.http.maxIdleConnsPerHost }} | ||
maxIdleConnsPerHost: {{ .apis.grpc.authorization.http.maxIdleConnsPerHost }} | ||
idleConnTimeout: {{ .apis.grpc.authorization.http.idleConnTimeout }} | ||
timeout: {{ .apis.grpc.authorization.http.timeout }} | ||
tls: | ||
{{- $grpcTls := .apis.grpc.authorization.http.tls }} | ||
{{- include "plgd-hub.authorizationCaCertificateConfig" (list $ $grpcTls $cert ) | indent 12 }} | ||
useSystemCAPool: {{ .apis.grpc.authorization.http.tls.useSystemCAPool }} | ||
http: | ||
address: {{ .apis.http.address | default (printf "0.0.0.0:%v" .httpPort) | quote }} | ||
readTimeout: {{ .apis.http.readTimeout }} | ||
readHeaderTimeout: {{ .apis.http.readHeaderTimeout }} | ||
writeTimeout: {{ .apis.http.writeTimeout }} | ||
idleTimeout: {{ .apis.http.idleTimeout }} | ||
clients: | ||
storage: | ||
use: {{ include "plgd-hub.useDatabase" (list $ . .clients.storage.use) | quote }} | ||
mongoDB: | ||
uri: {{ include "plgd-hub.mongoDBUri" (list $ .clients.storage.mongoDB.uri ) | quote }} | ||
database: {{ .clients.storage.mongoDB.database }} | ||
maxPoolSize: {{ .clients.storage.mongoDB.maxPoolSize }} | ||
maxConnIdleTime: {{ .clients.storage.mongoDB.maxConnIdleTime }} | ||
tls: | ||
{{- $mongoDbTls := .clients.storage.mongoDB.tls }} | ||
{{- include "plgd-hub.certificateConfig" (list $ $mongoDbTls $cert ) | indent 10 }} | ||
useSystemCAPool: {{ .clients.storage.mongoDB.tls.useSystemCAPool }} | ||
cqlDB: | ||
hosts: | ||
{{- include "plgd-hub.cqlDBHosts" (list $ .clients.storage.cqlDB.hosts ) | indent 8 }} | ||
port: {{ .clients.storage.cqlDB.port | default 9142 }} | ||
table: {{ .clients.storage.cqlDB.table | quote }} | ||
numConnections: {{ .clients.storage.cqlDB.numConnections }} | ||
connectTimeout: {{ .clients.storage.cqlDB.connectTimeout }} | ||
useHostnameResolution: {{ .clients.storage.cqlDB.useHostnameResolution }} | ||
reconnectionPolicy: | ||
constant: | ||
interval: {{ .clients.storage.cqlDB.reconnectionPolicy.constant.interval }} | ||
maxRetries: {{ .clients.storage.cqlDB.reconnectionPolicy.constant.maxRetries }} | ||
keyspace: | ||
name: {{ .clients.storage.cqlDB.keyspace.name }} | ||
create: {{ .clients.storage.cqlDB.keyspace.create }} | ||
replication: | ||
{{- toYaml .clients.storage.cqlDB.keyspace.replication | nindent 14 }} | ||
tls: | ||
{{- $cqlDbTls := .clients.storage.cqlDB.tls }} | ||
{{- include "plgd-hub.certificateConfig" (list $ $cqlDbTls $cert ) | indent 10 }} | ||
useSystemCAPool: {{ .clients.storage.cqlDB.tls.useSystemCAPool }} | ||
{{- include "plgd-hub.openTelemetryExporterConfig" (list $ $cert ) | nindent 6 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.