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
# kubespray v2.12.2 hosts.yml | |
all: | |
hosts: | |
ip-10-0-0-113.ec2.internal: | |
ansible_host: 3.80.xx.xxx | |
ip: 10.0.0.113 | |
access_ip: 10.0.0.113 | |
ip-10-0-0-138.ec2.internal: | |
ansible_host: 18.204.2xx.xxx | |
ip: 10.0.0.138 |
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
# these steps work with AWS EKS kubernetes v1.14 and kubespray v2.12.2 kubernetes v1.16.7 cloud:aws | |
kubectl apply -f ebs-gp2-storageclass.yml | |
# if using kubespray cloud aws then you need to set storageclass, eks has this set by default | |
# gp2-storageclass.yml | |
kind: StorageClass | |
apiVersion: storage.k8s.io/v1 | |
metadata: | |
name: gp2 | |
annotations: |
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
watch -t -n 0.1 iostat -d -t -y 5 1 |
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
aws_kubernetes_cluster_tag=k8s | |
aws_kubernetes_cluster_id=k8s | |
aws_zone=us-east-1b | |
aws_vpc=vpc-xxxxxx | |
aws_role_arn=arn:aws:iam::xxxxxxxxx:instance-profile/kube-ec2-role | |
aws_region=us-east-1 | |
aws_subnet_id=subnet-xxxxx | |
aws_route_table_id=rtb-xxxx | |
aws-vault exec api-profile -- ansible-playbook -i inventory/kube01/inventory.ini -u ubuntu \ |
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
region = "us-east-1" | |
availability_zone = "us-east-1b" | |
worker_instance_type = "t3.xlarge" | |
pem_name = "kube01" | |
subnet_id = "subnet-xxxxxx" | |
security_group_id = "sg-xxxxxx" | |
iam_role_name = "kube-ec2-role" |
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 | |
sudo apt update | |
# sudo apt upgrade | |
sudo apt install chrony -y && chronyc activity | |
sudo apt install python3-pip -y | |
sudo pip3 install --user awscli | |
sudo ~/.local/bin/aws configure <<EOF | |
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
# boiler plate ec2 instances for kubespray | |
# #!/bin/bash | |
# terraform init | |
# terraform plan | |
# terraform apply -var-file="main.tfvars" modules/ec2 | |
provider "aws" { | |
region = "us-east-1" | |
} |
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
# ebs-gp2-storageclass.yml | |
kind: StorageClass | |
apiVersion: storage.k8s.io/v1 | |
metadata: | |
name: ebs-gp2 | |
annotations: | |
storageclass.kubernetes.io/is-default-class: "true" | |
provisioner: kubernetes.io/aws-ebs | |
parameters: | |
type: gp2 |
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
root@node1:~/kube# cat ebs-static-pv.yml | |
# kubectl apply -f <this-pv>.yml | |
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: task-pv | |
spec: | |
capacity: | |
storage: 10Gi | |
accessModes: |
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
# boiler plate ec2 instances for kubespray | |
# #!/bin/bash | |
# terraform init | |
# terraform plan | |
# terraform apply -var-file="main.tfvars" modules/ec2 | |
provider "aws" { | |
region = "us-east-1" | |
} |