Skip to content

Commit

Permalink
fix: enable autoscale when 2 replicas on base charts (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo authored Jun 20, 2024
1 parent 0af3c58 commit 2450d89
Show file tree
Hide file tree
Showing 16 changed files with 612 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,46 @@ spec:
component: app
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: app
namespace: test-app-simple-options
labels:
component: app
kontinuous/deployment: test-app-simple-options-feature-branch-1-ffac537e6cbb-ze31pkw6
kontinuous/deployment.env: test-app-simple-options-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-app-5g3qm0bo
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.app
kontinuous/source: project/charts/fabrique/charts/contrib/charts/app/templates/autoscaler.yaml
kontinuous/deployment: test-app-simple-options-feature-branch-1-ffac537e6cbb-ze31pkw6
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: app
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
40 changes: 40 additions & 0 deletions packages/kontinuous/tests/__snapshots__/app-simple.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,46 @@ spec:
component: app
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: app
namespace: test-app-simple
labels:
component: app
kontinuous/deployment: test-app-simple-feature-branch-1-ffac537e6cbbf934b087-4w1j23zk
kontinuous/deployment.env: test-app-simple-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-app-5g3qm0bo
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.app
kontinuous/source: project/charts/fabrique/charts/contrib/charts/app/templates/autoscaler.yaml
kontinuous/deployment: test-app-simple-feature-branch-1-ffac537e6cbbf934b087-4w1j23zk
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: app
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
40 changes: 40 additions & 0 deletions packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,46 @@ spec:
component: app
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: app
namespace: test-extends-ovh
labels:
component: app
kontinuous/deployment: test-extends-ovh-feature-branch-1-ffac537e6cbbf934b08-5oa7s3iv
kontinuous/deployment.env: test-extends-ovh-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-app-5g3qm0bo
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.app
kontinuous/source: project/charts/fabrique/charts/contrib/charts/app/templates/autoscaler.yaml
kontinuous/deployment: test-extends-ovh-feature-branch-1-ffac537e6cbbf934b08-5oa7s3iv
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: app
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
40 changes: 40 additions & 0 deletions packages/kontinuous/tests/__snapshots__/hasura-no-ing.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,45 @@ spec:
selector:
component: hasura
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: hasura
namespace: test-hasura-no-ing
labels:
component: hasura
kontinuous/deployment: test-hasura-no-ing-feature-branch-1-ffac537e6cbbf934b-4sslo35s
kontinuous/deployment.env: test-hasura-no-ing-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-hasura-2gwbp4ld
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.hasura
kontinuous/source: project/charts/fabrique/charts/contrib/charts/hasura/templates/autoscaler.yaml
kontinuous/deployment: test-hasura-no-ing-feature-branch-1-ffac537e6cbbf934b-4sslo35s
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: hasura
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,46 @@ spec:
component: app
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: app
namespace: test-ingress-external-domain
labels:
component: app
kontinuous/deployment: test-ingress-external-domain-feature-branch-1-ffac537-4dx6300n
kontinuous/deployment.env: test-ingress-external-domain-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-app-5g3qm0bo
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.app
kontinuous/source: project/charts/fabrique/charts/contrib/charts/app/templates/autoscaler.yaml
kontinuous/deployment: test-ingress-external-domain-feature-branch-1-ffac537-4dx6300n
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: app
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
41 changes: 41 additions & 0 deletions packages/kontinuous/tests/__snapshots__/pg.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,47 @@ spec:
component: hasura
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: hasura
namespace: test-pg
labels:
component: hasura
kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3
kontinuous/deployment.env: test-pg-prod
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: horizontalpodautoscaler-hasura-2gwbp4ld
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/chartPath: project.fabrique.contrib.hasura
kontinuous/source: project/charts/fabrique/charts/contrib/charts/hasura/templates/autoscaler.yaml
kontinuous/plugin.needs: '[\\"cnpg\\"]'
kontinuous/deployment: test-pg-feature-branch-1-ffac537e6cbbf934b08745a37893-4f12g0z3
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- resource:
name: cpu
target:
averageUtilization: 70
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 80
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: hasura
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
Loading

0 comments on commit 2450d89

Please sign in to comment.