Useful Kubectl Commands
kubectl run -i --tty --rm debug --image=curlimages/curl --restart=Never -- www.google.com -vvv
kubectl run -i --tty --rm debug --image=busybox --restart=Never -- sh
Testing Volume Mount from Configmap
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
# Find Public IP | |
data "http" "whatismyip" { | |
url = "http://whatismyip.akamai.com/" | |
} | |
# Begin Variables | |
variable "aws_ami" { | |
description = "AMI to use" | |
default = "ami-4bf3d731" | |
} |
If something takes over your instance and you lose ssh, here is a way that you can recover it via Cloud-init (As long as you are using Cloud-Init). Use boot_cmd to recover or undo anychanges that caused this.
Find the instance ID and stop it.
aws ec2 stop-instances --instance-ids i-instanceID --force
Create your file. Use boot_cmd as this will execute on boot every time. See https://cloudinit.readthedocs.io/en/latest/topics/examples.html?highlight=systemd#run-commands-on-first-boot for the details.
Base64 encode it.
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
{ | |
"dcos-terraform/dcos/aws": { | |
"source": "git::https://github.com/dcos-terraform/terraform-aws-dcos.git?ref=release/v0.2" | |
}, | |
"dcos-terraform/infrastructure/aws": { | |
"source": "git::https://github.com/dcos-terraform/terraform-aws-infrastructure.git?ref=release/v0.2" | |
}, | |
"dcos-terraform/vpc/aws": { | |
"source": "git::https://github.com/dcos-terraform/terraform-aws-vpc.git?ref=release/v0.2" | |
}, |
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
# Find Public IP | |
data "http" "whatismyip" { | |
url = "http://whatismyip.akamai.com/" | |
} | |
# Begin Variables | |
variable "aws_ami" { | |
description = "AMI to use" | |
default = "ami-4bf3d731" | |
} |
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
# Find Public IP | |
data "http" "whatismyip" { | |
url = "http://whatismyip.akamai.com/" | |
} | |
# Begin Variables | |
variable "aws_ami" { | |
description = "AMI to use" | |
default = "ami-4bf3d731" | |
} |
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
curl -skSL \ | |
-H "Authorization: token=$(dcos config show core.dcos_acs_token)" \ | |
-H "Content-Type: application/json" \ | |
"$(dcos config show core.dcos_url)/mesos/slaves" | \ | |
jq -er '[.slaves[] | select(.active==true) | {id: .id, hostname: .hostname, active: .active, reserved_resources_full: (.reserved_resources_full)}]' | \ | |
jq -er '[.[] | select(.reserved_resources_full | length > 0)]' | \ | |
tee reservations.json |
NewerOlder