Showing posts with label k8s. Show all posts
Showing posts with label k8s. Show all posts

Wednesday, March 11, 2020

Running a rich Microservice constellation in Kubernetes

Languages have trade-offs like any solution in tech. Microservices are great for many reasons, one of them allows the best tool for the job. Kubernetes allows us to have the same operational standards and procedures even using different languages and solutions. For this blog post, I want to show a simple project I build which is a constellation of services. There are 5 microservices, written in several languages like Scala, Java, Go, Python and Rust. The services do a pretty basic math operation like (+, - , / , *) and the Scala one does the aggregation and orchestrate the other services using a polish notation algorithm and REST calls.

The Video



Calc Services (5 Microservices Scala, Go, Rust, Python, and Java) running on K8s from Diego Pacheco on Vimeo.

The Source Code

The complete source code is here on my github.

Cheers,
Diego Pacheco

Saturday, April 20, 2019

Microk8s


Microk8s is another lightweight k8s distribution - perfect for local tests, an interesting alternative to Minikube, k3s, and Kind.  Microk8s works smoothly in 42 flavors of Linux(Geek Moment: You know is the right answer when you see the number 42. LOL. ).  Microk8s has easy install and several interesting features like Local Storage, Dashboards, Metrics, DNS, Ingress, Istio and much more.

Zero Ops needed with a single k8s cluster done right. That's the marketing of microk8s. In practices, the product works very well but I found a bit slow(start and stop). However installing istio, is 1 command line away from happiness.  Microk8s supports several versions of Kubernetes from 1.10+ to 1.13+ right now(20/04/2019) - k8s is 1.14+.  If you are a hardcore Linux user you must try mcirok8s.




Running Microk8s on Ubuntu



Cheers,
Diego Pacheco

Kind - Kubernetes in Docker

Kind - Allow us to run Kubernetes in Docker. This is not a production-ready solution - however, has a lot of potential in order to make a safe and lightweight alternative option to Minikube.  Kind is built with Go and uses Docker API in order to get things spinning.
I got impressed with the speed thing runs with kind, this is an interesting alternative together with k3s and Minikube.




Getting Started with Kind



Cheers,
Diego Pacheco

Using Multiple profiles with Minikube

Kubernetes is the new Linux. K8s is the spec for the multi-poly cloud world. Running k8s could be very resource intensive, so is always a good idea being able to run things locally. For several reasons like Engineering Productivity, Tests and Experiments and so on and on. If you are working with Istio like I'm, you might realize it's a bit heavy to run local, especially if you do have other things running on k8s.  Minikube is the goto solution for local kubernetes clusters. However, as I said before, it can get pretty heavy when Istio gets involved. So the solution is pretty simple, it not much advertised. Minikube has a profile feature which allows you to create multiple profiles. Each profile will be a 2GB DISK VM created in Virtualbox. This is great because now you can run multiple kubernetes versions and multiple clusters doing multi experiments. IMHO is always great to have a k8s cluster ready to test things so I have multiple profiles like istio, lightweight, tests, etc... The first time you create the profile takes some time, up to 10min worst case but after the profile created things are super fast.

Running Multiple profiles with Minikube



Cheers,
Diego Pacheco

Sunday, March 3, 2019

Kubernetes Everywhere with k3s

Kubernetes is becoming the truly cloud-native specification for the cloud. However not all software runs on the cloud, there are other uses cases like embedded software(IoT and microcontrollers) besides IoT there is another kind of computation that is growing more a more nowadays called Edge, thanks to the low latency and facility capabilities. Would be great run the same infrastructure for the edge/IoT as we do for the cloud? Well, rancher folks addressed that with k3s. A super lightweight kubernetes distribution where they replace things and remove features instead of adding, This is great not only for the IoT/Edge uses cases but also for folks who study the cluster in the academia and for the developers in 2 fronts. First on the CI/CD front, so we can spin up a lightweight cluster to run all kinds of tests, this also has a perfect fit with GitOPS model.

Another developer use case is the local machine scenario. For developer is very important to have a set of lightweight solutions, so they can run on the local machines this is important for a lot of reasons like:

  • A sandbox to play and do experiments
  • Learn effectively
  • Debug and Troubleshoot
  • Simulate some kinds of bugs in order to add tests

Not all scenarios can be covered with the local environment and that does not kill the need to have a cloud environment for development. However, this is a powerful tool for the developer and speeds up things a lot. 

Running k3s Locally

k3s is super lightweight and super fast. The solutions are pretty new but have lots of potentials. There are some limitations in k3s like there is no ALPHA specs support.

Running the Server



















Echo App Spec



Get Pods







Running a service in kubernetes using k3s

















cheers,
Diego Pacheco

Tuesday, February 12, 2019

Kubernetes 101

