{{- if .Values.ingress.enabled -}}
{{- $fullName := include "predict.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "predict.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "predict.serviceAccountName" . }}
labels:
{{- include "predict.labels" . | nindent 4 }}
{{- if and .Values.aws.enabled .Values.aws.role }}
annotations:
eks.amazonaws.com/role-arn: {{ .Values.aws.role }}
{{- else }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "predict.fullname" . }}-servicemonitor
namespace: {{ .Release.Namespace }}
labels:
{{- include "predict.labels" . | nindent 4 }}
release: {{ .Values.serviceMonitor.release }}
spec:
selector:
matchLabels:
{{- include "predict.selectorLabels" . | nindent 6 }}
endpoints:
- port: "metrics"
path: "{{ .Values.service.ports.metrics.path }}"
interval: {{ .Values.serviceMonitor.interval | default "120s" }}
# Default values for predict.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
consul:
dc: "dc-consul"
cluster: "dc-consul.cluster.com"
keyprefix: "data/example"
service: "example.nps.svc.cluster"
metrics:
prefix: "nps"
server:
discard: 20
timeout: 40
aws:
enabled: true
role: ""
oss: {}
# If you are using oss, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'oss:'.
#enabled: true
#endpoint: ""
#id: ""
#secret: ""
image:
repository: 818539432014.dkr.ecr.us-east-1.amazonaws.com/engineplus/mindalpha-serving-centos
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
#tag: "v1"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podDisruptionBudget: {}
#minAvailable: 2
#maxUnavailable: 20%
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 0
type: RollingUpdate
autoscaling:
minReplicas: 1
maxReplicas: 2
behavior:
scaleUp:
stabilizationWindowSeconds: 300
policies:
# type could be Percent or Pods
- type: Percent
value: 100
periodSeconds: 300
- type: Pods
value: 5
periodSeconds: 300
selectPolicy: Max
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 300
- type: Pods
value: 1
periodSeconds: 300
selectPolicy: Min
metrics:
cpu:
enabled: true
name: cpu
type: Resource
target:
type: Utilization
value: 50
mem:
enabled: false
name: memory
type: Resource
target:
type: AverageValue
value: 15Gi
gpu:
enabled: false
name: DCGM_FI_DEV_GPU_per_second
type: Pods
target:
type: AverageValue
value: 500
qps:
enabled: true
name: nps_server_perfermance_qps
type: Pods
target:
type: AverageValue
value: 60
latency:
enabled: false
name: nps_server_perfermance_latency_99
type: Pods
target:
type: AverageValue
value: 35
livenessProbe:
initialDelaySeconds: 180
readinessProbe:
initialDelaySeconds: 180
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
podSecurityContext:
# fsGroup: 2000
fsGroup: 65534
securityContext:
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 100
runAsGroup: 1000
service:
type: NodePort
ports:
tcp:
port: 20101
protocol: TCP
http:
port: 10102
protocol: TCP
metrics:
port: 18080
protocol: TCP
path: "/metrics"
annotations: |
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.service.ports.metrics.port }}"
prometheus.io/path: "{{ .Values.service.ports.metrics.path }}"
serviceMonitor:
release: prometheus-stack
factor:
unknown: 400
instance:
g4dn.4xlarge: 1600
m5.4xlarge: 400
r5.4xlarge: 400
c5.4xlarge: 400
emptyDir:
sizeLimit: 100Gi
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
#
gpu:
# gpu corporation maybe nvidia or amd
enabled: true
corporation: nvidia.com
count: 1
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
limits:
cpu: 800m
memory: 16Gi
requests:
cpu: 500m
memory: 8Gi
nodeSelector: {}
# service_type: nps-nodes
tolerations: []
affinity: {}
#nodeAffinity:
# preferredDuringSchedulingIgnoredDuringExecution:
# - weight: 100
# preference:
# matchExpressions:
# - key: nodestype
# operator: In
# values:
# - nps-gpu-nodes
#podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - predict
## topologyKey: kubernetes.io/hostname
apiVersion: v2
appVersion: 1.2.8
description: A Helm chart for Kubernetes
name: predict
type: application
version: 0.1.1
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "predict.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 "predict.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 "predict.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "predict.labels" -}}
helm.sh/chart: {{ include "predict.chart" . }}
{{ include "predict.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "predict.selectorLabels" -}}
app.kubernetes.io/name: {{ include "predict.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "predict.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "predict.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}