foo
Olaf Bohlen
2023-02-21 e54206c918190341bb361187261620151e98ef0b
commit | author | age
b4d6ba 1
OB 2 * ISO/OSI Reference Model
3
e54206 4 7 Application Layer    |  firefox web browser    ^
OB 5 6 Presentation Layer   |  HTML                   |
6 5 Session Layer        |  HTTP                   |
7 4 Transport Layer      |  TCP 80                 |
b4d6ba 8 3 Network Layer        |  IP 10.88.0.74          | 
OB 9 2 Datalink Layer       |  ETH 0:14:4f:c9:85:70   |
10 1 Physical Layer       v  Copper/Fibre           |
11
e54206 12 People Do Not Throw Sausage Pizza Away
b4d6ba 13
e54206 14 #+begin_src ditaa :file packet-content.png :cmdline -E -s 0.8
b4d6ba 15
e54206 16 +----------+---
OB 17 |Eth Frame |Payload
18 | Header   |+-----------+----
19 | SRC MAC  || IP Packet |Payload
20 | DST MAC  || SRC IP    |+-----------+-------
21            || DST IP    || TCP Packet| Payload...
22                          | SRC Port
23                          | DST Port
24 #+end_src
25
26 * layers
27
28 #+begin_src ditaa :file containerimage-layers.png :cmdline -E -s 0.8
29      ubi8                      ubi8+apache                  ubi8+apache+php
30                                                           +---------------+
31                                                           | Instruction 2 |
32                              +---------------+            +---------------+
33                              | Instruction 1 |          | Instruction 1 |
34    +-------------+  Instr1   +---------------+  Instr 2      +---------------+
35    | Base Layer  | ------->  | Base Layer    | ---------> | Base Layer    |
36    +-------------+           +---------------+            +---------------+
37                                  |
38                                  |Alt Inst2
39                                  v ubi8+apache+ruby
40                              +---------------+
41                              | Alt Inst 2    |
42                              +---------------+
43                  | Instruction 1 |
44                  +---------------+
45                  | Base Layer    |
46                               +---------------+
47 #+end_src
b4d6ba 48 * Container components
OB 49
50 #+begin_src ditaa :file processlist-containers.png :cmdline -E -s 0.8
51
52 |
53 +- 1 systemd
54 |
55 +- 42 bash
56 |
57 +- 23 vim
58 |
59 |---------------+  namespace, chroot, SELinux, cgroups, Seccomp
60 +- 53 mysql5.5  |
61 |---------------+
62 |---------------+  namespace, chroot, SELinux, cgroups, Seccomp
6aed06 63 +- 54 mysql5.8  |
b4d6ba 64 |---------------+
e54206 65 +------------+     namespace, chroot, SELinux, cgroups, Seccomp
b4d6ba 66 +- 74 apache |
OB 67 |------------+
68 |
69 +- 122 bash
70
71
72 #+end_src
73
e54206 74 /container1/usr/sbin/mysqld
OB 75 /container2/usr/sbin/mysqld
76
77 chroot /container1 
b4d6ba 78 * UNIX Memory Seperation
OB 79
80 #+begin_src ditaa :file userland.png :cmdline -E -s 0.8 
81
82             +---------------------------------+       Process
83 Userland    | Proc1, Proc2, ...               |          |
84             |                                 |          v
85             |                                 |       System Call
86             +-----SystemCalls-----------------+          |
87             +---------------------------------+          v
88 Kernel      | Device Driver, Scheduler,       |       Kernel Driver
89 Space       | Memory Management, ...          |
90             +---------------------------------+
91 #+end_src 
92
93 * docker vs podman components
94
95                                  (root)
e54206 96 docker-cli ---REST (HTTP)---> docker-daemon --> moby --> container
b4d6ba 97                                [webserver]
OB 98
99  (root)
100 podman   -> CRI-O -> runC -> container
e54206 101             (Container Runtime Interface - OCI (Open Container Initiative))
b4d6ba 102
OB 103 alias docker=podman
104
105
106
107 * oc command line tool parameter
108
109 oc is a modified kubectl, but full compatible 
110
111 | Command | SubCommand  | Resource Type              | [<Resource Name>] |
112 |---------+-------------+----------------------------+-------------------|
113 | oc      | get         | pod                        | [name]            |
114 | kubectl | describe    | svc / service              |                   |
115 |         | edit        | all                        |                   |
116 |         | get -o yaml | replicationcontroller / rc |                   |
117 |         | get -o json | deploymentconfig / dc      |                   |
118 |         | delete      | buildconfig / bc           |                   |
119 |         | create      | imagestream / is           |                   |
120 |         |             | NetworkPolicy              |                   |
e54206 121 |         |             | project                    |                   |
OB 122 |         |             | route                      |                   |
b4d6ba 123
OB 124 # oc new-project
125 # oc new-app
126 # oc rsh <podname>
127
128
129 * UNIX Kernel Memory 
130
131 #+begin_src ditaa :file system_memory.png :cmdline -E -s 0.8 
132
133 +--------------------------------+
134 |0Heap                           |
135 |                                |
136 |                                |
137 |                                |
138 |                                |
139 |                                |
140 +--------------------------------+
141 Gap
142 +--------------------------------+
143 |                                |
144 |                                |
145 |                                |
146 |Stack                       2^64|
147 +--------------------------------+
148
149 #+end_src