Skip to content

Commit

Permalink
feature. add tks-api charts
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Jul 31, 2023
1 parent 59a013c commit 40832e7
Show file tree
Hide file tree
Showing 43 changed files with 289 additions and 1,505 deletions.
4 changes: 2 additions & 2 deletions tks-apis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: tks-apis
description: A Helm chart for tks-apis
type: application
version: 0.1.0
appVersion: 0.1.0
version: 0.1.1
appVersion: 0.1.1
56 changes: 0 additions & 56 deletions tks-apis/templates/tks-admin-console/_helpers.tpl

This file was deleted.

15 changes: 0 additions & 15 deletions tks-apis/templates/tks-admin-console/clusterrole.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions tks-apis/templates/tks-admin-console/clusterrolebinding.yaml

This file was deleted.

75 changes: 0 additions & 75 deletions tks-apis/templates/tks-admin-console/deployment.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions tks-apis/templates/tks-admin-console/hpa.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions tks-apis/templates/tks-admin-console/ingress.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions tks-apis/templates/tks-admin-console/service.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions tks-apis/templates/tks-admin-console/serviceaccount.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions tks-apis/templates/tks-api/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "tks-api.name" -}}
{{- default .Chart.Name .Values.tksapi.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "tks-api.fullname" -}}
{{- if .Values.tksapi.fullnameOverride }}
{{- .Values.tksapi.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Values.tksapi.nameOverride }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "tks-api.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "tks-api.labels" -}}
helm.sh/chart: {{ include "tks-api.chart" . }}
{{ include "tks-api.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "tks-api.selectorLabels" -}}
app.kubernetes.io/service: tks
app.kubernetes.io/name: {{ include "tks-api.name" . }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "tks-api.serviceAccountName" -}}
{{- if .Values.tksapi.serviceAccount.create }}
{{- default (include "tks-api.fullname" .) .Values.tksapi.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.tksapi.serviceAccount.name }}
{{- end }}
{{- end }}
72 changes: 72 additions & 0 deletions tks-apis/templates/tks-api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tks-api.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "tks-api.labels" . | nindent 4 }}
spec:
{{- if not .Values.tksapi.autoscaling.enabled }}
replicas: {{ .Values.tksapi.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "tks-api.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.tksapi.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "tks-api.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.tksapi.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "tks-api.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.tksapi.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.tksapi.securityContext | nindent 12 }}
image: "{{ .Values.tksapi.image.repository }}:{{ .Values.tksapi.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.tksapi.image.pullPolicy }}
ports:
- name: tks-api
containerPort: {{ .Values.tksapi.args.port }}
protocol: TCP
command:
- /app/backend/bin/server
args: [
"-port", "{{ .Values.tksapi.args.port }}",
"-revision", "{{ .Values.revision }}",
"-git-account", "{{ .Values.gitAccount }}",
"-dbname", "{{ .Values.db.dbName }}",
"-dbhost", "{{ .Values.db.dbHost }}",
"-dbport", "{{ .Values.db.dbPort }}",
"-dbuser", "{{ .Values.db.dbUser }}",
"-dbpassword", "{{ .Values.db.dbPassword }}",
"-argo-address", "{{ .Values.tksapi.args.argoAddress }}",
"-argo-port", "{{ .Values.tksapi.args.argoPort }}",
"-image-registry-url", "{{ .Values.tksapi.args.imageRegistryUrl }}",
"-harbor-pw-secret", "{{ .Values.tksapi.args.harborPwSecret }}",
"-git-repository-url", "{{ .Values.tksapi.args.gitRepositoryUrl }}",
"-keycloak-address", "{{ .Values.tksapi.args.keycloakAddress }}",
]
resources:
{{- toYaml .Values.tksapi.resources | nindent 12 }}
{{- with .Values.tksapi.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tksapi.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tksapi.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 40832e7

Please sign in to comment.