Skip to content

Instantly share code, notes, and snippets.

@innovia
Last active May 6, 2018 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save innovia/ce7de0f5e5df35a9d45bddfb7df1047d to your computer and use it in GitHub Desktop.
Save innovia/ce7de0f5e5df35a9d45bddfb7df1047d to your computer and use it in GitHub Desktop.
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
labels:
name: p3.2xlarge
spec:
image: My-k8s-1.9-debian-stretch-2018-05-03
kubelet:
featureGates:
DevicePlugins: "true"
additionalUserData:
- name: configure_nvidia_card
type: text/x-shellscript
content: |
#!/bin/sh
# Custom configurations per class of nvidia video card
AWS_INSTANCE_TYPE=$(curl -m 2 -fsSL http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r ".instanceType" || true)
AWS_INSTANCE_CLASS=$(echo $AWS_INSTANCE_TYPE | cut -d . -f 1 || true)
case "$AWS_INSTANCE_CLASS" in
"g2" | "g3")
nvidia-smi -ac 2505,1177
;;
"p2")
nvidia-smi -ac 2505,875
nvidia-smi -acp 0
;;
"p3")
nvidia-smi -ac 877,1530
nvidia-smi -acp 0
;;
*)
;;
esac
machineType: p3.2xlarge
maxPrice: "3.00"
maxSize: 10
minSize: 0
role: Node
rootVolumeOptimization: true
rootVolumeSize: 64
subnets:
- us-east-2a
- us-east-2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment