Skip to content

Commit 8eed5e0

Browse files
committed
ops: Creating Chart. Initialize chart. AddDeployments
1 parent 95530f1 commit 8eed5e0

File tree

9 files changed

+49
-181
lines changed

9 files changed

+49
-181
lines changed

deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: 0.0.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.16.0"
24+
appVersion: "latest"
2525

2626
# Chart.yaml
2727
dependencies:

deployment/kubernetes/charts/medcat-trainer-helm/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "medcat-trainer-helm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
1616
echo http://$SERVICE_IP:{{ .Values.service.port }}
1717
{{- else if contains "ClusterIP" .Values.service.type }}
18-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "medcat-trainer-helm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "medcat-trainer-helm.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=nginx" -o jsonpath="{.items[0].metadata.name}")
1919
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
2020
echo "Visit http://127.0.0.1:8080 to use your application"
2121
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT

deployment/kubernetes/charts/medcat-trainer-helm/templates/_helpers.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ Create the name of the service account to use
6565

6666
{{- /*
6767
Return Solr host: either user-supplied or constructed from release name
68+
69+
TODO: Make Solr use the chart fullname instead of release name
6870
*/ -}}
6971
{{- define "medcat-trainer-helm.solrHost" -}}
7072
{{- if .Values.solrHost }}
7173
{{ .Values.solrHost }}
7274
{{- else }}
73-
{{- include "medcat-trainer-helm.fullname" . }}-solr
75+
{{- .Release.Name }}-solr
7476
{{- end }}
7577
{{- end }}
7678

deployment/kubernetes/charts/medcat-trainer-helm/templates/deployment.yaml

Lines changed: 0 additions & 78 deletions
This file was deleted.

deployment/kubernetes/charts/medcat-trainer-helm/templates/env-configmap.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

deployment/kubernetes/charts/medcat-trainer-helm/templates/medcat-configmap.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

deployment/kubernetes/charts/medcat-trainer-helm/templates/nginx-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ data:
144144
}
145145
sitesenabled.medcattrainer: |
146146
server {
147-
listen 8000;
147+
listen {{ .Values.service.port }};
148148
server_name localhost;
149149
charset utf-8;
150150
large_client_header_buffers 4 32k;

deployment/kubernetes/charts/medcat-trainer-helm/templates/supervisord-configmap.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

deployment/kubernetes/charts/medcat-trainer-helm/values.yaml

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
6+
replicaCount: 1
7+
8+
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
9+
image:
10+
repository: cogstacksystems/medcat-trainer
11+
# This sets the pull policy for images.
12+
pullPolicy: Always
13+
# Overrides the image tag whose default is the chart appVersion.
14+
tag: "latest"
15+
nginxImage:
16+
repository: nginx
17+
pullPolicy: IfNotPresent
18+
tag: "1.29.1"
19+
20+
# Add any environment variables here that should be set in the medcat-trainer container
521
env:
622
CSRF_TRUSTED_ORIGINS: "http://localhost:8000"
723
DB_ENGINE: "sqlite3"
@@ -53,17 +69,22 @@ medcatConfig: |
5369
# use this spacy model
5470
cat.general.spacy_model = 'en_core_web_md'
5571
56-
57-
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
58-
replicaCount: 1
59-
60-
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
61-
image:
62-
repository: nginx
63-
# This sets the pull policy for images.
64-
pullPolicy: IfNotPresent
65-
# Overrides the image tag whose default is the chart appVersion.
66-
tag: ""
72+
solr:
73+
# replicaCount: 1
74+
# collectionShards: 1
75+
# collectionReplicas: 1
76+
zookeeper:
77+
# replicaCount: 1
78+
persistence:
79+
size: 1Gi
80+
persistence:
81+
size: 1Gi
82+
auth:
83+
# TODO: support SOLR auth from medcat trainer API
84+
enabled: false
85+
podLabels:
86+
app.kubernetes.io/component: solr
87+
app.kubernetes.io/part-of: cogstack
6788

6889
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
6990
imagePullSecrets: []
@@ -106,7 +127,7 @@ service:
106127
# This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
107128
type: ClusterIP
108129
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
109-
port: 80
130+
port: 8000
110131

111132
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
112133
ingress:
@@ -138,14 +159,15 @@ resources: {}
138159
# memory: 128Mi
139160

140161
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
141-
livenessProbe:
142-
httpGet:
143-
path: /
144-
port: http
145-
readinessProbe:
146-
httpGet:
147-
path: /
148-
port: http
162+
# TODO Add liveness and readiness to django app
163+
# livenessProbe:
164+
# httpGet:
165+
# path: /
166+
# port: http
167+
# readinessProbe:
168+
# httpGet:
169+
# path: /
170+
# port: http
149171

150172
# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
151173
autoscaling:
@@ -173,15 +195,3 @@ nodeSelector: {}
173195
tolerations: []
174196

175197
affinity: {}
176-
177-
solr:
178-
# replicaCount: 1
179-
# collectionShards: 1
180-
# collectionReplicas: 1
181-
# zookeeper:
182-
# replicaCount: 1
183-
persistence:
184-
size: 1Gi
185-
auth:
186-
# TODO: support SOLR auth from medcat trainer API
187-
enabled: false

0 commit comments

Comments
 (0)