diff --git a/charts/langkit/CHANGELOG.md b/charts/langkit/CHANGELOG.md index fb4f612..56d7e20 100644 --- a/charts/langkit/CHANGELOG.md +++ b/charts/langkit/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning] (https://semver.org/spec/v2.0.0.html). +## [0.7.0] - **Breaking Changes** - 2023-02-08 + +### Breaking + +- :warning: Adding support for multiple model deployments. + ## [0.6.0] - **Breaking Changes** - 2023-02-01 ### Breaking diff --git a/charts/langkit/Chart.yaml b/charts/langkit/Chart.yaml index 82bf9d8..2917dc7 100644 --- a/charts/langkit/Chart.yaml +++ b/charts/langkit/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: langkit description: A Helm chart for LangKit container deployment type: application -version: 0.6.0 +version: 0.7.0 appVersion: "1.0.2.dev2" diff --git a/charts/langkit/templates/deployment.yaml b/charts/langkit/templates/deployment.yaml index 2d09ceb..61ea36e 100644 --- a/charts/langkit/templates/deployment.yaml +++ b/charts/langkit/templates/deployment.yaml @@ -55,6 +55,10 @@ spec: {{- toYaml .Values.resources | nindent 12 }} env: {{- toYaml .Values.containers.env | nindent 12 }} + {{- range .Values.models }} + - name: {{ .name | upper | replace "-" "_" }}_SERVICE_URL + value: "http://{{ .name }}.{{ $.Release.Namespace }}.svc.cluster.local" + {{- end }} envFrom: - secretRef: name: {{ .Values.secrets.whylabsApiKey.name }} diff --git a/charts/langkit/templates/models.yaml b/charts/langkit/templates/models.yaml new file mode 100644 index 0000000..80bc128 --- /dev/null +++ b/charts/langkit/templates/models.yaml @@ -0,0 +1,34 @@ +{{- range .Values.models }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .name }} +spec: + replicas: 2 + selector: + matchLabels: + app: {{ .name }} + template: + metadata: + labels: + app: {{ .name }} + spec: + containers: + - name: {{ .name }} + image: {{ .image }} + ports: + - containerPort: 80 + tolerations: + {{- toYaml .tolerations | nindent 8 }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .name }} +spec: + type: ClusterIP + selector: + app: {{ .name }} + ports: {{ toYaml .ports | nindent 4 }} +{{- end }} diff --git a/charts/langkit/values.yaml b/charts/langkit/values.yaml index ca690f5..448b870 100644 --- a/charts/langkit/values.yaml +++ b/charts/langkit/values.yaml @@ -122,3 +122,38 @@ volumes: emptyDir: {} - name: home emptyDir: {} + +models: + - name: model1 + image: nginx + ports: + - protocol: TCP + port: 80 + targetPort: 80 + tolerations: + - effect: NoSchedule + key: kubernetes.azure.com/scalesetpriority + operator: Equal + value: spot + - name: model2 + image: nginx + ports: + - protocol: TCP + port: 80 + targetPort: 80 + tolerations: + - effect: NoSchedule + key: kubernetes.azure.com/scalesetpriority + operator: Equal + value: spot + - name: model3 + image: nginx + ports: + - protocol: TCP + port: 80 + targetPort: 80 + tolerations: + - effect: NoSchedule + key: kubernetes.azure.com/scalesetpriority + operator: Equal + value: spot