Last active
January 5, 2024 15:47
-
-
Save coryodaniel/8822577fd0dfd22da60ebee54a8687c5 to your computer and use it in GitHub Desktop.
Setting GOMAXPROCS to resource limits cpu using Kubernetes downward API
This file contains hidden or 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: mypod | |
spec: | |
containers: | |
- name: mycontainer | |
image: myimage | |
resources: | |
limits: | |
cpu: "2" | |
env: | |
- name: GOMAXPROCS | |
valueFrom: | |
resourceFieldRef: | |
containerName: mycontainer | |
resource: limits.cpu | |
# divisor: necessary if setting w millicpu + probably an entry point to round if a decimal value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment