-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CPU limit, CPU Reservation and Memory Reservation
This adds support for CPU limit, CPU reservation as well as memory reservation. Specifically, when using the `deploy` key in Docker Compose.
- Loading branch information
Showing
9 changed files
with
252 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3" | ||
|
||
services: | ||
foo: | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.01' | ||
memory: 50M | ||
reservations: | ||
cpus: '0.001' | ||
memory: 20M | ||
image: redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"kind": "List", | ||
"apiVersion": "v1", | ||
"metadata": {}, | ||
"items": [ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "foo", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "foo" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "headless", | ||
"port": 55555, | ||
"targetPort": 0 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "foo" | ||
}, | ||
"clusterIP": "None" | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
}, | ||
{ | ||
"kind": "Deployment", | ||
"apiVersion": "extensions/v1beta1", | ||
"metadata": { | ||
"name": "foo", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "foo" | ||
} | ||
}, | ||
"spec": { | ||
"replicas": 1, | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "foo" | ||
} | ||
}, | ||
"spec": { | ||
"containers": [ | ||
{ | ||
"name": "foo", | ||
"image": "redis", | ||
"resources": { | ||
"limits": { | ||
"cpu": "10", | ||
"memory": "52428800" | ||
}, | ||
"requests": { | ||
"cpu": "1", | ||
"memory": "20971520" | ||
} | ||
} | ||
} | ||
], | ||
"restartPolicy": "Always" | ||
} | ||
}, | ||
"strategy": {} | ||
}, | ||
"status": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters