Skip to content

Commit

Permalink
#196 #197 adding canary deployment file and editing the data analysis…
Browse files Browse the repository at this point in the history
… service
  • Loading branch information
milanchheta committed May 2, 2020
1 parent e17202f commit ad6d503
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 43 deletions.
43 changes: 0 additions & 43 deletions data_analysis/deployment.yaml

This file was deleted.

48 changes: 48 additions & 0 deletions deploymentFiles/dataanalysisCanary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: data-analysis
namespace: default
spec:
provider: istio
targetRef:
apiVersion: apps/v1
kind: Deployment
name: data-analysis
progressDeadlineSeconds: 60
autoscalerRef:
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
name: data-analysis
service:
name: data-analysis
port: 3004
targetPort: 3004
# 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



37 changes: 37 additions & 0 deletions deploymentFiles/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: data-analysis
labels:
app: data-analysis
spec:
minReadySeconds: 5
revisionHistoryLimit: 5
progressDeadlineSeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app: data-analysis
template:
metadata:
labels:
app: data-analysis
spec:
containers:
- name: data-analysis
image: orenda15/data_analysis:242b58a0b0ffc5ab53f076b9a8206c88b1c4120e
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3004
protocol: TCP
resources:
limits:
cpu: 2000m
memory: 512Mi
requests:
cpu: 100m
memory: 64Mi
18 changes: 18 additions & 0 deletions deploymentFiles/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: data-analysis
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: data-analysis
minReplicas: 2
maxReplicas: 4
metrics:
- type: Resource
resource:
name: cpu
# scale up if usage is above
# 99% of the requested CPU (100m)
targetAverageUtilization: 99

0 comments on commit ad6d503

Please sign in to comment.