diff options
Diffstat (limited to 'yaml/networking')
| -rw-r--r-- | yaml/networking/balance.yaml | 37 | ||||
| -rw-r--r-- | yaml/networking/ingress.yaml | 18 | 
2 files changed, 55 insertions, 0 deletions
diff --git a/yaml/networking/balance.yaml b/yaml/networking/balance.yaml new file mode 100644 index 0000000..dd0f17b --- /dev/null +++ b/yaml/networking/balance.yaml @@ -0,0 +1,37 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: +  name: cas-hpa +spec: +  scaleTargetRef: +    apiVersion: apps/v1 +    kind: Deployment +    name: cas-deployment +  minReplicas: 1 +  maxReplicas: 10 +  metrics: +  - type: Resource +    resource: +      name: cpu +      target: +        type: Utilization +        averageUtilization: 70 +  - type: Resource +    resource: +      name: memory +      target: +        type: Utilization +        averageUtilization: 80 +  behavior: +    scaleUp: +      stabilizationWindowSeconds: 60 +      policies: +      - type: Percent +        value: 100 +        periodSeconds: 15 +    scaleDown: +      stabilizationWindowSeconds: 300 +      policies: +      - type: Percent +        value: 100 +        periodSeconds: 15 diff --git a/yaml/networking/ingress.yaml b/yaml/networking/ingress.yaml new file mode 100644 index 0000000..4a0d31d --- /dev/null +++ b/yaml/networking/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: +  name: cas-ingress +  annotations: +    nginx.ingress.kubernetes.io/rewrite-target: / +spec: +  ingressClassName: nginx +  rules: +  - http: +      paths: +      - path: / +        pathType: Prefix +        backend: +          service: +            name: cas-service +            port: +              number: 80  |