-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathday-16
More file actions
75 lines (55 loc) · 2.98 KB
/
day-16
File metadata and controls
75 lines (55 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
KOPS:
INFRASTRUCTURE: Resources used to run our application on cloud.
EX: Ec2, VPC, ALB, -------------
Minikube -- > single node cluster
All the pods on single node
kOps, also known as Kubernetes operations.
it is an open-source tool that helps you create, destroy, upgrade, and maintain a highly available, production-grade Kubernetes cluster.
Depending on the requirement, kOps can also provide cloud infrastructure.
kOps is mostly used in deploying AWS and GCE Kubernetes clusters.
But officially, the tool only supports AWS. Support for other cloud providers (such as DigitalOcean, GCP, and OpenStack) are in the beta stage.
ADVANTAGES:
• Automates the provisioning of AWS and GCE Kubernetes clusters
• Deploys highly available Kubernetes masters
• Supports rolling cluster updates
• Autocompletion of commands in the command line
• Generates Terraform and CloudFormation configurations
• Manages cluster add-ons.
• Supports state-sync model for dry-runs and automatic idempotency
• Creates instance groups to support heterogeneous clusters
ALTERNATIVES:
Amazon EKS , MINIKUBE, KUBEADM, RANCHER, TERRAFORM.
STEP-1: GIVING PERMISSIONS
IAM -- > USER -- > CREATE USER -- > NAME: KOPS -- > Attach Polocies Directly -- > AdministratorAccess -- > NEXT -- > CREATE USER
USER -- > SECURTITY CREDENTIALS -- > CREATE ACCESS KEYS -- > CLI -- > CHECKBOX -- > CREATE ACCESS KEYS -- > DOWNLOAD
aws configure (run this command on server)
SETP-2: INSTALL KUBECTL AND KOPS
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
wget https://github.com/kubernetes/kops/releases/download/v1.25.0/kops-linux-amd64
chmod +x kops-linux-amd64 kubectl
mv kubectl /usr/local/bin/kubectl
mv kops-linux-amd64 /usr/local/bin/kops
vim .bashrc
export PATH=$PATH:/usr/local/bin/ -- > save and exit
source .bashrc
SETP-3: CREATING BUCKET
aws s3api create-bucket --bucket devopsbatchnov6pm.k8s.local --region us-east-1
aws s3api put-bucket-versioning --bucket devopsbatchnov6pm.k8s.local --region us-east-1 --versioning-configuration Status=Enabled
export KOPS_STATE_STORE=s3://devopsbatchnov6pm.k8s.local
SETP-4: CREATING THE CLUSTER
kops create cluster --name rahams.k8s.local --zones us-east-1a --master-count=1 --master-size t2.medium --node-count=2 --node-size t2.micro
kops update cluster --name rahams.k8s.local --yes --admin
Suggestions:
* list clusters with: kops get cluster
* edit this cluster with: kops edit cluster rahams.k8s.local
* edit your node instance group: kops edit ig --name=rahams.k8s.local nodes-us-east-1a
* edit your master instance group: kops edit ig --name=rahams.k8s.local master-us-east-1a
ADMIN ACTIVITIES:
To scale the worker nodes:
kops edit ig --name=rahams.k8s.local nodes-us-east-1a
kops update cluster --name rahams.k8s.local --yes --admin
kops rolling-update cluster --yes
ADMIN ACTIVITIES:
kops update cluster --name rahams.k8s.local --yes
kops rolling-update cluster
TO DELETE: kops delete cluster --name rahams.k8s.local --yes