1 of 15

Slide Notes

DownloadGo Live

Learning Kubernetes

Published on Jul 31, 2017

No Description

PRESENTATION OUTLINE

Learning Kubernetes

Chapter 03: Getting Started with kubectl

Summary

  • what is kubectl
  • where we use it
  • configuration
  • initial commands

Getting Started with Kubectl

What is it and why do we use it?

What is kubectl

  • cli tool to interface with kube control plane
  • written in go
  • available on windows, osx, linux

What is kubectl

  • kubectl has a lot of subcommands
  • Start with basics; learn more as we go

Why use kubectl?

  • Everything can be done with API
  • CLI frontend to API

Why use kubectl?

  • Manual Troubleshooting, observation
  • Automation

Getting Started with Kubectl

Configuration

configuration

  • tell kubectl what cluster to communicate with
  • what credentials to communicate with
  • can be configured to use kubectl with many different clusters and users

Important Components

  • clusters
  • credentials
  • contexts

kubectl config

  • set
  • set-cluster
  • set-credential
  • set-context

Command Line

kubectl config

kubectl config --set-cluster ourcluster
--certificate-authority=./ourca.crt
--embed-certs=true
--server=https://ourserver.org:6443

kubectl config set-credentials admin-ourcluster
--token= eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9u...

kubectl config set-context ourcluster
--user=admin-ourcluster
--cluster=ourcluster