diff --git a/kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml b/kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml index 87beb796..08de81fc 100644 --- a/kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml +++ b/kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml @@ -95,18 +95,6 @@ spec: resources: requests: storage: 2Gi -# --- -# apiVersion: v1 -# kind: PersistentVolumeClaim -# metadata: -# name: nachet-tmp-pvc -# spec: -# storageClassName: azurefile -# accessModes: -# - ReadWriteMany -# resources: -# requests: -# storage: 2Gi --- apiVersion: policy/v1 kind: PodDisruptionBudget @@ -118,7 +106,6 @@ spec: selector: matchLabels: app: nachet-rcnn-detector - --- apiVersion: v1 kind: Service diff --git a/kubernetes/aks/apps/nachet/base/nachet-secrets.yaml b/kubernetes/aks/apps/nachet/base/nachet-secrets.yaml index 6c435205..fdf2994f 100644 --- a/kubernetes/aks/apps/nachet/base/nachet-secrets.yaml +++ b/kubernetes/aks/apps/nachet/base/nachet-secrets.yaml @@ -45,3 +45,14 @@ metadata: stringData: NACHET_ENV: NACHET_BACKEND_SVC_URL: +--- +kind: Secret +apiVersion: v1 +metadata: + name: nachet-swin-classifier-secrets + annotations: + avp.kubernetes.io/path: "kv/data/nachet" + avp.kubernetes.io/secret-version: "13" +stringData: + NACHET_ENV: + NACHET_BACKEND_SVC_URL: diff --git a/kubernetes/aks/apps/nachet/base/nachet-swin-model-deployment.yaml b/kubernetes/aks/apps/nachet/base/nachet-swin-model-deployment.yaml new file mode 100644 index 00000000..e7c2041c --- /dev/null +++ b/kubernetes/aks/apps/nachet/base/nachet-swin-model-deployment.yaml @@ -0,0 +1,121 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nachet-swin-classifier + namespace: nachet +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: nachet-swin-classifier + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + template: + metadata: + labels: + app: nachet-swin-classifier + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - nachet-swin-classifier + topologyKey: "kubernetes.io/hostname" + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/role + operator: In + values: + - agent + containers: + - name: nachet-swin-classifier + image: ghcr.io/ai-cfia/nachet-backend:29-azureml-swin-classifier + imagePullPolicy: Always + command: ["/bin/sh", "-c"] + args: ['./startup.sh'] + envFrom: + - secretRef: + name: nachet-swin-classifier-secrets + ports: + - containerPort: 5001 + volumeMounts: + - name: logs + mountPath: /app/logs + - name: tmp + mountPath: /tmp + livenessProbe: + httpGet: + path: /score + port: 5001 + initialDelaySeconds: 60 + periodSeconds: 10 + resources: + requests: + cpu: "250m" + memory: "1Gi" + limits: + cpu: "500m" + memory: "2Gi" + securityContext: + runAsNonRoot: false + runAsUser: 1000 + runAsGroup: 1000 + readOnlyRootFilesystem: false + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + volumes: + - name: tmp + emptyDir: + medium: Memory + sizeLimit: 500Mi + - name: logs + persistentVolumeClaim: + claimName: nachet-logs-pvc +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nachet-logs-pvc +spec: + storageClassName: azurefile + accessModes: + - ReadWriteMany + resources: + requests: + storage: 2Gi +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: nachet-swin-classifier-pdb + namespace: nachet +spec: + minAvailable: 1 + selector: + matchLabels: + app: nachet-swin-classifier +--- +apiVersion: v1 +kind: Service +metadata: + name: nachet-swin-classifier-svc + namespace: nachet +spec: + clusterIP: None + selector: + app: nachet-swin-classifier + ports: + - protocol: TCP + port: 5001