Code Monkey home page Code Monkey logo

kubernetes-examples's Introduction

How to run in Kubernetes

  1. minikube start --driver='virtualbox' --memory 8192 --cpus 2 --extra-config=kubelet.max-pods=100
  2. minikube addons enable metrics-server
  3. minikube addons enable ingress
  4. eval $(minikube -p minikube docker-env)
  5. docker build -t mykube .
  6. kubectl apply -f kubernetes.yml

How to run in Kubernetes

  1. kind create cluster --config kind/kind-cluster-config.yaml
  2. kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
  3. docker build -t mykube:v1 .
  4. kind load docker-image mykube:v1
  5. kubectl apply -f kubernetes.yml

Install Prometheus

kubectl create namespace prometheus
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/kube-prometheus-stack --namespace prometheus
kubectl get pods -n prometheus
kubectl port-forward -n prometheus prometheus-prometheus-kube-prometheus-prometheus-0 9090
kubectl port-forward -n prometheus prometheus-grafana-74b9c448f6-qcptr 3000

Reference

Kafka Configuration (Using Docker)

First of all download (Confluent Community Tools)[curl -O http://packages.confluent.io/archive/7.0/confluent-community-7.0.0.tar.gz]

docker-compose -f docker-compose-kafka.yml up

Create a Topic

$CONFLUENT_BIN_PATH/kafka-topics --create --if-not-exists --bootstrap-server "localhost:9092" --topic "mytopic"

Send a Message

Connect to the topic

$CONFLUENT_BIN_PATH/kafka-console-producer --broker-list "localhost:9092" --topic "mytopic"

Send some message

My first message{ENTER}

Close connection

{CTRL+C}

Receiving Messages

$CONFLUENT_BIN_PATH/kafka-console-consumer --bootstrap-server "localhost:9092" --from-beginning --topic "mytopic" --group "my-consumer-group"

Problems

vboxnet0 is down

sudo ip link set vboxnet0 up
sudo ip address add 192.168.99.1/24 dev vboxnet0

kubernetes-examples's People

Contributors

sismico avatar

Stargazers

Rafael Ferraro avatar

Watchers

 avatar

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.