Kubernetes has lots of concepts. It's easy to get lost in the middle of all core concept the project has. However, all these abstractions provide a great benefit which is the standard spec for different kinds of services and workloads. IF cloud providers were born with a common spec/API, we would not be talking about this subject now a day, unfortunately, this is not the reality. Today I want to share a simple presentation I made trying to explain the many concepts present in kubernetes and how they differentiate between each other like what's the difference of a Secret vs ConfigMap or how ReplicateSet is different compared with a Deployment. Also, cover what kinds of service are available and when to use ClusterIP vs Loadbalancer for instance. You will also see GitOps model, which the standard k8s way to work in production.



Kubernetes 101

Slides



Video



Cheers,
Diego Pacheco

Tuesday, February 5, 2019

Running Istio on AWS with Kops

In previous posts, I show how to run Istio in Minikube and with Docker-Compose/Consul in local env, today I will show how to run on AWS using KOPS.

This installation is Linux based(Ubuntu), I'm running all commands from my local-desktop, if you don't use Linux(shame on you) you can create a virtual-machine on AWS with ubuntu and run this commands there, also is possible to run Vagrant with Linux and them run this commands on Vagrant box as well. Istio runs smoothly in AWS with Kops. You don't need much, pretty much 3 machines(1 master node, 2 minions).  Keep in mind this is not a production-grade setup, for production, you should be running with 3 masters at least for High Availability.




Installing and Running Istio with Kops



Master and Worker nodes on AWS EC2 Console










Istio Metrics in Grafana

















Jaeger - Distributed Tracing






















Kiali - Observability

















BookInfo ServiceMesh (4 microservices) running on Istio / Kubernetes in AWS

Prometheus(Cloud-Native Observability) - Metrics, Dashboards, and Alerts 

















ServiceGraph























That's it - I hope you enjoyed.

Cheers,
Diego Pacheco

Wednesday, December 19, 2018

Why do you need Kubernetes in your next project?

The cloud is not the end, but the beginning. Starting a quick journey to the cloud brings benefits to your business. However, to get more benefits and reduce costs it is necessary to adopt a cloud-native mindset, which means going beyond, using the maximum value of cloud computing.

Kubernetes, a system designed by Google and maintained by the Cloud Native Computing Foundation, for example, is much more than a container orchestration solution. Many experts consider Kubernetes the new Linux since much evolution is to happen in this system.

Nowadays all organizations use Linux, but not all organizations use Kubernetes. Possibly we will reach the point where all companies will start using kubernetes, just as they use Linux today. You must be imagining technical reasons for using Kubernetes. They exist and there are many, however, there are also very relevant business reasons regarding the use of this system.

Keeping Innovation Flowing

It is increasingly important to innovate within companies - corporate innovation - but this innovation is very difficult and has several challenges. Within enterprise innovation, it is necessary to integrate existing software quickly and also to discard solutions and ideas quickly. Kubernetes accelerates this time by reducing operational load, which is the bottleneck in many companies.

Focus on User Experience

The user is at the center of everything we do - or should be at least. However, the user experience is not just "look-and-feel" or "how" things work, but also "if" they work. Many solutions are architected as a house of cards in which the first error causes several other features to be affected. With Kubernetes it is possible to maximize the isolation of features and reduce the impact spectrum when something goes wrong as well as reduce recovery time.

Portability

Nowadays nobody thinks about losing the phone number or WhatsApp. In the past, if you wanted to switch carriers - for better or cheaper service - you would lose the number. Nowadays there is number portability. Kubernetes is one of the solutions that enable the portability of cloud-provider - Google, Amazon, Microsoft, and others. This portability is already real and used in solutions like WAZE - Using Spinnaker.

Maintaining Business Value

From time to time it is very common in IT industries to have the need to re-write a number of ZERO applications in view of better architecture and more robust solutions. With Kubernetes this need is less, since its solution is more portable and, consequently, the erosion of the business value becomes much smaller. This process allows your business to be ported without having to be rewritten.

Maximizing Value - Large Uses Case Cover

Kubernetes is not only for backend solutions, but it is also possible to run machine learning (ML) and Big Data workloads using Spark, for example, and more. In addition, there are many other Serverless frameworks on top of Kubernetes, such as Google knative.

Strategic Freedom and Cost Reduction

With the possibility of portability, it is possible to run solutions in 1 or multiple clouds, thus taking the maximum value from each supplier, and can also migrate to other clouds when the cost becomes more interesting. This way, your business stays in a strategic position rather than being held hostage by cloud providers.

Time to Market Reduction

One of the principles of modern innovation through Lean Startup is to reduce time to market, that is, to put ideas and solutions out faster. Kubernetes helps us with this because through the system we can have shorter deploys cycles with less infrastructure overhead.

Your journey to the cloud should not stop after Lift and Shift. Kubernetes is much more than a container orchestrator. If you do not want to make another digital transformation in 5 years, it is very important that you consider Kubernetes as a very strategic solution to your business.

Cheers,
Diego Pacheco
https://diegopacheco.github.io/

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.