Showing posts with label Kubernetes. Show all posts
Showing posts with label Kubernetes. Show all posts

Tuesday, August 29, 2023

Install Kubectl on Linux

  Kubernetes Logo Png, Transparent Png , Transparent Png Image - PNGitem

Kubernetes
 
sudo apt-get update 
 

Get:1 http://security.ubuntu.com/ubuntu groovy-security InRelease [110 kB]                                                                                    

Hit:2 http://in.archive.ubuntu.com/ubuntu groovy InRelease                                                                                                    

Get:3 http://in.archive.ubuntu.com/ubuntu groovy-updates InRelease [115 kB]                                                

Get:4 http://security.ubuntu.com/ubuntu groovy-security/main i386 Packages [104 kB]                                                  

Get:5 http://security.ubuntu.com/ubuntu groovy-security/main amd64 Packages [289 kB]                                                              

Get:6 http://in.archive.ubuntu.com/ubuntu groovy-backports InRelease [101 kB]                                            

Get:7 http://in.archive.ubuntu.com/ubuntu groovy-updates/main i386 Packages [197 kB]                                           

Get:8 http://in.archive.ubuntu.com/ubuntu groovy-updates/main amd64 Packages [450 kB]                                             

Get:9 http://security.ubuntu.com/ubuntu groovy-security/main Translation-en [70.1 kB]                                                                

Get:10 http://security.ubuntu.com/ubuntu groovy-security/main amd64 DEP-11 Metadata [18.8 kB]                                                                

Get:11 http://security.ubuntu.com/ubuntu groovy-security/main DEP-11 48x48 Icons [8,330 B]                                                                                

Get:12 http://security.ubuntu.com/ubuntu groovy-security/main DEP-11 64x64 Icons [12.1 kB]                                                                         

Get:13 http://security.ubuntu.com/ubuntu groovy-security/main amd64 c-n-f Metadata [4,076 B]                                         

Get:14 http://in.archive.ubuntu.com/ubuntu groovy-updates/main Translation-en [114 kB]                                                

Get:15 http://security.ubuntu.com/ubuntu groovy-security/universe amd64 Packages [78.2 kB]                                       

Get:16 http://in.archive.ubuntu.com/ubuntu groovy-updates/main amd64 DEP-11 Metadata [55.5 kB]                                                                

Get:17 http://in.archive.ubuntu.com/ubuntu groovy-updates/main DEP-11 48x48 Icons [31.4 kB]                                                                              

Get:18 http://security.ubuntu.com/ubuntu groovy-security/universe i386 Packages [60.8 kB]                                                                               

Get:19 http://in.archive.ubuntu.com/ubuntu groovy-updates/main DEP-11 64x64 Icons [52.1 kB]                                                                               

Get:20 http://in.archive.ubuntu.com/ubuntu groovy-updates/main amd64 c-n-f Metadata [7,848 B]                                                                    

Get:21 http://in.archive.ubuntu.com/ubuntu groovy-updates/restricted i386 Packages [15.9 kB]                                        

Get:22 http://in.archive.ubuntu.com/ubuntu groovy-updates/restricted amd64 Packages [162 kB]                                                                          

Get:23 http://security.ubuntu.com/ubuntu groovy-security/universe Translation-en [32.7 kB]                                                                    

Get:24 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 Packages [178 kB]                                                                        

Get:25 http://security.ubuntu.com/ubuntu groovy-security/universe amd64 DEP-11 Metadata [4,616 B]                                                               

Get:26 http://security.ubuntu.com/ubuntu groovy-security/universe amd64 c-n-f Metadata [3,232 B]                                                                                             

Get:27 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe i386 Packages [98.7 kB]                                                                                                   

Get:28 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe Translation-en [67.2 kB]                                              

Get:29 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 DEP-11 Metadata [104 kB]                                                

Get:30 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 c-n-f Metadata [5,500 B]                                                         

Get:31 http://in.archive.ubuntu.com/ubuntu groovy-updates/multiverse i386 Packages [4,764 B]                                                                

Get:32 http://in.archive.ubuntu.com/ubuntu groovy-updates/multiverse amd64 Packages [14.0 kB]                                                   

Get:33 http://in.archive.ubuntu.com/ubuntu groovy-updates/multiverse amd64 DEP-11 Metadata [2,468 B]                                            

Get:34 http://in.archive.ubuntu.com/ubuntu groovy-backports/universe amd64 DEP-11 Metadata [600 B]                                                      

Hit:35 https://download.docker.com/linux/ubuntu groovy InRelease                                                                                                                                         

Ign:36 https://pkg.jenkins.io/debian-stable binary/ InRelease                                                                                                                                            

Get:37 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]

Get:38 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]

Get:39 https://pkg.jenkins.io/debian-stable binary/ Packages [19.9 kB]

Fetched 2,594 kB in 16s (160 kB/s)

Reading package lists... Done

 

sudo apt-get install -y apt-transport-https ca-certificates curl


Reading package lists... Done

Building dependency tree      

Reading state information... Done

curl is already the newest version (7.68.0-1ubuntu4.3).

The following NEW packages will be installed:

  apt-transport-https

The following packages will be upgraded:

  ca-certificates

1 upgraded, 1 newly installed, 0 to remove and 271 not upgraded.

Need to get 1,708 B/149 kB of archives.

