-
Notifications
You must be signed in to change notification settings - Fork 6
/
Notes2.txt
2505 lines (2015 loc) · 88.6 KB
/
Notes2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
D:\PraiseTheLord\HSBGInfotech\DevOps\sre\Notes.txt
################################################################################################
Cloud Engineering / Infrastructure as Code
################################################################################################
Infrastructure Coding - Terraform
################################################################################################
Services mesh Data planes & Control Planes - Envoy & Istio
Envoy
-----
https://www.xenonstack.com/insights/what-is-envoyproxy
https://www.envoyproxy.io/
Envoy Proxy
modern,
high performant,
edge proxy,
works at both
L4 and
L7 proxies
most suitable for modern Cloud-Native applications
need proxy layer at L7.
Envoy is most comparable to software load balancers
like NGINX and HAProxy,
Has many advantages than typical proxies.
Allows SSL by default
Really flexible around discovery and load balancing the workload.
Why Envoy Proxy Matters?
------------------------
NGINX, HAProxy, and Envoy are all battle-tested L4 and L7 proxies
Envoy has the following additional benefits -
It’s developed by keeping modern Microservices in mind.
It translates between HTTP-2 and HTTP-1.1.
It proxies any TCP protocol.
It proxies any raw data, web sockets, databases, etc.
It enables SSL by default.
It has in-built Service Discovery as well as Load Balancing.
It does all the configuration dynamically
hosts added dynamically,
not like writing the list to a static config file & re-reading it.
Envoy stores the mapping of requests from clients (i.e., URLs) to services
in-built load balancer reads dynamically.
How Envoy works?
----------------
Configuring Envoy is a little complex
Envoy keeps
simple things very simple
allowing complex things to be possible to implement.
Envoy Architecture
-----------------
Downstream/Upstream
Clusters
Backend-Downstream
Listeners
Frontend-Upstream
Network Filters
connect Listeners to Clusters
options like
tcp proxy
network proxy
http proxy etc.
Thread Model
Doesn't use process model
Light weight
Much better performance
Connection Pools
Envoy
L7 (application layer) proxy
communication bus designed for large modern service oriented architectures.
The project was born out of the belief that:
Network should be transparent to applications.
When network and application problems do occur
quick and easy determine source.
In practice, this goal is incredibly difficult.
Envoy attempts to solve this using:
Out of process architecture:
Envoy is a self contained process
designed to run alongside every application server.
All of the Envoys
form a transparent communication mesh
each application sends and receives messages to and from localhost
unaware of the network topology.
out of process architecture
two substantial benefits
over the traditional library approach
to service to service communication:
Envoy works with any application language.
A single Envoy deployment can form a mesh between
Java,
C++,
Go,
PHP,
Python,
etc.
Microservices can be polyglot.
Envoy transparently bridges the gap.
deploying library upgrades can be incredibly painful.
Envoy can be
deployed and
upgraded
quickly across an entire infrastructure transparently.
L3/L4 filter architecture:
At its core, Envoy is an L3/L4 network proxy.
A pluggable filter chain mechanism
allows filters to be
written to perform different TCP/UDP proxy tasks and
inserted into the main server.
Filters have already been written
to support various tasks such as
raw TCP proxy,
UDP proxy,
HTTP proxy,
TLS client certificate authentication,
Redis,
MongoDB,
Postgres,
etc.
HTTP L7 filter architecture:
HTTP
critical component of modern application
Envoy supports an additional HTTP L7 filter layer.
HTTP filters can be plugged into the HTTP connection management subsystem
that perform different tasks such as
buffering,
rate limiting,
routing/forwarding,
sniffing Amazon’s DynamoDB, etc.
First class HTTP/2 support:
Envoy supports both
HTTP/1.1 and
HTTP/2.
Envoy can operate as a transparent HTTP/1.1 to HTTP/2 proxy in both directions.
Any combination of HTTP/1.1 and HTTP/2 clients and
target servers can be bridged.
The recommended service to service configuration
uses HTTP/2 between all Envoys
to create a mesh of persistent connections that
requests and responses can be multiplexed over.
HTTP/3 support (currently in alpha):
From 1.19.0,
Envoy supports HTTP/3 upstream and downstream,
translating between any combination of HTTP/1.1, HTTP/2 and HTTP/3 in either direction.
HTTP L7 routing:
Envoy supports a routing subsystem
capable of routing and redirecting requests based on
path,
authority,
content type,
runtime values, etc.
This functionality is most useful
when using Envoy as a front/edge proxy
but is also leveraged when building a service to service mesh.
gRPC support:
gRPC
RPC framework from Google
uses HTTP/2 or above as the underlying multiplexed transport.
Envoy supports all of the HTTP/2 features
required to be used as the
routing and
load balancing substrate for
gRPC requests and responses.
The two systems are very complementary.
Service discovery and dynamic configuration:
Envoy optionally consumes
layered set of dynamic configuration APIs for centralized management.
The layers provide an Envoy with dynamic updates about:
hosts within a backend cluster,
backend clusters themselves,
HTTP routing,
listening sockets, and
cryptographic material.
For a simpler deployment,
backend host discovery can be done through DNS resolution
(or even skipped entirely),
with the further layers replaced by static config files.
Health checking:
The recommended way of building an Envoy mesh is to
treat service discovery as an eventually consistent process.
Envoy includes a health checking subsystem
which can optionally perform active health checking
of upstream service clusters.
Envoy uses
union of
service discovery and health checking
determine healthy load balancing targets.
Advanced load balancing:
Load balancing among different components in a
distributed system is a complex problem.
Envoy is also a self contained proxy
not a library,
implement advanced load balancing techniques
in a single place and
accessible to any application.
Currently Envoy includes support for
automatic retries,
circuit breaking,
global rate limiting
via an external rate limiting service,
request shadowing, and
outlier detection.
Work on request racing is WIP.
Front/edge proxy support:
There is substantial benefit in using the same software at the edge
(observability,
management,
identical service discovery and
load balancing algorithms, etc.).
Envoy well suited as
edge proxy
for most modern web application use cases.
This includes
TLS termination,
HTTP/1.1 HTTP/2 and HTTP/3 support
HTTP L7 routing.
Best in class observability:
Primary goal of Envoy
make the network transparent.
But problems occur both at
network level and
application level.
Envoy includes robust statistics support for all subsystems.
statsd (and compatible providers)
currently supported statistics sink
though plugging in a different one would not be difficult.
Statistics are also viewable via the administration port.
Envoy also supports distributed tracing via thirdparty providers.
Downstream vs Upstream
-----------------------
Downstream - anything in front of envoy
Upstream - anything in back of envoy
Downstream <--> envoy <--> upstream
image
Service Mesh/Side car
Downstream <--> envoy (http1) <--> envoy (http2)<--> upstream
Clusters
--------
image
Group of hosts/endpoints called cluster
Cluster has a loadbalancing policy
Listeners
---------
Listen on a port for downstream clients
Network filters are applied to Listeners
- TCP/HTTP filters
- Transport sockets TLS
Network Filters
---------------
Maps Listeners and Clusters
Build to be extensible
we can add our own proxy tomorrow
TCP Proxy network filters
envoy.filters.network.tcp_proxy
HTTP Proxy network filters
envoy.filters.network.http_connection_manager
MongoDB/MySQL/GRPC Network filter
Network Stack
-------------
Envoy works at the TCP level:
Layer 3/4 Network/Transport proxy.
It just read/write bits
uses IP addresses and port numbers to make a decision
about where to route the request.
Working at the TCP level is drastically fast and simple.
Envoy also works at L7 as well simultaneously
to proxy different URLs (path based routing?) to different backends
since it needs application information available only at L7.
Working at 3, 4, and 7 layers allow it to
cover up all limitations and
have good performance.
2 layers of Envoy
Edge Envoy:
The standalone instance is a single point of ingress to the cluster.
All requests from outside first come here & it sends them to internal Envoys.
Sidecar Envoy:
This instance (replica) of an app has a sidecar Envoy,
runs in parallel with the app.
These Envoys monitors everything about the application.
All these proxies are inside a mesh
has internal routing
Each, side Envoys does health monitoring
identify services which go down.
All Envoys also gather stats from the application
sends it to a telemetry component (Mixer in Istio).
All of the Envoys in Mesh configured differently by modifying Envoy configuration file,
according to a particular use case.
Advantages of Envoy Proxy
-------------------------
Performance (much better than nginx).
Scales horizontally.
Proxies added/removed dynamically.
Filter the request based on many parameters.
For
Edge Envoys,
any number of servers
(each of which points to its own array of hosts)
any number of routes added for different proxy URLs
gives flexibility in Infra management.
For sidecars
Envoy have only one route
it will proxy to the app running on localhost.
Configuring a sidecar proxy is pretty straight-forward
configuration updated dynamically.
Envoy allows DNS
easier to remember
new service instances added to the DNS dynamically.
Envoy manages, observes and works best at L7.
Envoy aligns well with Microservices world.
Provides features such as
resilience,
observability, and
load balancing.
Envoy embraces distributed architectures
Used in production at
Lyft,
Apple,
Google.
Dropbox moved from nginx to Envoy
Steps
1. Install envoy
https://www.envoyproxy.io/docs/envoy/latest/start/install
To run envoy as a docker container
https://www.envoyproxy.io/docs/envoy/latest/start/docker
2.
http.yaml
docker run -d -p 1111:80 --name aspnetcore1111 mcr.microsoft.com/dotnet/samples:aspnetapp
docker run -d -p 2222:80 --name aspnetcore2222 mcr.microsoft.com/dotnet/samples:aspnetapp
docker run -d -p 3333:80 --name aspnetcore3333 mcr.microsoft.com/dotnet/samples:aspnetapp
docker run -d -p 4444:80 --name aspnetcore4444 mcr.microsoft.com/dotnet/samples:aspnetapp
Install
https://computingforgeeks.com/how-to-install-envoy-proxy-on-centos/
sudo yum install -y yum-utils
yum update -y
sudo rpm --import 'https://rpm.dl.getenvoy.io/public/gpg.CF716AF503183491.key'
curl -sL 'https://rpm.dl.getenvoy.io/public/config.rpm.txt?distro=el&codename=7' > /tmp/tetrate-getenvoy-rpm-stable.repo
sudo yum-config-manager --add-repo '/tmp/tetrate-getenvoy-rpm-stable.repo'
sudo yum install -y getenvoy-envoy
envoy --version
https://github.com/hnasr/javascript_playground/blob/master/envoy/allbackend.yaml
vi http.yaml - copy the content from above file.
envoy --config-path http.yaml
N.B: It doesn't accept .yml extension. It should be .yaml only.
http://<public ip address>:8080/
Service Mesh
------------
Handle the below infrastructure challenges
Service Discovery
Load Balancing
Fault Tolerance
Distributed Tracing
Telemetrics
Security
Mutual TLS between Services
Network policies/Whitelisting
Certificate expiry
Granularity
Bounded Contexts
Data Modelling
Independently releasable
Service contracts
Smart services, dumb-pipes
Istio can support
-----------------
Service Discovery
Load Balancing
(extensive set of algorithems)
Multi protocol support
(HTTP2/gRPC)
Fault Tolerance
(Circuirt breaking, Rate limiting, Auto-Retries)
Scaling
Telemetrics
(including wire-level like MongoDB, DynamoDB)
Distributed Tracing
Security (mTLS, policies)
Istio was initially designed with multiple services
install each separately.
From version 1.5 they are all grouped toghether
Control Plane: Istiod
Worker nodes: Envoy proxy
Istiod
Service discovery
Certficate
Has a CA
Configuration management
Istio handson
-------------
minikube start --cpu 6 --memory 8192
mkdir istio
cd istio
curl installable (refer documentation)
https://istio.io/latest/docs/setup/install/istioctl/
https://istio.io/latest/docs/setup/getting-started/#download
curl -fsSL https://github.com/istio/istio/releases/download/1.14.3/istio-1.14.3-linux-amd64.tar.gz -o istio.tar.gz
tar xvfz <file>
set path to istio/<istio-version>/bin/
export PATH=$PATH:
istioctl
kubectl get ns
kubectl get pod
istioctl install
core installed
istiod installed
ingress gateways installed
installation complete
kubectl get ns
Pick the sample app from https://istio.io/latest/docs/setup/getting-started/
kubectl apply -f <file.yaml>
cd /home/centos/istio/istio-1.14.3
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.14/samples/bookinfo/platform/kube/bookinfo.yaml
launch an application
istio core and ms are running
in k8s cluster
envoy proxies not injected.
kubectl get ns default --show-labels
kubectl label namespace default istio-injection=enabled
kubectl get ns default --show-labels
recreate application
kubectl delete -f manifest
kubectl apply -f manifest
kubectl get pod
2/2 running
kubectl describe pod <any pod>
init containers
container id
Istio
configuration
service discovery
certificate management
gather telemetry data
Update all ClusterIP to NodePort
inside sample/addons/ folder
Open the port on aws also
kubectl apply -f samples/addons/
kubectl get pod -n istio-system
kubectl get svc -n istio-system
#kubectl port-forward svc/kiali -n istio-system 20001
ip:20001/kiali/console/namespaces/default/services/frontend?
mandatory to have app: <name> label in deployment for kiali to work.
gitHub: https://github.com/istio/istio/tree/master/samples/addons
References:
https://github.com/marcel-dempers/docker-development-youtube-series/tree/master/kubernetes/servicemesh/istio
################################################################################################
https://www.tutorialspoint.com/consul/consul_introduction.htm
Consul
Hashicorp tool
discovering and configuring a variety of different services
Built on Golang.
Some of the significant features that Consul provides are as follows.
Service Discovery −
Using either DNS or HTTP
applications can easily find the services they depend upon.
Health Check Status −
Health checks.
Used by the service discovery components
to route traffic away from unhealthy hosts.
Key/Value Store −
Consul's hierarchical key/value store - use for
dynamic configuration,
feature flagging,
coordination,
leader election, etc.
Multi Datacenter Deployment −
Consul supports multiple datacenters.
Used for building additional layers of abstraction to grow to multiple regions.
Web UI −
easy to use
manage all of the features in consul.
Service Discovery
Most important feature of Consul.
Defined as the detection of
different services and
network protocols
using which a service is found.
Comparison with ETCD and Zookeeper
https://www.tutorialspoint.com/consul/consul_introduction.htm
--------------------------------------------------------------------------------
Reference: https://www.youtube.com/watch?v=YqDZdPg3_tU
https://learn.hashicorp.com/tutorials/consul/get-started-install
Install consul based on documentation
Install consul agent
start server
consul agent -dev -client 0.0.0.0 -bind <private ip>
yum install net-tools
netstat -ntlp
mkdir consul
cd consul
vi default.hcl
client_addr = "0.0.0.0"
bind_addr = "<private ip>"
consul agent -server -config-dir consul -data-dir /tmp/consultserver -bootstrap-expect=1 -ui=1
from browser
public-ip:8500
join client
consul agent -join <private ip of server> -bind <private ip of client> -data-dir /tmp/consuldata
stop client
mkdir consul_config_dir
cd consul_config_dir
vi consul-service.json
{
"service":{
"name":"myservice",
"port":80
}
}
consul agent -join <private ip of server> -bind <private ip of client> -data-dir /tmp/consuldata -config-dir ./consul_config_dir/
on server
dig @localhost -p 8600 myservice.service.consul
consul services
----------------------------------------------------------------------------------------------
Network configurations and Service Discovery - Consul
kubectl get nodes
kubectl get ns
kubectl create ns consul
install consul
https://github.com/b1tsized/vault-tutorial/tree/main/01-getting-started
consul agent -bootstrap-expect=1 -data-dir=consul-data
-ui -bind=<ip address of where you are running it>
should run on
localhost:8500/ui
create two web ms with
web and consul discovery dependency
https://github.com/b1tsized/vault-tutorial/tree/main/01-getting-started
Modify node while copying
https://github.com/b1tsized/vault-tutorial/blob/main/01-getting-started/sys_file_templates/consul.service
Content of
vault-tutorial/01-getting-started/sys_file_templates/ui.json should be
vi /etc/consul.d/ui.json
{
"bind_addr": "0.0.0.0",
"advertise_addr": "10.0.2.15",
"addresses": {
"http": "0.0.0.0"
}
}
################################################################################################
Continuous Integration - Jenkins
################################################################################################
Securing credentials - HashiCorp Vault & SSL & Certificates
Hashicorp Vault
secures, stores, and tightly controls access to confidential information like
tokens,
username/passwords,
certificates,
keys
API keys,
ssh keys
other secrets
in modern computing.
manage secrets in cloud agnostic way
API-driven
allows to safely store and manage
sensitive data in hybrid cloud env.
Generate dynamic short lived credentials
or encrypt application data on the fly.
where secrets used to be?
in file on dev. box.
in db
in repo like github
etc.
smart people used to encrypt it
but where do you store the keys for encryption.
Why Hashicorp vault
Centrally
store
access
distribute
secrets
Secure critical application data
Encrypt Application data
with ease
Identity based access
Authenticate to and
access different
cloud
systems
endpoints
using trusted identities
Usecase 1
---------
Secrets management
kv secrets engine
client
calls api (https://kv/secrets/foo)
provide token
to vault
vault has policy
which confirms if user has access to this key
if user has access
from keyvalue (kv)
decrypted password/key is returned.
Usecase 2
---------
Encryption as a service
transit secret engine
Webserver talks to Vault
gives the token
Vault checks the policy to confirm the access
vault returns the encrypted data back to the server
This can then be stored in db or s3 bucket
when an application is trying to use it,
it would contact the vault to confirm if
the data is correct.
Usecase 3
---------
Vault with a cloud like aws
client talks to vault passes the token
vault checks the policy
if the user is allowed,
vault creates credentials in aws
aws returns keys/ userid/pwd to vault
vault returns it to the
user/application.
https://github.com/b1tsized/vault-tutorial/tree/main/01-getting-started
https://servian.dev/get-started-with-hashicorp-vault-cc132dce627d
https://www.digitalocean.com/community/tutorials/how-to-securely-manage-secrets-with-hashicorp-vault-on-ubuntu-20-04
https://www.baeldung.com/vault
-----------------------------------------------------------------------------------------------------------
https://www.youtube.com/watch?v=Oyvnicmxmbo
https://hub.docker.com/_/vault
COMMANDS
Get docker image: docker pull vault
Running image:
docker run -d --rm --name vault-server --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' -p 8200:8200 vault
Get IP Address: docker inspect vault-server | grep IPAddress
Set environment variable: export VAULT_ADDR='http://172.17.0.2:8200'
Install the client by following https://www.vaultproject.io/downloads
Basic vault cli commands
vault
Authenticate to server from CLI: vault login
Write secret (CLI): vault kv put secret/mypwd mypassword=vilas1234
Read secret (CLI): vault kv get secret/mypwd
INFO
vault info: https://vaultproject.io
vault CLI download: https://vaultproject.io/downloads
docker image at: https://hub.docker.com/_/vault
hvac info at: https://hvac.readthedocs.io/en/stable...
==========================
Python script (run pip install hvac first!):
import hvac
client = hvac.Client(url='http://172.17.0.2:8200',token="tdc-token")
print(client.is_authenticated())
read_response = client.secrets.kv.read_secret_version(path='tdc')
print(read_response['data']['data']['tdcpassword'])
-----------------------------------------------------------------------------------------------------------
################################################################################################
Observability and telemetry
Observability, telemetry, and monitoring
https://cloud.ibm.com/docs/java?topic=cloud-native-observability-cn
Culture change around monitoring
in cloud native.
Applications should be
highly available and
resilient to failure
the methods that are used to achieve those goals are different.
monitoring
not to avoid failure
but to manage failure.
In on-premises environments
infrastructure and middleware are provisioned
based on planned capacity and
high availability patterns,
for example,
active-active or active-passive.
Unexpected failures can be complex in this environment
requiring significant effort for problem determination and recovery.
As an example, consider the
tuning of
heap size,
timeouts, and
garbage collection policies for Java applications.
A cloud-native application is composed of
independent microservices and
required backing services.
Even though a cloud-native application as a whole must
remain available and
continue to function,
individual service instances will
start or stop as to adjust for capacity requirements or to recover from failure.
Observability
-------------
Observability
data exposure and easy access
to information
required to find issues when the communications fail,
internal events do not occur as expected or
events occur when they shouldn’t.
Monitoring this fluid system requires each participant to be observable.
Each entity must produce appropriate data to support automated problem detection and alerting, manual debugging when necessary, and analysis of system health (historical trends and analytics).
What kinds of data should a service produce to be observable?
Health checks
(often custom HTTP endpoints)
help orchestrators, like Kubernetes or Cloud Foundry
perform automated actions to maintain overall system health.
Metrics
are a numeric representation of data
collected at intervals into a time series.
Numerical time series data
is easy to store and query
helps when looking for historical trends.
Over a longer period
numerical data can be compressed into less granular aggregates,
daily or
weekly.
Log entries
represent discrete events.
Log entries are essential for debugging
often include stack traces and other contextual information
can help identify the root cause of observed failures.
Distributed, request, or end-to-end tracing
captures the end-to-end flow of a request through the system.
Tracing essentially captures both relationships between services
(the services the request touched), and the
structure of work through the system
(synchronous or asynchronous processing, child-of or follows-from relationships).
Telemetry
---------
Cloud-native applications
rely on the environment for telemetry
automatic collection and transmission of data
to centralized locations
for subsequent analysis.
one of the twelve factors
"treat logs as event streams"
extends to all data a microservice produces to ensure it can be observed.
Kubernetes has some built-in telemetry capabilities
like Heapster
but it's more likely telemetry is provided by other systems that integrate with the Kubernetes control plane.
As an example,
two of Istio's components,
Mixer and Envoy, act together to transparently collect telemetry from deployed applications.
Failures are no longer
rare,
disruptive occurrences.
################################################################################################
Infrastructure Monitoring Tool 1 - Datadog
Infrastructure Monitoring
Introduced for infra monitoring
Can now
APM: performance monitor
LOG: log monitoring
SAAS
Software as a service
No need to worry about
Out of box Datadog is
server service
config
backup
restore
maintanance
scalability
availability
security
How to get started?
https://www.datadoghq.com/
Pricing
https://www.datadoghq.com/pricing
Docs
https://docs.datadoghq.com/
Setup free tier Datadog
Integration - Agents
Agent
windows
linux
get centos instance
according to the direction in datadog free account
install datadog
ps -eaf | grep data
executables /opt/datadog-agent/bin/
cat /etc/datadog-agent/datadog.yaml
wait for sometime.
check You have "1"
systemctl stop datadog-agent
systemctl start datadog-agent
we should be able to see the ui updated
Flow
create an account
install agent
Crate a dashboard
Create a monitoring
Install a Integration
Architecture of Agent
---------------------
Agent has three main parts
collector
DogStatsD
Forwarder
Collector:
Runs check on current machine
for configured integrations