-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathsession-56.txt
More file actions
75 lines (51 loc) · 1.88 KB
/
Copy pathsession-56.txt
File metadata and controls
75 lines (51 loc) · 1.88 KB
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
everything is resource inside k8s
K8s -> PaaS
namespace -> an isolated space inside k8 cluster where can create our project related resources. we can completely control them. it is like our project inside k8s.
1. namespace level -> VPC level
2. cluster level -> global level
kind: <type-of-resource>
apiVersion:
there are resources categorised based on apiVersion..
pod
===
pod is smallest deployable unit in kubernetes. a pod can have multiple containers in it. containers inside pod share same network and storage
docker run -d -p 80:80 --name frontend nginx:1.24
kubectl describe pod pod-name -n namespace
assign to node
node pulls the image
create container
start container
kubectl exec -it multi-container -c nginx -- bash
labels
======
lables adds metadata to the resource, labels are selectors inside kubernetes..
CrashLoopBackOff -> when container is not able to start
ImagePullBackOff/ErrorImagePull -> when your node is not able to pull the image.. image address may be wrong or authentication problems
annotations:
======
annotations are again like labels adds metadata, but annotations are used to select external resources..
labels have limitations in key value length and size. special charecters are not allowed inside labels
resources
=======
you need to always restrict the resources to the pod..if you get more requests we can autoscaling
1cpu = 1000m
env
====
env variables useful for pod
siva -> saiavaaa
service
=======
pod1 -> pod2
if we want pod to pod communication, ip address of pods are not useful since they are ephemeral. we can use k8s service to acheive
1. pod to pod communication through DNS, service name works as DNS here
2. load balancing
cart -> catalogue
pod1 -> service -> pod2, pod3, pod4
1. ClusterIP
2. NodePort
2. NodePort
3. LoadBalancer
service ip: 10.100.10.134
endpoints(pods): 192.168.5.23:80
svc-test -> service -> labels
url/repo-name/image-name:version