After this operation, 165 kB of additional disk space will be used.

Get:1 http://in.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 apt-transport-https all 2.1.10ubuntu0.3 [1,708 B]

Fetched 1,708 B in 0s (3,585 B/s)              

Preconfiguring packages ...

(Reading database ... 271936 files and directories currently installed.)

Preparing to unpack .../ca-certificates_20210119~20.10.1_all.deb ...

Unpacking ca-certificates (20210119~20.10.1) over (20200601) ...

Selecting previously unselected package apt-transport-https.

Preparing to unpack .../apt-transport-https_2.1.10ubuntu0.3_all.deb ...

Unpacking apt-transport-https (2.1.10ubuntu0.3) ...

Setting up apt-transport-https (2.1.10ubuntu0.3) ...

Setting up ca-certificates (20210119~20.10.1) ...

Updating certificates in /etc/ssl/certs...

10 added, 7 removed; done.

Processing triggers for man-db (2.9.3-2) ...

Processing triggers for ca-certificates (20210119~20.10.1) ...

Updating certificates in /etc/ssl/certs...

0 added, 0 removed; done.

Running hooks in /etc/ca-certificates/update.d...

done.

done.

 

sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

 

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

 

deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main

 

sudo apt-get update

 

Hit:1 http://in.archive.ubuntu.com/ubuntu groovy InRelease                                                                                                                                        

Ign:2 https://pkg.jenkins.io/debian-stable binary/ InRelease                                                                                                                                      

Hit:3 https://pkg.jenkins.io/debian-stable binary/ Release                                                                                                              

Hit:4 http://in.archive.ubuntu.com/ubuntu groovy-updates InRelease                                                                                    

Hit:6 http://in.archive.ubuntu.com/ubuntu groovy-backports InRelease                                                                             

Get:7 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [9,383 B]                                    

Get:8 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages [46.2 kB]                

Hit:9 https://download.docker.com/linux/ubuntu groovy InRelease                                        

Hit:10 http://security.ubuntu.com/ubuntu groovy-security InRelease                                    

Fetched 55.6 kB in 6s (9,239 B/s)                                                                                                                                                                        

Reading package lists... Done

 

sudo apt-get install -y kubectl

 

Reading package lists... Done

Building dependency tree      

Reading state information... Done

The following NEW packages will be installed:

  kubectl

0 upgraded, 1 newly installed, 0 to remove and 271 not upgraded.

Need to get 8,972 kB of archives.

After this operation, 46.4 MB of additional disk space will be used.

Get:1 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubectl amd64 1.21.0-00 [8,972 kB]

Fetched 8,972 kB in 8s (1,130 kB/s)                                                                                                                                                                      

Selecting previously unselected package kubectl.

(Reading database ... 271943 files and directories currently installed.)

Preparing to unpack .../kubectl_1.21.0-00_amd64.deb ...

Unpacking kubectl (1.21.0-00) ...

Setting up kubectl (1.21.0-00) ...

 

kubectl

 

kubectl controls the Kubernetes cluster manager.

 Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/

Basic Commands (Beginner):

  create        Create a resource from a file or from stdin.

  expose        Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service

  run           Run a particular image on the cluster

  set           Set specific features on objects

Basic Commands (Intermediate):

  explain       Documentation of resources

  get           Display one or many resources

  edit          Edit a resource on the server

  delete        Delete resources by filenames, stdin, resources and names, or by resources and label selector

Deploy Commands:

  rollout       Manage the rollout of a resource

  scale         Set a new size for a Deployment, ReplicaSet or Replication Controller

  autoscale     Auto-scale a Deployment, ReplicaSet, StatefulSet, or ReplicationController

Cluster Management Commands:

  certificate   Modify certificate resources.

  cluster-info  Display cluster info

  top           Display Resource (CPU/Memory) usage.

  cordon        Mark node as unschedulable

  uncordon      Mark node as schedulable

  drain         Drain node in preparation for maintenance

  taint         Update the taints on one or more nodes

Troubleshooting and Debugging Commands:

  describe      Show details of a specific resource or group of resources

  logs          Print the logs for a container in a pod

  attach        Attach to a running container

  exec          Execute a command in a container

  port-forward  Forward one or more local ports to a pod

  proxy         Run a proxy to the Kubernetes API server

  cp            Copy files and directories to and from containers.

  auth          Inspect authorization

  debug         Create debugging sessions for troubleshooting workloads and nodes

Advanced Commands:

  diff          Diff live version against would-be applied version

  apply         Apply a configuration to a resource by filename or stdin

  patch         Update field(s) of a resource

  replace       Replace a resource by filename or stdin

  wait          Experimental: Wait for a specific condition on one or many resources.

  kustomize     Build a kustomization target from a directory or URL.

Settings Commands:

  label         Update the labels on a resource

  annotate      Update the annotations on a resource

  completion    Output shell completion code for the specified shell (bash or zsh)

Other Commands:

  api-resources Print the supported API resources on the server

  api-versions  Print the supported API versions on the server, in the form of "group/version"

  config        Modify kubeconfig files

  plugin        Provides utilities for interacting with plugins.

  version       Print the client and server version information

Usage:

  kubectl [flags] [options]

Use "kubectl <command> --help" for more information about a given command.

Use "kubectl options" for a list of global command-line options (applies to all commands).