/images/avatar.png

Network DNS

Ping to PC A Ping to IP 1 2 3 4 ping 192.168.1.11 Reply from 192.168.1.11: bytes=32 time=4ms TTL=117 Reply from 192.168.1.11: bytes=32 time=4ms TTL=117 Ping to Name 1 2 3 ping db ping: unknown host db Config /etc/hosts Private Name In PC B 1 2 3 hostname host-2 In PC A Ping to Name 1 2 3 ping db ping: unknown host db Append to /etc/hosts 1 echo "192.168.1.11 db" >> /etc/hosts Ping to Name Again 1 2 3 4 5 ping db PING db (192.

Network Routing

Routing Diagram How to Connect Between A and C? Network There are two switches as 192.168.1.0 and 192.168.2.0. 192.168.1.0 and 192.168.2.0 are different network environments. That means A and C are also different networks. At this moment, we need a router to connect between the different networks. Gateway Gateway There’s no way to connect between A and C directly. So we need a door to connect between them. In this case, we have a router.

Network Switching

Switching Diagram How to Connect A and B? Scenario Setting PC A Check Ethernet List 1 ip link Assign IP Address to eth0 that is connected with the Switch 1 ip addr add 192.168.1.10/24 dev eth0 Setting PC B Check Ethernet List 1 ip link Assign IP Address to eth0 that is connected with the Switch 1 ip addr add 192.168.1.11/24 dev eth0 Ping Between A and B From A 1 ping 192.

Kubernetes Persistent Volumes

Persistent Volume pv-definition.yaml 1 2 3 4 5 6 7 8 9 10 11 12 13 apiVersion: v1 kind: PersistentVolume metadata: name: pv-vol1 spec: accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain capacity: storage: 1Gi awsElasticBlockStrage: volumeID: <volume-id> fsType: ext4 Access Modes Access Mode CLI Description ReadWriteOnce RWO The volume can be mounted as read-write by a single node ReadOnlyMany ROX The volume can be mounted read-only by many nodes ReadWriteMany RWX The volume can be mounted as read-write by many nodes Reclaim Policy Reclaim Policy Description Retain Manual reclamation Recycle Basic scrub(rm -rf /thevolume/*) Delete Associated storage asset such as AWS EBS, GCE PD, Azure Disk, or OpenStack Cinder volume is deleted Commands 1 kubectl create -f pv-definition.

Kubernetes Volumes

Volumes & Mounts 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 apiVersion: v1 kind: Pod metadata: name: random-number-generator spec: containers: - image: alpine name: alpine command: [ "/bin/sh", "-c" ] args: [ "shuf -i 0-100 -n 1 >> /opt/number.out;" ] volumeMounts: - mountPath: /opt name: data-volume volumes: - name: data-volume hostPath: path: /data type: Directory Volume Types NFS GlusterFS Flocker ceph SCALEIO AWS Google Cloud Azure 1 2 3 4 5 6 spec: volumes: - name: data-volume awsElasticBlockStore: volumeID: <volume-id> fsType: ext4

Kubernetes Docker Storage

Docker File System 1 2 3 4 5 /var/lib/docker ├── aufs ├── containers ├── image ├── volumes Layered Architecture First Dockerfile 1 2 3 4 5 6 7 8 9 FROM ubuntu RUN apt-get update && apt-get -y install python RUN pip install flask flask-mysql COPY . /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run 1 docker build -t Dockerfile cozyfex/my-custom-app Second Dockerfile 1 2 3 4 5 6 7 8 9 FROM ubuntu RUN apt-get update && apt-get -y install python RUN pip install flask flask-mysql COPY app2.