Giter Site home page Giter Site logo

practice-kubectl-awscli-gcludcli's Introduction

Practice-Kubernetes

Kubernetes (commonly referred to as "k8s") is an open source container cluster manager originally designed by Google and donated to the Cloud Native Computing Foundation. It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts".

Kubernets is an orchestrator that runs docker containers. User installs kubernets in his local computer and runs the cloud from his local machine. The cluster that kubernetes creates can be in aws/google/other

There are 3 folders that describes procedure to create the cluster in different cluster providers

In this project we are going to leart how to use Kubernetes (k8s) and creating the cluster in different providers:

Commonfiles contains all the common installation instructions for installing k8s in your local pc

It also contains instructions for creating the cluster in these:

1. gcloud
2. aws
3. minikube
4. appscode

Synopsys

Installing kubernetes:

Find the latest version here:

https://github.com/kubernetes/kubernetes/releases

Then goto changelog and find the proper client version for me its darwin 64amd just download it, extract it

cd platforms/darwin/amd64
chmod +x kubectl
cp kubectl /usr/local/bin/kubectl
kubectl version

To Check that kubectl is properly configured(and remote cluster is reachable) by getting the cluster state:

kubectl cluster-info

If you see a url response, you are ready to go.

Creating your docker hub

You need a docker hub in case you are thinking about having some free docker images on which you can test you local kubernetes cluster. In the examples used here I have pushed the images in my private docker repo, and the repo is public so anyone can pull but only I can push.

How to create your own docker hub

1. Register here: `https://cloud.docker.com`
2. Create a new repository where you can push the images
3. `docker login` use your credentials to login and then push everything
4. now I can push stuffs using `docker push docker.io/ayonnayihan/sample-image-test:0.1`

Cheatsheet

kubectl get version

kubectl get nodes
kubectl get pods
kubectl get secrets
kubectl get services
kubectl create -f <file>
kubectl get namespaces
kubectl logs <pod-name> 
kubectl port-forward <pod-name> <local-port>:<remote-port>

kubectl delete pods --all

kubectl exec <pod-name> -- ls /                         # Run command in existing pod (1 container case)
kubectl exec <pod-name> -c <container-name> -- ls /     # Run command in existing pod (multi-container case)

kubectl config view
kubectl cluster-info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.