$ kubectl create -f crd.yaml
customresourcedefinition.apiextensions.k8s.io/emojis.emoji.local created
$ kubectl create -f cr.yaml
emoji.emoji.local/example-emoji created
$ kubectl get emoji example-emoji -o json
{
"apiVersion": "emoji.local/v1alpha1",
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
#!/bin/bash | |
set -o xtrace | |
rm -rf /etc/cni/net.d/* | |
ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region') | |
LIFECYCLE=$(aws ec2 describe-instances --region=$REGION --instance-ids=$ID | jq -r '.Reservations[].Instances[].InstanceLifecycle') | |
if [[ $LIFECYCLE = "spot" ]]; then | |
EXTRA_ARGS="--node-labels=lifecycle=Ec2Spot,aws.amazon.com/spot=true,node-role.kubernetes.io/spot-worker="; | |
else |
Usage:
$ kubectl get nodes -o go-template-file=./taints-labels.tmpl
Output:
my-master-node
Taints:
node-role.kubernetes.io/master=:NoSchedule