Git Product home page Git Product logo

kubernetes-ops's Introduction

Kubernetes-ops ๐ŸŒ€

School project to load balance and make some HA on a cluster Kubernetes installed with kubespray-ops project.

     )               (       )               (     
  ( /(        (      )\ ) ( /(      *   )    )\ )  
  )\())  (  ( )\ (  (()/( )\())(  ` )  /((  (()/(  
|((_)\   )\ )((_))\  /(_)|(_)\ )\  ( )(_))\  /(_)) 
|_ ((_) ((_|(_)_((_)(_))  _((_|(_)(_(_()|(_)(_))   
| |/ / | | || _ ) __| _ \| \| | __|_   _| __/ __|  
  ' <| |_| || _ \ _||   /| .` | _|  | | | _|\__ \  
 _|\_\\___/ |___/___|_|_\|_|\_|___| |_| |___|___/  

Made by FULCHIC Gaby

The project's core

To launch the project ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป

kubectl create -f hello-world/

To stop it ๐Ÿ›‘

kubectl delete -f hello-world/

More infos about Kubernetes for myself

Global commands

kubectl version
kubectl api-versions
kubectl get nodes

Namespaces

kubectl create -f ./gaby-namespace.yaml
kubectl delete namespaces gaby-namespace.yaml
kubectl get namespaces

  • with a get pods

kubectl get pods --namespace=gaby

Context to stop using --namespace (<-config)

kubectl config view
kubectl config current-context
kubectl config set-context dev --namespace=yournamespace
kubectl config use-context dev

Deployments

kubectl run test1234 image=library/hello-world --port=XXXX
kubectl get deployments

  • with a file

kubectl apply -f deployment.yaml

Services

kubectl expose deployment test1234 --type=LoadBalancer --port=8080 --target-port=8080
kubectl get services
kubectl describe theservice

Labels

You can set Labels in yaml file :D.
label:
name: it-prod-apps

With that you can manipulate some services or pods grouping them by their Labels.

kubectl -l name=it-prod-apps get services

Quotas / Resources

You can add quotas by using "resources" in the namespace.yml file. But you also create a file with a kind : ResourceQuota and you gonna create it using :

kubectl create -f ./resourcequota.yml --namespace=namespace
kubectl get quota --namespace=namespace
kubectl describe quota compute-resources-sample --namespace=namespace

Proxy

  • To expose the API kube via a proxy

kubectl proxy --port=8080
curl http://localhost:8080/api/

  • Get the pods from default namespaces for example

curl http://localhost:8080/api/v1/namespaces/default/pods

Begin with Kubernetes and Docker โœ”๏ธ

Hello-world docker with k8s :

kubectl run test1234 --image=library/hello-world --port=8080

Expose it :

kubectl expose deployment test1234 --type=LoadBalancer --port=8080 --target-port=8080

Get the ip exposed, there are 2 commands :

kubectl get svc
kubectl get services

Clean all :

kubectl delete deployment test1234
kubectl delete svc test1234

To Monitor ๐Ÿ“Š

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.