Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fix bugs 2 (#15)
Browse files Browse the repository at this point in the history
* documentation: Added missing 'build' subcommand for docker

* archive: Converted wrong parsing

* deployments: Added more autoscaling rules and increased resources

* Update horizontal_scaling.yaml

* Making horizontal scaling better
  • Loading branch information
guyarb authored Feb 9, 2022
1 parent 32b9a0f commit 04ba2cf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ curl "https://btfhub.seekret.io/monitoring/health"
# Docker build

```bash
docker -f btfserver.Dockerfile -t "<image>" .
docker build -f btfserver.Dockerfile -t "<image>" .
```

# Deploy
Expand Down
33 changes: 31 additions & 2 deletions deployments/k8s/templates/horizontal_scaling.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
annotations:
Expand All @@ -11,4 +11,33 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.name }}
targetCPUUtilizationPercentage: {{ .Values.horizontal_scaling.cpu_utilization }}
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: Max
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 50
8 changes: 4 additions & 4 deletions deployments/k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ ingress:

resources:
requests:
memory: 200Mi
cpu: 400m
memory: 1000Mi
cpu: 1000m
limits:
memory: 400Mi
cpu: 600m
memory: 1500Mi
cpu: 1500m

horizontal_scaling:
min_pods: 1
Expand Down
4 changes: 2 additions & 2 deletions internal/btfarchive/gcsbucketarchive.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func (archive GCSBucketArchive) List(ctx context.Context) ([]datatypes.BTFRecord
res = append(res, datatypes.BTFRecordIdentifier{
Distribution: components[0],
DistributionVersion: components[1],
KernelVersion: components[2],
Arch: components[3],
Arch: components[2],
KernelVersion: components[3],
})
}
}
Expand Down

0 comments on commit 04ba2cf

Please sign in to comment.