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
####################################################################### | |
# TOPICS | |
####################################################################### | |
# 1. BUILD CLOUD9 FROM CLOUDSHELL | |
# 2. BUILD EKS CLUSTER FROM CLOUD9 | |
# 3. BUILD A CONTAINER IMAGE | |
# 4. PUSH CONTAINER IMAGE TO ECR | |
# 5. DEPLOY FROM ECR TO K8S | |
# 6. CONTAINER ORCHESTRATION - balancing that which is desired against that which exists | |
# 7. K8S CLUSTERIP SERVICES - because pods need to talk to each other |
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
#!/bin/bash # requires mtools package | |
dd if=/dev/zero of=test.img bs=1M count=2 | |
mkdosfs test.img | |
mdir -i test.img | |
echo "Hello" > simple.txt | |
mcopy -i test.img simple.txt ::/simple.txt | |
mmd -i test.img stuff | |
mdir -i test.img stuff | |
rm simple.txt | |
mcopy -i test.img ::/simple.txt simple.txt |
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
# the minumum manifest required for scaled nginx exposed as a service | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: |
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
####################################################################### | |
# HELM - the k8s package manager | |
####################################################################### | |
# install utils | |
sudo yum install -y tree | |
# install helm (https://helm.sh/docs/intro/install/) | |
curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash |
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
INSTRUCTIONS | |
# we'll assume the AWS LOAD BALANCER (INGRESS) CONTROLLER is already installed | |
app_name=alpha | |
app_version=1.0.0 | |
export AWS_DEFAULT_REGION=$(curl --silent curl --silent http://169.254.169.254/latest/meta-data/placement/region) | |
eksctl utils associate-iam-oidc-provider \ |
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
export AWS_DEFAULT_REGION=$(curl --silent http://169.254.169.254/latest/meta-data/placement/region) | |
cluster=dev | |
namespace=passthru | |
mkdir -p ~/environment/${namespace}/ | |
# build the namespace manifest | |
kubectl create namespace ${namespace} -o yaml --dry-run=client | kubectl neat > ~/environment/${namespace}/namespace.yaml |
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
# the following will demonstrate how combined CPU requirements | |
# can stop a pod from being scheduled inside a given namespace | |
# create the manifest.yaml file shown below | |
# note the pod, named combo, is built from a pair of containers (nginx and redis) | |
cat > ./manifest.yaml << EOF | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: rqtest |
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
# https://aws.amazon.com/blogs/opensource/introducing-fine-grained-iam-roles-service-accounts/ | |
# requires https://github.com/itaysk/kubectl-neat | |
# set up variables | |
cluster=dev | |
namespace=irsa | |
mkdir -p ~/environment/${namespace}/ |
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
# inspired by: https://www.youtube.com/watch?v=f3APF1dP8w0 | |
######################################################################## | |
# create a customer managed key | |
######################################################################## | |
export AWS_DEFAULT_REGION=us-west-2 | |
# create the key | |
key_id=$(aws kms create-key --query "KeyMetadata.KeyId" --output text) |
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
####################################################################### | |
# TOPICS | |
####################################################################### | |
# 0. ASSUMPTIONS | |
# 1. CONFIGURE CLOUD9 (EC2) ENVIRONMENT | |
# 2. INSTALL APPMESH | |
# 3. BUILD CONTAINER IMAGE | |
# 4. PUSH CONTAINER IMAGE TO ECR | |
# 5. DEPLOY OUR APPS TO K8S WITHOUT APPMESH | |
# 6. MESHIFY THE BACKEND COMPONENTS |