Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kuma Meshes Part I

Kuma Meshes Part I

Kuma Meshes Part I - The basics. Explaining the basics of how Meshes and Kuma Meshes work. It goes through how to get a cluster ready to start making tests with Kuma by diving into kubernetes concepts and quick installation command installations.

More Decks by João Filipe Sabino Esperancinha

Other Decks in Programming

Transcript

  1. How it works, what we can monitor with it and

    why is it different By João Esperancinha (2024/03/31)
  2. Who am I? Overview Understanding the problems Project objective Target

    audience Market trends Cycle diagram João Esperancinha • Java • Kotlin • Groovy • Scala • Software Engineer 10+ years • JESPROTECH owner for 1 year • Kong Champion • Java Professional • Spring Professional
  3. Intro - What is Kuma? Kuma is a platform agnostic

    open-source control plane for service mesh and microservices management, with support for Kubernetes, VM, and bare metal environments. https://kuma.io/docs/2.6.x/introduction/overview-of-kuma/
  4. Chapter I - Summary Before even beginning exploring Kuma we

    need a complete cluster and a functional application system 01 | Our application 02 | Installing all commands 03 | Creating a Cluster 04 | Creating a local docker registry 05 | Going through the code 06 | Making the deploy scripts 07 | Running the Demo application
  5. Chapter I - Our Application Albatross picture by chrispearson72 Flickr

    stream CC BY 2.0 DEED / https://nl.wikipedia.org/wiki/Albatrossen#/media/Bestand:Black_Browed_Albatross_gnd.jpg
  6. Chapter I - Our Application Albatross picture by chrispearson72 Flickr

    stream CC BY 2.0 DEED / https://nl.wikipedia.org/wiki/Albatrossen#/media/Bestand:Black_Browed_Albatross_gnd.jpg
  7. What do we need in general 1 A cluster to

    get our pods running. This will be achieved with kind. (kubernetes in docker) 3 A way to manage and configure our pods. This will be achieved with kubectl 2 A local registry that we can access inside our deployment environment. This will be achieved with kind 4 A command to allow Kuma to install the environment and inject the sidecars. This will be achieved with kumactl. Chapter I - Our Application
  8. Chapter I - Our Application kind create cluster --name=wlsm-mesh-zone kubectl

    cluster-info --context kind-wlsm-mesh-zone Creating a Cluster
  9. Chapter I - Our Application helm repo add kuma https://kumahq.github.io/charts

    helm repo update helm upgrade -i kuma kuma/kuma helm install --create-namespace --namespace kuma-system kuma kuma/kuma Creating a Cluster - Control Plane GUI
  10. Chapter I - Our Application docker build . --tag localhost:5001/wlsm-listener-service;

    docker push localhost:5001/wlsm-listener-service; Creating a local docker registry
  11. Chapter I - Our Application spring.r2dbc.url=r2dbc:postgresql://wlsm-database-deployment.wlsm-namespace.svc.cluster.local:5432/wlsm Going through the code

    wslm.url.collector=http://wlsm-collector-deployment.wlsm-namespace.svc.cluster.local:8081/api/v1/collector Listener Service Collector Service
  12. Chapter I - Our Application apiVersion: v1 kind: Namespace metadata:

    name: wlsm-namespace labels: kuma.io/sidecar-injection: enabled --- Making the deploy scripts --- apiVersion: v1 kind: Service metadata: name: wlsm-listener-deployment spec: selector: app: wlsm-listener ports: - protocol: TCP appProtocol: http port: 8080 apiVersion: apps/v1 kind: Deployment metadata: name: wlsm-listener namespace: wlsm-namespace spec: replicas: 1 selector: matchLabels: app: wlsm-listener template: metadata: labels: app: wlsm-listener spec: containers: - name: wlsm-listener-service image: localhost:5001/wlsm-listener-service:latest imagePullPolicy: Always ports: - containerPort: 8080
  13. Chapter II - Exploring Kuma features MeshTrafficPermission echo "apiVersion: kuma.io/v1alpha1

    kind: MeshTrafficPermission metadata: namespace: kuma-system name: mtp spec: targetRef: kind: Mesh from: - targetRef: kind: Mesh default: action: Allow" | kubectl apply -f -
  14. Chapter II - Exploring Kuma features Mesh echo "apiVersion: kuma.io/v1alpha1

    kind: Mesh metadata: name: default spec: mtls: enabledBackend: ca-1 backends: - name: ca-1 type: builtin" | kubectl apply -f -
  15. Chapter II - Exploring Kuma features MeshTrafficPermission (Deny) apiVersion: kuma.io/v1alpha1

    kind: MeshTrafficPermission metadata: namespace: kuma-system name: mtp spec: targetRef: kind: Mesh from: - targetRef: kind: Mesh default: action: Deny" | kubectl apply -f -
  16. Chapter II - Exploring Kuma features MeshTrafficPermission (Specific) echo "

    apiVersion: kuma.io/v1alpha1 kind: MeshTrafficPermission metadata: namespace: kuma-system name: wlsm-database spec: targetRef: kind: MeshService name: wlsm-database-deployment_wlsm-namespace_svc_5432 from: - targetRef: kind: MeshService name: wlsm-collector-deployment_wlsm-namespace_svc_8081 default: action: Allow" | kubectl apply -f -
  17. Chapter II - Exploring Kuma features MeshFaultInjection (Specific) echo "

    apiVersion: kuma.io/v1alpha1 kind: MeshFaultInjection metadata: name: default namespace: kuma-system labels: kuma.io/mesh: default # optional, defaults to `default` if it isn't configured spec: targetRef: kind: MeshService name: wlsm-collector-deployment_wlsm-namespace_svc_8081 from: - targetRef: kind: MeshService name: wlsm-listener-deployment_wlsm-namespace_svc_8080 default: http: - abort: httpStatus: 500 percentage: 50" | kubectl apply -f -
  18. • Source Repository ◦ https://github.com/jesperancinha/wild-life-safety-monitor Use git clone from the

    command prompt to download the full code base: > git clone https://github.com/jesperancinha/wild-life-safety-monitor.git You’ll be prompted for a username and password which should be your github account. The easy way: > make b > make run The manual way: > gradle build > ./gradlew run Project Location
  19. About me Homepage - https://joaofilipesabinoesperancinha.nl LinkedIn - https://www.linkedin.com/in/joaoesperancinha/ YouTube -

    JESPROTECH https://www.youtube.com/channel/UCzS_JK7QsZ7ZH-zTc5kBX_g https://www.youtube.com/@jesprotech Bluesky - https://bsky.app/profile/jesperancinha.bsky.social Mastodon - https://masto.ai/@jesperancinha GitHub - https://github.com/jesperancinha Hackernoon - https://hackernoon.com/u/jesperancinha DevTO - https://dev.to/jofisaes Medium - https://medium.com/@jofisaes