diff --git a/dataModelling/deployment.yaml b/dataModelling/deployment.yaml deleted file mode 100644 index 7c32a775..00000000 --- a/dataModelling/deployment.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -kind: Service -apiVersion: v1 -metadata: - name: datamodellingservice -spec: - selector: - app: data-modelling - ports: - # - protocol: "TCP" - - name: http - # Port accessible inside cluster - port: 3005 - # Port to forward to inside the pod - # targetPort: 5011 - # # Port accessible outside cluster - # nodePort: 30005 - # type: LoadBalancer - - ---- -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 -kind: Deployment -metadata: - name: data-modelling-deployment -spec: - selector: - matchLabels: - app: data-modelling - replicas: 1 # tells deployment to run 2 pods matching the template - template: - metadata: - labels: - app: data-modelling - spec: - containers: - - name: data-modelling - image: orenda15/data_modelling:c7d445dbc31af7d1eae53f9f57997acd17de31f2 - ports: - - containerPort: 3005 diff --git a/deploymentFiles/datamodellingCanary.yaml b/deploymentFiles/datamodellingCanary.yaml new file mode 100644 index 00000000..f19f08e9 --- /dev/null +++ b/deploymentFiles/datamodellingCanary.yaml @@ -0,0 +1,48 @@ +apiVersion: flagger.app/v1beta1 +kind: Canary +metadata: + name: data-modelling + namespace: default +spec: + provider: istio + targetRef: + apiVersion: apps/v1 + kind: Deployment + name: data-modelling + progressDeadlineSeconds: 60 + autoscalerRef: + apiVersion: autoscaling/v2beta1 + kind: HorizontalPodAutoscaler + name: data-modelling + service: + name: data-modelling + port: 3005 + targetPort: 3005 + # portName: http + portDiscovery: true + timeout: 5s + # gateways: + # - orenda-gateway + # hosts: + # - '*' + skipAnalysis: false + analysis: + interval: 10s + threshold: 10 + maxWeight: 50 + stepWeight: 5 + # metrics: + # - name: request-success-rate + # thresholdRange: + # min: 99 + # interval: 1m + # - name: latency + # templateRef: + # name: latency + # namespace: istio-system + # thresholdRange: + # max: 500 + # interval: 1m + + + \ No newline at end of file diff --git a/deploymentFiles/deployment.yaml b/deploymentFiles/deployment.yaml new file mode 100644 index 00000000..e5db06c7 --- /dev/null +++ b/deploymentFiles/deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: data-modelling + labels: + app: data-modelling +spec: + minReadySeconds: 5 + revisionHistoryLimit: 5 + progressDeadlineSeconds: 60 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate + selector: + matchLabels: + app: data-modelling + template: + metadata: + labels: + app: data-modelling + spec: + containers: + - name: data-modelling + image: orenda15/data_modelling:e84182d37ab15b7ad3cfe13754f9b382a01e5e7e + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 3005 + protocol: TCP + resources: + limits: + cpu: 2000m + memory: 512Mi + requests: + cpu: 100m + memory: 64Mi \ No newline at end of file diff --git a/deploymentFiles/hpa.yaml b/deploymentFiles/hpa.yaml new file mode 100644 index 00000000..daa17d12 --- /dev/null +++ b/deploymentFiles/hpa.yaml @@ -0,0 +1,18 @@ +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: frontend +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: frontend + minReplicas: 2 + maxReplicas: 4 + metrics: + - type: Resource + resource: + name: cpu + # scale up if usage is above + # 99% of the requested CPU (100m) + targetAverageUtilization: 99 \ No newline at end of file