- local https://github.com/kubernetes-sigs/kind (or just use minikube if it works for you)
- cloud https://cloud.google.com/kubernetes-engine (for PersistentVolume and Ingress, I needed to try the real deal)
- practice environment: https://github.com/arush-sal/cka-practice-environment
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 | |
PEER_LIST_FILE=/etc/asg-peer-instances | |
SELF_IP=$(ifconfig eth0 | grep -o "inet .* netmask" | cut -f2 -d' ') | |
SELF_INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
SELF_PLACEMENT=$(curl http://169.254.169.254/latest/meta-data/placement/availability-zone) | |
SELF_REGION="${SELF_PLACEMENT%?}" | |
SELF_ASG=$(aws ec2 describe-tags --filters "Name=resource-id,Values=${SELF_INSTANCE_ID}" --region $SELF_REGION --query 'Tags[?Key==`aws:autoscaling:groupName`].Value' --output text) | |
ASG_INSTANCE_IDS=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name $SELF_ASG --region $SELF_REGION --query 'AutoScalingGroups[*].Instances[*].InstanceId' --output text | xargs) | |
AWS_INSTANCE_IPS=$(aws ec2 describe-instances --instance-ids $ASG_INSTANCE_IDS --region $SELF_REGION --query 'Reservations[*].Instances[*].PrivateIpAddress' --filters 'Name=instance-state-name,Values=running' --output text) | |
PEER_LIST=$(echo $AWS_INSTANCE_IPS | sed "s/${SELF_IP}//g" | xargs) |
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
# Module Source - https://github.com/vkhatri/aws-transit-vpc/tree/feature-vrf | |
# http://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html | |
import ast | |
import logging | |
import sys | |
# symlink transit-vpc-poller.py module for import workaround | |
# ln -s transit-vpc-push-cisco-config.py transit_vpc_push_cisco_config.py | |
import transit_vpc_push_cisco_config | |
# Set Logging stream to STDOUT |
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
# Module Source - https://github.com/vkhatri/aws-transit-vpc/tree/feature-vrf | |
# Change Module Source accordingly, currently | |
import os | |
import ast | |
import logging | |
import sys | |
# symlink transit-vpc-poller.py module for import workaround | |
# ln -s transit-vpc-poller.py transit_vpc_poller.py | |
import transit_vpc_poller |
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
--- | |
exhibitor_storage_backend: static | |
oauth_enabled: false | |
telemetry_enabled: false | |
bootstrap_url: http://192.168.1.100:80 | |
cluster_name: dev | |
master_discovery: static | |
master_list: | |
- 192.168.1.1 | |
- 192.168.1.2 |
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 -e | |
if [ -f "/usr/bin/docker" ]; then | |
exited=$(docker ps -a -q -f status=exited | wc -l) | |
if [ $exited == "0" ]; then | |
echo "No exited container to Remove" | |
else | |
echo "Removing exited docker containers..." |
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 | |
# Info: Shell Wrapper to populate Marathon Application | |
# Containers IP & Port ENV Variables. | |
# | |
# Variables: | |
# MARATHON_GROUP: marathon group name | |
# e.g. Marathon APP - /group0/app | |
# MARATHON_GROUP=group0 | |
# e.g. Marathon APP - /group0/group1/app |
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
response=$(cat -) | |
payload=$(echo $response | sed -e 's/^.*"Payload":"\([^"]*\)".*$/\1/') | |
# action string "runme" == byte "cnVubWU=" , replace "runme" with your payload data | |
if [ "$payload" == "cnVubWU=" ]; then | |
logger restarting ntpd, consul triggered by payload $payload | |
# /usr/bin/sudo /sbin/service ntpd restart | |
else | |
logger skipping ntpd restart, consul triggered by payload $payload | |
fi |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
require 'date' | |
enable = true # set to false for dry run | |
retention_days = 30 # retention period | |
today_date = Date.today | |
deleted_any = false |
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
# Install Packages | |
yum install kernel-headers kernel-devel # reboot instance if possible | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel patch telnet mdadm nfs-utils openssl-devel git libxml2 libxml2-devel libxslt libxslt-devel wget libtool pkgconfig nasm | |
# Set ENV Variables | |
export PATH=$PATH:/usr/local/bin | |
export FMP=/usr/local | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
NewerOlder