update
This commit is contained in:
@@ -9,7 +9,7 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: {{ .Chart.Name }}
|
app: {{ .Chart.Name }}
|
||||||
replicas: {{ .Values.deployment.replicas }}
|
replicas: {{ .Values.deployment.hpa.minReplicas }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -25,3 +25,9 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ .Values.deployment.secretfile }}
|
name: {{ .Values.deployment.secretfile }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: {{ .Values.deployment.resources.requests.cpu }}
|
||||||
|
cpu: {{ .Values.deployment.resources.requests.memory }}
|
||||||
|
limits:
|
||||||
|
memory: {{ .Values.deployment.resources.limits.memory }}
|
||||||
|
|||||||
24
charts/durpapi/templates/hpa.yaml
Normal file
24
charts/durpapi/templates/hpa.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: autoscaling/v2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{ .Chart.Name }}-hpa
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: ctix
|
||||||
|
minReplicas: {{ .Values.deployment.hpa.minReplicas }}
|
||||||
|
maxReplicas: {{ .Values.deployment.hpa.maxReplicas }}
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 80
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 40
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
deployment:
|
deployment:
|
||||||
replicas: 1
|
|
||||||
image: registry.gitlab.com/developerdurp/durpapi
|
image: registry.gitlab.com/developerdurp/durpapi
|
||||||
tag: ""
|
tag: ""
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
secretfile: durpapi-secret
|
secretfile: durpapi-secret
|
||||||
|
hpa:
|
||||||
|
minReplicas: 3
|
||||||
|
maxReplicas: 10
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "50Mi"
|
||||||
|
limits:
|
||||||
|
memory: "150Mi"
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
clusterissuer: letsencrypt-production
|
clusterissuer: letsencrypt-production
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -86,7 +86,7 @@ func authMiddleware(allowedGroups []string) gin.HandlerFunc {
|
|||||||
if !isAllowed {
|
if !isAllowed {
|
||||||
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
|
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
|
||||||
"message": "Unauthorized access",
|
"message": "Unauthorized access",
|
||||||
"groups": groupsHeader,
|
"groups": allowedGroups,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user