SlideShare a Scribd company logo
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
JavaOne 2016: Kubernetes introduction for Java Developers
PDF
Kubernetes 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
JavaOne 2016: Kubernetes introduction for Java Developers
Kubernetes 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
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx
Modernizing your data center with Dell and AMD

Learning kubernetes