Skip to content

Commit

Permalink
[chart/navi-back] 7.23.0.5 release (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
uk-navi-ci authored Jun 26, 2024
1 parent 5785840 commit 1d56357
Show file tree
Hide file tree
Showing 15 changed files with 992 additions and 933 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea
.DS_Store
readme-generator-for-helm
Chart.lock
/charts/*/charts
6 changes: 5 additions & 1 deletion charts/navi-back/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ keywords:
- back
- backend
version: 1.24.0
appVersion: 7.15.2.4
appVersion: 7.23.0.5
dependencies:
- name: generic-chart
version: "*"
repository: file://../generic-chart
maintainers:
- name: 2gis
url: https://github.com/2gis
Expand Down
427 changes: 236 additions & 191 deletions charts/navi-back/README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions charts/navi-back/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "naviback.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "generic-chart.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "naviback.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "naviback.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "generic-chart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "generic-chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "naviback.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "generic-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
130 changes: 18 additions & 112 deletions charts/navi-back/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,91 +1,16 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "naviback.name" -}}
{{- default .Chart.Name .Values.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "naviback.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

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

{{/*
Distinguishable main container name
Override generic-chart
TODO: rewrite https://github.com/helm/helm/issues/11291
*/}}
{{- define "naviback.containerName" -}}
{{- define "generic-chart.containerName" -}}
{{- if .Values.dataGroup.enabled }}
{{- .Values.dataGroup.prefix }}-{{ .Chart.Name }}
{{- else }}
{{- .Chart.Name }}
{{- end }}
{{- end -}}

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

{{/*
Selector labels
*/}}
{{- define "naviback.selectorLabels" -}}
app.kubernetes.io/name: {{ include "naviback.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "naviback.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "naviback.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}


{{/*
Renders a value that contains template.
Usage:
{{ include "tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}


{{/*
Get count of CPU from limits.
Expand Down Expand Up @@ -448,48 +373,29 @@ Usage:
{{- end -}}
{{- end -}}

{{/*
Return the target Kubernetes version
*/}}
{{- define "capabilities.kubeVersion" -}}
{{- if .Values.global }}
{{- if .Values.global.kubeVersion }}
{{- .Values.global.kubeVersion -}}
{{- else }}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end -}}
{{- else }}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for Horizontal Pod Autoscaler.
*/}}
{{- define "capabilities.hpa.apiVersion" -}}
{{- if semverCompare "<1.23-0" (include "capabilities.kubeVersion" .) -}}
{{- if .beta2 -}}
{{- print "autoscaling/v2beta2" -}}
{{- else -}}
{{- print "autoscaling/v2beta1" -}}
{{- end -}}
{{- else -}}
{{- print "autoscaling/v2" -}}
{{- end -}}
{{- end -}}

{{/*
Set castle url
If use frozenData return local path
Usage:
{{ include "config.setCastleUrl" $ }}
*/}}
{{- define "config.setCastleUrl" -}}
{{- if .Values.frozenData.enabled -}}
{{- printf "file://{LOCAL_PATH}" -}}
{{- else if .Values.naviback.castleUrl -}}
{{- if .Values.naviback.castleUrl -}}
{{- printf .Values.naviback.castleUrl -}}
{{- else if .Values.naviback.castleHost -}}
{{- printf "http://%s" .Values.naviback.castleHost -}}
{{- end -}}
{{- end -}}

{{/*
Set restriction url
If rtr enabled return naviback.rtr.url, else return naviback.castleUrl
Usage:
{{ include "config.setRestrictionUrl" $ }}
*/}}
{{- define "config.setRestrictionUrl" -}}
{{- if .Values.naviback.rtr.enabled -}}
{{- printf .Values.naviback.rtr.url -}}
{{- else -}}
{{- printf (include "config.setCastleUrl" $) -}}
{{- end -}}
{{- end -}}
Loading

0 comments on commit 1d56357

Please sign in to comment.