Orchestrating Containers
Kubernetes - Learning Continues
Eueung Mulyana
http://eueung.github.io/docker-stuff/learning-k8s
CodeLabs | Attribution-ShareAlike CC BY-SA
1 / 37
Outline
Base Setup & OS Con g
k8s Addons - DNS & Dashboard
Remote Master & k8s Visualizer
Test It All
2 / 37
Base Setup & OS Config
3 / 37
4 / 37
node1 RPI 3
192.168.1.102
node2 RPI 2
192.168.1.101
node3 RPI 2
192.168.1.100
5 / 37
HypriotOS
0.8.0
$flash-d/dev/mmcblk0hypriotos-rpi-v0.8.0.img
$flash-d/dev/mmcblk0hypriotos-rpi-v0.8.0.img
$ssh-keygen-f"/home/em/.ssh/known_hosts"-Rblack-pearl.loc
$sshpirate@black-pearl.local
#pirate/hypriot
$sudonano/etc/network/interfaces.d/eth0
$sudonano/etc/hosts
$sudonano/etc/hostname
#---
$sudonano/boot/device-init.yaml
#hostnameforyourHypriotOSdevice
hostname:node2
docker:
images:
-"/var/local/rpi-consul_v0.6.4.tar.gz"
-"/var/local/rpi-swarm_v1.2.2.tar.gz"
clusterlab:
service:
run_on_boot:"false"
#optionalwirelessnetworksettings
wifi:
interfaces:
# wlan0:
# ssid:"MyNetwork"
# password:"secret_password"
6 / 37
HypriotOS
0.8.0
$sudosu
$mount-oremount,rw/sys/fs/cgroup
$mkdir/sys/fs/cgroup/cpuset
$nano/boot/cmdline.txt
#edit:cgroup_enable=cpuset
#---
$nano/etc/resolv.conf
searchdefault.svc.cluster.localsvc.cluster.localcluster.loc
nameserver10.0.0.10
nameserver192.168.1.1
#---
#optionaltools
$apt-getinstalldnsutilszip
$shutdown-rnow
#---
$ssh-keygen-R192.168.1.101&&ssh-keygen-Rnode2.local
$ssh-copy-id-oStrictHostKeyChecking=no-oCheckHostIP=nopira
$sftppirate@node2.local
#putimages...
#putkube-systemd...
7 / 37
kubernetes-on-arm v0.7.0
$dpkg-ikube-systemd.deb
$kube-configinstall
#rpiorrpi-2,hypriotos
$gzip-dcimages.tar.gz|dockerload
$kube-configinfo
$kube-configenable-master
$kube-configenable-worker192.168.1.102
k8s Addons
DNS & Dashboard
8 / 37
$sudokube-configenable-addondashboard
$sudokube-configenable-addondns
namespace"kube-system"created
Warning:Unitfileofnetworking.servicechangedondisk,'systemctldaemon-reload'reco
replicationcontroller"kube-dns-v8"created
service"kube-dns"created
Startedaddon:dns
$kubectlcluster-info
Kubernetesmasterisrunningathttp://localhost:8080
KubeDNSisrunningathttp://localhost:8080/api/v1/proxy/namespaces/kube-system/services
Dashboardisrunningathttp://localhost:8080/api/v1/proxy/namespaces/kube-system/servic
$kubectl--namespace=kube-systemgetpods,rc,svc
NAME READY STATUS RESTARTS AGE
kube-dns-v8-uv6r5 4/4 Running 0 1h
kubernetes-dashboard-h5g84 1/1 Running 0 1h
NAME DESIRED CURRENT AGE
kube-dns-v8 1 1 22h
kubernetes-dashboard 1 1 22h
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns 10.0.0.10 <none> 53/UDP,53/TCP 22h
kubernetes-dashboard 10.0.0.249 <none> 80/TCP 22h
9 / 37
Master
#ksp-restart.sh
#---
#!/bin/bash
kubectldeletepo$(kubectlgetpo--namespace=kube-system|grepkube-dns|cut-d''
kubectldeletepo$(kubectlgetpo--namespace=kube-system|grepdashboard|cut-d''
10 / 37
Restart Pods
$kubectl--namespace=kube-systemgetpo
NAME READY STATUS RESTARTS AGE
kube-dns-v8-8dk0a 4/4 Running 0 11s
kubernetes-dashboard-ew4ec 1/1 Running 0 21s
$kubectllogs--namespace=kube-systemkube-dns-v8-8dk0a-ckube2sky
I053123:29:01.131613 1kube2sky.go:462Etcdserverfound:http://127.0.0.1:4001
I053123:29:02.225877 1kube2sky.go:529Usinghttps://10.0.0.1:443forkubernetes
I053123:29:02.226027 1kube2sky.go:530UsingkubernetesAPI<nil>
I053123:29:02.231187 1kube2sky.go:598Waitingforservice:default/kubernetes
I053123:29:03.431233 1kube2sky.go:660SuccessfullyaddedDNSrecordforKubernet
$kubectl--namespace=kube-systemexec-tikube-dns-v8-8dk0a--nslookupkubernetes.defa
...
$kubectl--namespace=kube-systemexec-tikube-dns-v8-8dk0a--cat/etc/hosts
$kubectl--namespace=kube-systemexec-tikube-dns-v8-8dk0a--cat/etc/resolv.conf
11 / 37
Check
DNS Service
#luxas/addons/sleep.yaml
apiVersion:v1
kind:Pod
metadata:
name:alpine-sleep
namespace:default
spec:
containers:
-image:luxas/alpine
command:
-sleep
-"3600"
imagePullPolicy:IfNotPresent
name:alpine-sleep
restartPolicy:Always
---
apiVersion:v1
kind:Pod
metadata:
name:raspbian-sleep
namespace:default
spec:
containers:
-image:resin/rpi-raspbian:jessie
command:
-sleep
-"3600"
imagePullPolicy:IfNotPresent
name:raspbian-sleep
restartPolicy:Always
12 / 37
Test
DNS Service
$kubectlcreate-fsleep.yaml
$kubectlexec-italpine-sleep--nslookupkubernetes.default10.0.0.10
$kubectlexec-italpine-sleep--nslookupkubernetes10.0.0.10
$kubectlexec-italpine-sleep--nslookupkube-dns.kube-system.svc.cluster.local10.0
$kubectlexec-italpine-sleep--nslookupkubernetes-dashboard.kube-system.svc.cluster
Server: 10.0.0.10
Address1:10.0.0.10
Name: kubernetes-dashboard.kube-system.svc.cluster.local
Address1:10.0.0.249
13 / 37
Test
DNS Service
#fromWorker/Minion
pirate@node2in~
$curl-khttps://kubernetes.default.svc.cluster.local
$curl-khttps://kubernetes
{
"paths":[
"/api",
"/api/v1",
"/apis",
"/apis/autoscaling",
"/apis/autoscaling/v1",
"/apis/batch",
"/apis/batch/v1",
"/apis/extensions",
"/apis/extensions/v1beta1",
"/healthz",
"/healthz/ping",
"/logs/",
"/metrics",
"/resetMetrics",
"/swagger-ui/",
"/swaggerapi/",
"/ui/",
"/version"
]
}
14 / 37
Test
DNS Service
Dashboard
 
15 / 37
Dashboard
 
16 / 37
Dashboard
 
17 / 37
Dashboard
 
18 / 37
Dashboard
 
19 / 37
Remote Master & k8s Visualizer
20 / 37
$wgethttps://storage.googleapis.com/kubernetes-release/release/v1.2.0/bin/linux/amd64/kubectl
$chmod+xkubectl&&sudomvkubectl/usr/local/bin/
$kubectlconfigset-clusterlk8--server=http://192.168.1.102:8080
$kubectlconfigset-contextlk8--cluster=lk8
$kubectlconfiguse-contextlk8
$kubectlgetnodes
NAME STATUS AGE
192.168.1.100 Ready 3d
192.168.1.101 Ready 3d
192.168.1.102 Ready 3d
21 / 37
Remote
Master
$gitclonehttps://github.com/saturnism/gcp-live-k8s-visualizer.gitk8s-visualizer
$cdk8s-visualizer
$kubectlproxy--www=.
Startingtoserveon127.0.0.1:8001
22 / 37
k8s
Visualizer
k8s Visualizer
 
23 / 37
Test It All
24 / 37
$kubectlrunhello-kube--image=hypriot/rpi-nano-httpd --port=80-lvisualize=true,run
deployment"hello-kube"created
$kubectlexposedeploymenthello-kube--type="LoadBalancer"--external-ip="192.168.1.10
service"hello-kube"exposed
#anynodeeth0address:102,101,100
$kubectlgetsvc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-kube 10.0.0.157 ,192.168.1.102 80/TCP 37s
kubernetes 10.0.0.1 <none> 443/TCP 3d
$kubectlgetpo-owide
NAME READY STATUS RESTARTS AGE NODE
alpine-sleep 1/1 Running 0 1h 192.168.1.102
hello-kube-658934829-o6ka3 1/1 Running 0 2m 192.168.1.101
k8s-master-192.168.1.102 4/4 Running 3 2h 192.168.1.102
raspbian-sleep 1/1 Running 0 1h 192.168.1.102
25 / 37
Test #1
#fromnode3
$curl192.168.1.102
$curl10.0.0.157
$curlhello-kube
<html>
<head><title>PiarmedwithDockerbyHypriot</title>
<bodystyle="width:100%;background-color:black;">
<divid="main"style="margin:100pxauto0auto;width:800px;">
<imgsrc="pi_armed_with_docker.jpg"alt="piarmedwithdocker"style="width:800px
</div>
</body>
</html>
26 / 37
Test #1
Reachability
hello-kube Visualized
 
27 / 37
Test #2 via Dashboard
 
28 / 37
Test #2 via Dashboard
 
29 / 37
Test #2 - Take 2
 
30 / 37
Test #2 - Take 2
 
31 / 37
Test #2 - Visualizer
 
32 / 37
$kubectlgetpo-owide
NAME READY STATUS RESTARTS AGE NODE
alpine-sleep 1/1 Running 2 2h 192.168.1.102
k8s-master-192.168.1.102 4/4 Running 3 4h 192.168.1.102
my-nginx-afadx 1/1 Running 0 19m 192.168.1.100
my-nginx-e5coa 1/1 Running 0 19m 192.168.1.101
my-nginx2-68r7o 1/1 Running 0 6m 192.168.1.101
my-nginx2-pviak 1/1 Running 0 6m 192.168.1.100
raspbian-sleep 1/1 Running 2 2h 192.168.1.102
$kubectlgetsvc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.0.0.1 <none> 443/TCP 3d
my-nginx2 10.0.0.138 8300/TCP 6m
$curlmy-nginx2:8300
<p>WELCOMETONGINX</p>
HypriotOS/armv7:pirate@node1in~
33 / 37
Test #2
Reachability
34 / 37
Refs
35 / 37
Refs
1. Docker Pirates ARMed with explosive stu
2. kubernetes-on-arm - by @luxas
3. k8s-visualizer @brendandburns @saturnism
4. Setting up Kubernetes visualization of a cluster - @rpicloud
36 / 37
END
Eueung Mulyana
http://eueung.github.io/docker-stuff/learning-k8s
CodeLabs | Attribution-ShareAlike CC BY-SA
37 / 37

More Related Content

PDF
Rtl sdr software defined radio
PDF
learn Helm 3 for kuberenetes
PDF
SCALE 2011 Deploying OpenStack with Chef
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PPTX
Docker Networking - Current Status and goals of Experimental Networking
PDF
Web scale infrastructures with kubernetes and flannel
PDF
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
PDF
Containers in production with Docker, CoreOS, Kubernetes and Apache Stratos
Rtl sdr software defined radio
learn Helm 3 for kuberenetes
SCALE 2011 Deploying OpenStack with Chef
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Docker Networking - Current Status and goals of Experimental Networking
Web scale infrastructures with kubernetes and flannel
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
Containers in production with Docker, CoreOS, Kubernetes and Apache Stratos

What's hot (20)

PDF
Troubleshooting Tips from a Docker Support Engineer
PDF
Octo talk : docker multi-host networking
PDF
Multi container apps swarm + consul + compose
PDF
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
PDF
DockerとKubernetesをかけめぐる
PDF
containerdの概要と最近の機能
PDF
Building a Virtualized Continuum with Intel(r) Clear Containers
PPTX
Intro- Docker Native for OSX and Windows
PDF
App container rkt
PDF
Introduction and Deep Dive Into Containerd
PPTX
Docker network Present in VietNam DockerDay 2015
PDF
Small, Simple, and Secure: Alpine Linux under the Microscope
PDF
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
PPTX
Monitoring, Logging and Tracing on Kubernetes
PDF
eStargzイメージとlazy pullingによる高速なコンテナ起動
PDF
[KubeCon EU 2020] containerd Deep Dive
PDF
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
PDF
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
PDF
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
PDF
Embedded Recipes 2019 - Testing firmware the devops way
Troubleshooting Tips from a Docker Support Engineer
Octo talk : docker multi-host networking
Multi container apps swarm + consul + compose
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
DockerとKubernetesをかけめぐる
containerdの概要と最近の機能
Building a Virtualized Continuum with Intel(r) Clear Containers
Intro- Docker Native for OSX and Windows
App container rkt
Introduction and Deep Dive Into Containerd
Docker network Present in VietNam DockerDay 2015
Small, Simple, and Secure: Alpine Linux under the Microscope
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
Monitoring, Logging and Tracing on Kubernetes
eStargzイメージとlazy pullingによる高速なコンテナ起動
[KubeCon EU 2020] containerd Deep Dive
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
Embedded Recipes 2019 - Testing firmware the devops way
Ad

Similar to Learning kubernetes (20)

PDF
Kubernetes installation
PDF
Kube Your Enthusiasm - Tyler Britten
PDF
Scaling Docker with Kubernetes
PDF
Scaling docker with kubernetes
PDF
Docker and Kubernetes 101 workshop
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
Kubernetes Basis: Pods, Deployments, and Services
PDF
Kubernetes for Java Developers
PDF
JavaOne 2016: Kubernetes introduction for Java Developers
PDF
Kubernetes Ingress 101
PDF
Kubernetes
PDF
Spring Into Kubernetes DFW
PDF
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
PDF
Kubernetes Basics
PDF
Using kubernetes to lose your fear of using containers
PDF
Social Connections 14 - Kubernetes Basics for Connections Admins
PDF
Kubernetes Basics for Connections Admins
PDF
Kubernetes Boston — Custom High Availability of Kubernetes
PDF
Zero downtime-java-deployments-with-docker-and-kubernetes
PDF
Build Your Own CaaS (Container as a Service)
Kubernetes installation
Kube Your Enthusiasm - Tyler Britten
Scaling Docker with Kubernetes
Scaling docker with kubernetes
Docker and Kubernetes 101 workshop
K8s in 3h - Kubernetes Fundamentals Training
Kubernetes Basis: Pods, Deployments, and Services
Kubernetes for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers
Kubernetes Ingress 101
Kubernetes
Spring Into Kubernetes DFW
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Basics
Using kubernetes to lose your fear of using containers
Social Connections 14 - Kubernetes Basics for Connections Admins
Kubernetes Basics for Connections Admins
Kubernetes Boston — Custom High Availability of Kubernetes
Zero downtime-java-deployments-with-docker-and-kubernetes
Build Your Own CaaS (Container as a Service)
Ad

More from Eueung Mulyana (20)

PDF
FGD Big Data
PDF
Hyper-Connectivity and Data Proliferation - Ecosystem Perspective
PDF
Industry 4.0 And Beyond The A.I* For Surviving A Tech-Accelerated World
PDF
Blockchain Introduction
PDF
Bringing Automation to the Classroom: A ChatOps-Based Approach
PDF
FinTech & Cryptocurrency Introduction
PDF
Open Source Networking Overview
PDF
ONOS SDN Controller - Clustering Tests & Experiments
PDF
Open stack pike-devstack-tutorial
PDF
Basic onos-tutorial
PDF
ONOS SDN Controller - Introduction
PDF
OpenDaylight SDN Controller - Introduction
PDF
Mininet Basics
PDF
Android Programming Basics
PDF
Cloud Computing: Overview and Examples
PDF
selected input/output - sensors and actuators
PDF
Connected Things, IoT and 5G
PDF
Connectivity for Local Sensors and Actuators Using nRF24L01+
PDF
NodeMCU with Blynk and Firebase
PDF
Trends and Enablers - Connected Services and Cloud Computing
FGD Big Data
Hyper-Connectivity and Data Proliferation - Ecosystem Perspective
Industry 4.0 And Beyond The A.I* For Surviving A Tech-Accelerated World
Blockchain Introduction
Bringing Automation to the Classroom: A ChatOps-Based Approach
FinTech & Cryptocurrency Introduction
Open Source Networking Overview
ONOS SDN Controller - Clustering Tests & Experiments
Open stack pike-devstack-tutorial
Basic onos-tutorial
ONOS SDN Controller - Introduction
OpenDaylight SDN Controller - Introduction
Mininet Basics
Android Programming Basics
Cloud Computing: Overview and Examples
selected input/output - sensors and actuators
Connected Things, IoT and 5G
Connectivity for Local Sensors and Actuators Using nRF24L01+
NodeMCU with Blynk and Firebase
Trends and Enablers - Connected Services and Cloud Computing

Recently uploaded (20)

PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Getting Started with Data Integration: FME Form 101
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Architecture types and enterprise applications.pdf
PDF
Unlock new opportunities with location data.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
CloudStack 4.21: First Look Webinar slides
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Tartificialntelligence_presentation.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Chapter 5: Probability Theory and Statistics
A review of recent deep learning applications in wood surface defect identifi...
NewMind AI Weekly Chronicles – August ’25 Week III
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hindi spoken digit analysis for native and non-native speakers
A novel scalable deep ensemble learning framework for big data classification...
Getting Started with Data Integration: FME Form 101
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
1 - Historical Antecedents, Social Consideration.pdf
Hybrid model detection and classification of lung cancer
Architecture types and enterprise applications.pdf
Unlock new opportunities with location data.pdf
STKI Israel Market Study 2025 version august
CloudStack 4.21: First Look Webinar slides
DP Operators-handbook-extract for the Mautical Institute
Final SEM Unit 1 for mit wpu at pune .pptx
Tartificialntelligence_presentation.pptx
O2C Customer Invoices to Receipt V15A.pptx
Web Crawler for Trend Tracking Gen Z Insights.pptx
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Chapter 5: Probability Theory and Statistics

Learning kubernetes