Author Archives: bullgare
What is a Service Mesh? Introductory article from NginX
The original is here — https://www.nginx.com/blog/what-is-a-service-mesh/ Another small introductory article on Istio you can find here. A service mesh is a configurable infrastructure layer for a microservices application. It makes communication between service instances flexible, reliable, and fast. The mesh provides service discovery, load balancing, encryption, authentication and authorization, support for the circuit breaker pattern, and other …
Istio — platform for managing and connecting your microservices. Service mesh
https://istio.io/docs/concepts/what-is-istio/overview.html It’s flexible and modular service mesh made by Google, IBM and Lyft. It is a platform for managing your kubernetes system. It’s responsible traffic management, observability, policy enforcement, service identity and security. It provides features like service discovery, load balancing, A/B experiments, canary deployments, circuit breaking and health checks.
Kubectl helpful commands
k8s cheatsheet. Get all pods by label
1 |
$ kubectl --kubeconfig <config file> get po -lapp=<pod name without hash> -Lversion,cfg,infra-cfg |
Exec into the pod
1 |
$ kubectl --kubeconfig <config file> exec -it <pod name> sh |
Port forwarding
1 |
$ kubectl --kubeconfig <config file> port-forward <pod name> <local port>:<remote port> |
Getting logs
1 |
$ kubectl --kubeconfig <config file> logs <pod name> <pod name without hash> |
Get replica limits from configs:
1 2 3 4 5 |
$ kubectl --kubeconfig <config file> get hpa <pod name without hash> # more details $ kubectl --kubeconfig <config file> get deployment <pod name without hash> --output=yaml $ kubectl --kubeconfig <config file> describe deployments <pod name without hash> $ kubectl --kubeconfig <config file> describe pod <pod name without hash> # CPU and memory limits/requests (quota) |
Remove pod from load balancing to debug startup errors:
1 2 3 |
$ kubectl --kubeconfig <config file> label pod <pod_name> <labels to remove> # and remove (kill the pod) afterwards $ kubectl --kubeconfig <config file> delete pod <pod_name> |
Scale (up/down) pods:
1 2 3 4 |
$ kubectl --context=xx-live-default get pods -l app=boblin -o wide $ kubectl --context=xx-live-default scale --current-replicas=12 --replicas=3 deployment/boblin $ kubectl --context=xx-live-default delete pods boblin-3353777365-qjdpd $ kubectl --kubeconfig <config file> scale deployment <pod name without hash> --current-replicas=0 --replicas=2 |
1 2 3 4 |
$ kubectl --kubeconfig <config file> get po -lapp=<label> -Lversion,cfg $ watch -n 1 kubectl --kubeconfig <config file> get po -lapp=<label> -Lversion,cfg $ kubectl --kubeconfig <config file> exec <exact pod hash> sh $ kubectl --kubeconfig <config file> get hpa <label> |
More commands here: https://kubernetes.io/docs/reference/kubectl/overview/ https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Using npm registry from corporate network
In a company we have some kind of proxy that does not allow to install npm packages via npm or yarn. You can get rid of this problem using this addition to yarn add:
1 |
yarn add react-redux-form --registry="https://registry.npmjs.org" |
Or you can also replace global property with
1 |
npm config set registry https://registry.npmjs.org |
https://stackoverflow.com/a/22390936/801426
Performance comparison table for javascript frameworks
http://www.stefankrause.net/js-frameworks-benchmark7/table.html Example results are as follows:
Execution context and activation object in details
There are many interesting articles both in Russian and English. You can start with this one — http://dmitrysoshnikov.com/ecmascript/javascript-the-core/#execution-context-stack. In Russian — http://dmitrysoshnikov.com/ecmascript/ru-javascript-the-core/#stek-kontekstov-ispolneniya The short summary Javascript runtime is synchronous and processes Execution Context Stack. It’s bottom Execution Context is global object as everything starts with this. When some function or eval is being called, runtime …
Multiple react applications on one page. Theory
Yes, it can be done. That’s how you render several react apps on one page:
Implementations of sort algorithms in javascript
Implementations of bubble, selection, merge, and quick sorts. https://gist.github.com/bullgare/0da3207aa55a200ce36837ff904962a2
Cool talk on js event loop and call stack
It’s junior-middle level, but animations are great. https://youtu.be/8aGhZQkoFbQ Here’s an article about almost the same but in more details about difference between tasks’ queue (timeouts) and microtasks’ queue (promises and DOM modifications). The main idea is that there are several queues that have different priorities. And microtasks are more important than tasks. https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
Front-end interview questions with answers
Yeap, yet another one. https://github.com/yangshun/front-end-interview-handbook That’s what it has now: Table of Contents