Skip to content

Instantly share code, notes, and snippets.

View felipecosta09's full-sized avatar
:octocat:
Focusing

Felipe Costa felipecosta09

:octocat:
Focusing
View GitHub Profile
@felipecosta09
felipecosta09 / kopsvalidate.sh
Last active April 10, 2020 13:03
KOPS Validate Cluster Success
# KOPS Validate Cluster Success
kops validate cluster
[root@ip-172-31-41-51 ec2-user]# kops validate cluster
Using cluster from kubectl context: k8s-gitlab.k8s.local
Validating cluster k8s-gitlab.k8s.local
INSTANCE GROUPS
@felipecosta09
felipecosta09 / kopserror.sh
Created April 10, 2020 11:54
KOPS Validate Cluster Error
# KOPS Validate Cluster Error
kops validate cluster
------------------------------------
# Result
[root@ec2-user]# kops validate cluster
Using cluster from kubectl context: k8s-gitlab.k8s.local
@felipecosta09
felipecosta09 / kopsapply.sh
Created April 10, 2020 11:52
KOPS Configuration and Deploy your Cluster
# Apply KOPS Configuration and Deploy your Cluster
kops update cluster ${NAME} --yes
I0408 11:40:22.496308 26686 apply_cluster.go:556] Gossip DNS: skipping DNS validation
I0408 11:40:22.868197 26686 executor.go:103] Tasks: 0 done / 96 total; 44 can run
I0408 11:40:24.467352 26686 vfs_castore.go:729] Issuing new certificate: "apiserver-aggregator-ca"
I0408 11:40:24.603492 26686 vfs_castore.go:729] Issuing new certificate: "etcd-manager-ca-events"
I0408 11:40:24.722944 26686 vfs_castore.go:729] Issuing new certificate: "ca"
I0408 11:40:25.039968 26686 vfs_castore.go:729] Issuing new certificate: "etcd-manager-ca-main"
@felipecosta09
felipecosta09 / kopsconfig.sh
Last active April 10, 2020 13:05
KOPS Configuration
# Get KOPS Configuration
kops get ig --name ${NAME}
-------------------------------
# Result
[root@ip-172-31-41-51 ec2-user]# kops get ig --name ${NAME}
NAME ROLE MACHINETYPE MIN MAX ZONES
@felipecosta09
felipecosta09 / kopsworkernodes.sh
Last active April 11, 2020 07:21
KOPS Worker Nodes Configuration
# Edit KOPS Worker Nodes Configuration
kops edit ig nodes --name ${NAME}
---------------------------------------------
# Result
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
@felipecosta09
felipecosta09 / kopsmaster.sh
Created April 10, 2020 11:46
KOPS Master Node Configuration
# Edit KOPS Master Node Configuration
kops edit cluster ${NAME}
@felipecosta09
felipecosta09 / kopssshkey.sh
Created April 10, 2020 11:44
KOPS ssh key
# Generate a ssh key for KOPS
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa
kops create secret --name ${NAME} sshpublickey admin -i ~/.ssh/id_rsa.pub
@felipecosta09
felipecosta09 / kopscreate.sh
Last active April 10, 2020 11:41
Create KOPS Cluster Configuration
# Create KOPS Cluster Configuration
kops create cluster --zones us-east-1a,us-east-1b,us-east-1c ${NAME}
------------------------------------------------------------------------------
# Result
[root@ec2-user] kops create cluster --zones us-east-1a,us-east-1b,us-east-1c ${NAME}
I0408 11:25:53.884925 26564 create_cluster.go:562] Inferred --cloud=aws from zone "us-east-1a"
@felipecosta09
felipecosta09 / kopsev.sh
Last active April 10, 2020 11:35
KOPS Env
# Set Environment Variables for KOPS
export NAME=YourClusterName.k8s.local
export KOPS_STATE_STORE=s3://YourS3BucketName
@felipecosta09
felipecosta09 / kops.sh
Last active April 10, 2020 11:34
Install KOPS
#Install KOPS
curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
chmod +x ./kops
sudo mv ./kops /usr/local/bin/