feat(helm): add Helm charts for payment and notification services with initial configurations
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
b8c70448a3
commit
d97b8d09e4
6
freeleaps/helm-pkg/notification/Chart.yaml
Normal file
6
freeleaps/helm-pkg/notification/Chart.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: notification
|
||||
description: A Helm Chart of notification service, which part of Freeleaps Platform, powered by Freeleaps.
|
||||
type: application
|
||||
version: 0.0.1
|
||||
appVersion: "0.0.1"
|
||||
27
freeleaps/helm-pkg/notification/templates/certificate.yaml
Normal file
27
freeleaps/helm-pkg/notification/templates/certificate.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseCertificate := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $ingress := .Values.notification.ingresses }}
|
||||
{{- if not $ingress.tls.exists }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ $ingress.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $ingress.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseCertificate }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
commonName: {{ $ingress.host }}
|
||||
dnsNames:
|
||||
- {{ $ingress.host }}
|
||||
issuerRef:
|
||||
name: {{ $ingress.tls.issuerRef.name }}
|
||||
kind: {{ $ingress.tls.issuerRef.kind }}
|
||||
secretName: {{ $ingress.tls.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
98
freeleaps/helm-pkg/notification/templates/deployment.yaml
Normal file
98
freeleaps/helm-pkg/notification/templates/deployment.yaml
Normal file
@ -0,0 +1,98 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/name: "notification"
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
name: "notification"
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: "notification"
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
replicas: {{ .Values.notification.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/name: "notification"
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: "notification"
|
||||
image: "{{ coalesce .Values.notification.image.registry .Values.global.registry "docker.io"}}/{{ coalesce .Values.notification.image.repository .Values.global.repository }}/{{ .Values.notification.image.name }}:{{ .Values.notification.image.tag | default "latest" }}"
|
||||
imagePullPolicy: {{ .Values.notification.image.imagePullPolicy | default "IfNotPresent" }}
|
||||
ports:
|
||||
{{- range $port := .Values.notification.ports }}
|
||||
- containerPort: {{ $port.containerPort }}
|
||||
name: {{ $port.name }}
|
||||
protocol: {{ $port.protocol }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.resources }}
|
||||
resources:
|
||||
{{- toYaml .Values.notification.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes }}
|
||||
{{- if and (.Values.notification.probes.liveness) (eq .Values.notification.probes.liveness.type "httpGet") }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.notification.probes.liveness.config.path }}
|
||||
port: {{ .Values.notification.probes.liveness.config.port }}
|
||||
{{- if .Values.notification.probes.liveness.config.initialDelaySeconds }}
|
||||
initialDelaySeconds: {{ .Values.notification.probes.liveness.config.initialDelaySeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.liveness.config.periodSeconds }}
|
||||
periodSeconds: {{ .Values.notification.probes.liveness.config.periodSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.liveness.config.timeoutSeconds }}
|
||||
timeoutSeconds: {{ .Values.notification.probes.liveness.config.timeoutSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.liveness.config.successThreshold }}
|
||||
successThreshold: {{ .Values.notification.probes.liveness.config.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.liveness.config.failureThreshold }}
|
||||
failureThreshold: {{ .Values.notification.probes.liveness.config.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.liveness.config.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.notification.probes.liveness.config.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.notification.probes.readiness) (eq .Values.notification.probes.readiness.type "httpGet") }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.notification.probes.readiness.config.path }}
|
||||
port: {{ .Values.notification.probes.readiness.config.port }}
|
||||
{{- if .Values.notification.probes.readiness.config.initialDelaySeconds }}
|
||||
initialDelaySeconds: {{ .Values.notification.probes.readiness.config.initialDelaySeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.readiness.config.periodSeconds }}
|
||||
periodSeconds: {{ .Values.notification.probes.readiness.config.periodSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.readiness.config.timeoutSeconds }}
|
||||
timeoutSeconds: {{ .Values.notification.probes.readiness.config.timeoutSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.readiness.config.successThreshold }}
|
||||
successThreshold: {{ .Values.notification.probes.readiness.config.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.notification.probes.readiness.config.failureThreshold }}
|
||||
failureThreshold: {{ .Values.notification.probes.readiness.config.failureThreshold }}
|
||||
{{- end }}:%
|
||||
{{- if .Values.notification.probes.readiness.config.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.notification.probes.readiness.config.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end}}
|
||||
env:
|
||||
{{- range $key, $value := .Values.notification.configs }}
|
||||
- name: {{ $key | snakecase | upper }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: notification-config
|
||||
key: {{ $key | snakecase | upper }}
|
||||
{{- end }}
|
||||
36
freeleaps/helm-pkg/notification/templates/ingress.yaml
Normal file
36
freeleaps/helm-pkg/notification/templates/ingress.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseIngress := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $ingress := .Values.notification.ingresses }}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $ingress.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $ingress.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseIngress }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
{{- if $ingress.class }}
|
||||
ingressClassName: {{ $ingress.class }}
|
||||
{{- end }}
|
||||
{{- if $ingress.tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ $ingress.host }}
|
||||
{{- if $ingress.tls.exists }}
|
||||
secretName: {{ $ingress.tls.secretRef.name }}
|
||||
{{- else }}
|
||||
secretName: {{ $ingress.tls.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ $ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
{{- toYaml $ingress.rules | nindent 10 }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,21 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: notification-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
type: Opaque
|
||||
data:
|
||||
TZ: {{ .Values.notification.configs.tz | b64enc | quote }}
|
||||
APP_NAME: {{ .Values.notification.configs.appName | b64enc | quote }}
|
||||
SERVICE_API_ACCESS_HOST: {{ .Values.notification.configs.serviceApiAccessHost | b64enc | quote }}
|
||||
SERVICE_API_ACCESS_PORT: {{ .Values.notification.configs.serviceApiAccessPort | b64enc | quote }}
|
||||
RABBITMQ_HOST: {{ .Values.notification.configs.rabbitmqHost | b64enc | quote }}
|
||||
RABBITMQ_PORT: {{ .Values.notification.configs.rabbitmqPort | b64enc | quote }}
|
||||
SYSTEM_USER_ID: {{ .Values.notification.configs.systemUserId | b64enc | quote }}
|
||||
SMS_FROM: {{ .Values.notification.configs.smsFrom | b64enc | quote }}
|
||||
EMAIL_FROM: {{ .Values.notification.configs.emailFrom | b64enc | quote }}
|
||||
SECRET_KEY: {{ .Values.notification.configs.secretKey | b64enc | quote }}
|
||||
SENDGRID_API_KEY: {{ .Values.notification.configs.sendgridApiKey | b64enc | quote }}
|
||||
TWILIO_ACCOUNT_SID: {{ .Values.notification.configs.twilioAccountSid | b64enc | quote }}
|
||||
TWILIO_AUTH_TOKEN: {{ .Values.notification.configs.twilioAuthToken | b64enc | quote }}
|
||||
|
||||
26
freeleaps/helm-pkg/notification/templates/service.yaml
Normal file
26
freeleaps/helm-pkg/notification/templates/service.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseService := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $service := .Values.notification.services }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $service.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $service.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseService }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
ports:
|
||||
- port: {{ $service.port }}
|
||||
targetPort: {{ $service.targetPort }}
|
||||
selector:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: "notification"
|
||||
app.kubernetes.io/managed-by: {{ $releaseService }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,76 @@
|
||||
global:
|
||||
registry: docker.io
|
||||
repository: freeleaps
|
||||
nodeSelector: {}
|
||||
content:
|
||||
replicas: 1
|
||||
image:
|
||||
registry:
|
||||
repository: freeleaps
|
||||
name: notification
|
||||
tag: 1.0.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8003
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "512Mi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
# FIXME: Wait until the developers implements the probes APIs
|
||||
probes: {}
|
||||
services:
|
||||
- name: notification-service
|
||||
type: ClusterIP
|
||||
port: 8003
|
||||
targetPort: 8003
|
||||
# Defaults to {}, which means doesn't have any ingress
|
||||
ingresses:
|
||||
- name: notification-ingress
|
||||
host: alpha.notification.freeleaps.mathmast.com
|
||||
class: nginx
|
||||
rules:
|
||||
- path: "/*"
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: notification-service
|
||||
port:
|
||||
number: 8003
|
||||
tls:
|
||||
exists: false
|
||||
issuerRef:
|
||||
name: mathmast-dot-com
|
||||
kind: ClusterIssuer
|
||||
name: alpha.notification.freeleaps.mathmast.com-cert"
|
||||
configs:
|
||||
# TZ
|
||||
tz: "America/Settle"
|
||||
# APP_NAME
|
||||
appName: "notification"
|
||||
# SERVICE_API_ACCESS_HOST
|
||||
serviceApiAccessHost: "0.0.0.0"
|
||||
# SERVICE_API_ACCESS_PORT
|
||||
serviceApiAccessPort: "8003"
|
||||
# RABBITMQ_HOST
|
||||
rabbitmqHost: ""
|
||||
# RABBITMQ_PORT
|
||||
rabbitmqPort: ""
|
||||
# SYSTEM_USER_ID
|
||||
systemUserId: ""
|
||||
# SMS_FROM
|
||||
smsFrom: ""
|
||||
# EMAIL_FROM
|
||||
emailFrom: ""
|
||||
# SECRET_KEY
|
||||
secretKey: ""
|
||||
# SENDGRID_API_KEY
|
||||
sendgridApiKey: ""
|
||||
# TWILIO_ACCOUNT_SID
|
||||
twilioAccountSid: ""
|
||||
# TWILIO_AUTH_TOKEN
|
||||
twilioAuthToken: ""
|
||||
59
freeleaps/helm-pkg/notification/values.yaml
Normal file
59
freeleaps/helm-pkg/notification/values.yaml
Normal file
@ -0,0 +1,59 @@
|
||||
global:
|
||||
registry: docker.io
|
||||
repository: freeleaps
|
||||
nodeSelector: {}
|
||||
notification:
|
||||
replicas: 1
|
||||
image:
|
||||
registry:
|
||||
repository: freeleaps
|
||||
name: notification
|
||||
tag: 1.0.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8003
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "512Mi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
# FIXME: Wait until the developers implements the probes APIs
|
||||
probes: {}
|
||||
services:
|
||||
- name: notification-service
|
||||
type: ClusterIP
|
||||
port: 8003
|
||||
targetPort: 8003
|
||||
# Defaults to {}, which means doesn't have any ingress
|
||||
ingresses: {}
|
||||
configs:
|
||||
# TZ
|
||||
tz: "America/Settle"
|
||||
# APP_NAME
|
||||
appName: "notification"
|
||||
# SERVICE_API_ACCESS_HOST
|
||||
serviceApiAccessHost: "0.0.0.0"
|
||||
# SERVICE_API_ACCESS_PORT
|
||||
serviceApiAccessPort: "8003"
|
||||
# RABBITMQ_HOST
|
||||
rabbitmqHost: ""
|
||||
# RABBITMQ_PORT
|
||||
rabbitmqPort: ""
|
||||
# SYSTEM_USER_ID
|
||||
systemUserId: ""
|
||||
# SMS_FROM
|
||||
smsFrom: ""
|
||||
# EMAIL_FROM
|
||||
emailFrom: ""
|
||||
# SECRET_KEY
|
||||
secretKey: ""
|
||||
# SENDGRID_API_KEY
|
||||
sendgridApiKey: ""
|
||||
# TWILIO_ACCOUNT_SID
|
||||
twilioAccountSid: ""
|
||||
# TWILIO_AUTH_TOKEN
|
||||
twilioAuthToken: ""
|
||||
6
freeleaps/helm-pkg/payment/Chart.yaml
Normal file
6
freeleaps/helm-pkg/payment/Chart.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: payment
|
||||
description: A Helm Chart of payment service, which part of Freeleaps Platform, powered by Freeleaps.
|
||||
type: application
|
||||
version: 0.0.1
|
||||
appVersion: "0.0.1"
|
||||
27
freeleaps/helm-pkg/payment/templates/certificate.yaml
Normal file
27
freeleaps/helm-pkg/payment/templates/certificate.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseCertificate := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $ingress := .Values.payment.ingresses }}
|
||||
{{- if not $ingress.tls.exists }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ $ingress.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $ingress.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseCertificate }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
commonName: {{ $ingress.host }}
|
||||
dnsNames:
|
||||
- {{ $ingress.host }}
|
||||
issuerRef:
|
||||
name: {{ $ingress.tls.issuerRef.name }}
|
||||
kind: {{ $ingress.tls.issuerRef.kind }}
|
||||
secretName: {{ $ingress.tls.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
98
freeleaps/helm-pkg/payment/templates/deployment.yaml
Normal file
98
freeleaps/helm-pkg/payment/templates/deployment.yaml
Normal file
@ -0,0 +1,98 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/name: "payment"
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
name: "payment"
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: "payment"
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
replicas: {{ .Values.payment.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/name: "payment"
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: "payment"
|
||||
image: "{{ coalesce .Values.payment.image.registry .Values.global.registry "docker.io"}}/{{ coalesce .Values.payment.image.repository .Values.global.repository }}/{{ .Values.payment.image.name }}:{{ .Values.payment.image.tag | default "latest" }}"
|
||||
imagePullPolicy: {{ .Values.payment.image.imagePullPolicy | default "IfNotPresent" }}
|
||||
ports:
|
||||
{{- range $port := .Values.payment.ports }}
|
||||
- containerPort: {{ $port.containerPort }}
|
||||
name: {{ $port.name }}
|
||||
protocol: {{ $port.protocol }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.resources }}
|
||||
resources:
|
||||
{{- toYaml .Values.payment.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes }}
|
||||
{{- if and (.Values.payment.probes.liveness) (eq .Values.payment.probes.liveness.type "httpGet") }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.payment.probes.liveness.config.path }}
|
||||
port: {{ .Values.payment.probes.liveness.config.port }}
|
||||
{{- if .Values.payment.probes.liveness.config.initialDelaySeconds }}
|
||||
initialDelaySeconds: {{ .Values.payment.probes.liveness.config.initialDelaySeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.liveness.config.periodSeconds }}
|
||||
periodSeconds: {{ .Values.payment.probes.liveness.config.periodSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.liveness.config.timeoutSeconds }}
|
||||
timeoutSeconds: {{ .Values.payment.probes.liveness.config.timeoutSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.liveness.config.successThreshold }}
|
||||
successThreshold: {{ .Values.payment.probes.liveness.config.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.liveness.config.failureThreshold }}
|
||||
failureThreshold: {{ .Values.payment.probes.liveness.config.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.liveness.config.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.payment.probes.liveness.config.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.payment.probes.readiness) (eq .Values.payment.probes.readiness.type "httpGet") }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.payment.probes.readiness.config.path }}
|
||||
port: {{ .Values.payment.probes.readiness.config.port }}
|
||||
{{- if .Values.payment.probes.readiness.config.initialDelaySeconds }}
|
||||
initialDelaySeconds: {{ .Values.payment.probes.readiness.config.initialDelaySeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.readiness.config.periodSeconds }}
|
||||
periodSeconds: {{ .Values.payment.probes.readiness.config.periodSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.readiness.config.timeoutSeconds }}
|
||||
timeoutSeconds: {{ .Values.payment.probes.readiness.config.timeoutSeconds }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.readiness.config.successThreshold }}
|
||||
successThreshold: {{ .Values.payment.probes.readiness.config.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.payment.probes.readiness.config.failureThreshold }}
|
||||
failureThreshold: {{ .Values.payment.probes.readiness.config.failureThreshold }}
|
||||
{{- end }}:%
|
||||
{{- if .Values.payment.probes.readiness.config.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ .Values.payment.probes.readiness.config.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end}}
|
||||
env:
|
||||
{{- range $key, $value := .Values.payment.configs }}
|
||||
- name: {{ $key | snakecase | upper }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: payment-config
|
||||
key: {{ $key | snakecase | upper }}
|
||||
{{- end }}
|
||||
36
freeleaps/helm-pkg/payment/templates/ingress.yaml
Normal file
36
freeleaps/helm-pkg/payment/templates/ingress.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseIngress := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $ingress := .Values.payment.ingresses }}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $ingress.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $ingress.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseIngress }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
{{- if $ingress.class }}
|
||||
ingressClassName: {{ $ingress.class }}
|
||||
{{- end }}
|
||||
{{- if $ingress.tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ $ingress.host }}
|
||||
{{- if $ingress.tls.exists }}
|
||||
secretName: {{ $ingress.tls.secretRef.name }}
|
||||
{{- else }}
|
||||
secretName: {{ $ingress.tls.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ $ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
{{- toYaml $ingress.rules | nindent 10 }}
|
||||
{{- end }}
|
||||
16
freeleaps/helm-pkg/payment/templates/payment-config.yaml
Normal file
16
freeleaps/helm-pkg/payment/templates/payment-config.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: payment-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
type: Opaque
|
||||
data:
|
||||
TZ: {{ .Values.payment.configs.tz | b64enc | quote }}
|
||||
APP_NAME: {{ .Values.payment.configs.appName | b64enc | quote }}
|
||||
SERVICE_API_ACCESS_HOST: {{ .Values.payment.configs.serviceApiAccessHost | b64enc | quote }}
|
||||
SERVICE_API_ACCESS_PORT: {{ .Values.payment.configs.serviceApiAccessPort | b64enc | quote }}
|
||||
MONGODB_NAME: {{ .Values.payment.configs.mongodbName | b64enc | quote }}
|
||||
MONGODB_PORT: {{ .Values.payment.configs.mongodbPort | b64enc | quote }}
|
||||
MONGODB_URI: {{ .Values.payment.configs.mongodbUri | b64enc | quote }}
|
||||
STRIPE_API_KEY: {{ .Values.payment.configs.stripeApiKey | b64enc | quote }}
|
||||
|
||||
26
freeleaps/helm-pkg/payment/templates/service.yaml
Normal file
26
freeleaps/helm-pkg/payment/templates/service.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
{{ $namespace := .Release.Namespace }}
|
||||
{{ $appVersion := .Chart.AppVersion | quote }}
|
||||
{{ $releaseService := .Release.Service }}
|
||||
{{ $releaseName := .Release.Name }}
|
||||
{{- range $service := .Values.payment.services }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $service.name }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: {{ $service.name | quote }}
|
||||
app.kubernetes.io/managed-by: {{ $releaseService }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
spec:
|
||||
ports:
|
||||
- port: {{ $service.port }}
|
||||
targetPort: {{ $service.targetPort }}
|
||||
selector:
|
||||
app.kubernetes.io/version: {{ $appVersion }}
|
||||
app.kubernetes.io/name: "payment"
|
||||
app.kubernetes.io/managed-by: {{ $releaseService }}
|
||||
app.kubernetes.io/instance: {{ $releaseName }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,49 @@
|
||||
global:
|
||||
registry: docker.io
|
||||
repository: freeleaps
|
||||
nodeSelector: {}
|
||||
payment:
|
||||
replicas: 1
|
||||
image:
|
||||
registry:
|
||||
repository: freeleaps
|
||||
name: payment
|
||||
tag: 1.0.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8006
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "512Mi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
# FIXME: Wait until the developers implements the probes APIs
|
||||
probes: {}
|
||||
services:
|
||||
- name: payment-service
|
||||
type: ClusterIP
|
||||
port: 8006
|
||||
targetPort: 8006
|
||||
# Defaults to {}, which means doesn't have any ingress
|
||||
ingresses: {}
|
||||
configs:
|
||||
# TZ
|
||||
tz: "America/Settle"
|
||||
# APP_NAME
|
||||
appName: "payment"
|
||||
# SERVICE_API_ACCESS_HOST
|
||||
serviceApiAccessHost: "0.0.0.0"
|
||||
# SERVICE_API_ACCESS_PORT
|
||||
serviceApiAccessPort: "8006"
|
||||
# MONGODB_NAME
|
||||
mongodbName: "freeleaps2"
|
||||
# MONGODB_PORT
|
||||
mongodbPort: "27017"
|
||||
# MONGODB_URI
|
||||
mongodbUri: "mongodb://freeleaps-alpha-mongodb.freeleaps-alpha.svc.freeleaps.cluster:27017/"
|
||||
# STRIPE_API_KEY
|
||||
stripeApiKey: ""
|
||||
49
freeleaps/helm-pkg/payment/values.yaml
Normal file
49
freeleaps/helm-pkg/payment/values.yaml
Normal file
@ -0,0 +1,49 @@
|
||||
global:
|
||||
registry: docker.io
|
||||
repository: freeleaps
|
||||
nodeSelector: {}
|
||||
payment:
|
||||
replicas: 1
|
||||
image:
|
||||
registry:
|
||||
repository: freeleaps
|
||||
name: payment
|
||||
tag: 1.0.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8006
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "512Mi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
# FIXME: Wait until the developers implements the probes APIs
|
||||
probes: {}
|
||||
services:
|
||||
- name: payment-service
|
||||
type: ClusterIP
|
||||
port: 8006
|
||||
targetPort: 8006
|
||||
# Defaults to {}, which means doesn't have any ingress
|
||||
ingresses: {}
|
||||
configs:
|
||||
# TZ
|
||||
tz: "America/Settle"
|
||||
# APP_NAME
|
||||
appName: "payment"
|
||||
# SERVICE_API_ACCESS_HOST
|
||||
serviceApiAccessHost: "0.0.0.0"
|
||||
# SERVICE_API_ACCESS_PORT
|
||||
serviceApiAccessPort: "8006"
|
||||
# MONGODB_NAME
|
||||
mongodbName: ""
|
||||
# MONGODB_PORT
|
||||
mongodbPort: "27017"
|
||||
# MONGODB_URI
|
||||
mongodbUri: ""
|
||||
# STRIPE_API_KEY
|
||||
stripeApiKey: ""
|
||||
Loading…
Reference in New Issue
Block a user