没有合适的资源?快使用搜索试试~ 我知道了~
首页LFD259官方实验手册:2019年Kubernetes开发者课程
LFD259官方实验手册:2019年Kubernetes开发者课程
需积分: 24 0 下载量 46 浏览量
更新于2024-07-15
收藏 517KB PDF 举报
LFD259-labs_V2019-06-27 官方实验手册是一份由Linux Foundation(LF)发布的针对开发者的 Kubernetes 教程资料。该手册版本更新至2019年6月27日,强调了版权和知识产权的重要性。Linux Foundation保留所有内容的版权,禁止未经授权的复制、修改或分发给非参与者,除非获得书面许可。课程材料仅限于参加培训的个人使用,且禁止任何形式的未经许可的复制或传播,包括打印、影印、存储在检索系统中或通过电子方式传输。 手册的核心内容围绕 Kubernetes 技术,Kubernetes 是一个开源容器编排平台,用于自动化部署、扩展和管理容器化应用。LFD259课程旨在帮助开发者理解和掌握如何在 Kubernetes 上构建、运行和维护高效、可扩展的应用。课程涵盖了从基础概念如Pods、Services到高级主题,如网络策略、滚动更新和故障恢复等。 这份实验手册不仅包含了理论知识,还提供了实际操作的实验和案例,参与者将有机会通过实践学习 Kubernetes 的核心功能。由于涉及到开源代码,参与者需要熟悉相关的开源许可证,确保在使用这些代码时遵循正确的授权协议。 此外,Linux Foundation 提供的培训服务受版权保护,任何对内容或使用的声明或担保都是在特定条款下提供的,强调了产品和服务的适用性和质量,但不承担关于性能或商业适用性的明示或暗示保证。 LFD259-labs_V2019-06-27 官方实验手册是为有志于学习和深化 Kubernetes 技能的开发者设计的一份权威指南,它在保障知识产权的同时,为学习者提供了一个系统且实用的学习路径。
资源详情
资源推荐
12 CHAPTER 2. KUBERNETES ARCHITECTURE
3. View the details of the deployment, then the pod. Work through the output slowly. Knowing what a healthy deployment
and looks like can be helpful when troubleshooting issues. Again the Tab key can be helpful when using long auto-
generated object names. You should be able to type firstpodTab and the name will complete when viewing the pod.
student@ckad-1:~$ kubectl describe deployment firstpod
Name: firstpod
Namespace: default
CreationTimestamp: Fri, 25 Jul 2018 16:46:57 +0000
Labels: app=firstpod
Annotations: deployment.kubernetes.io/revision=1
Selector: app=firstpod
Replicas: 1 desired | 1 updated | 1 total | 1 available....
StrategyType: RollingUpdate
MinReadySeconds: 0
<output_omitted>
student@ckad-1:~$ kubectl describe pod firstpod-6bb4574d94-rqk76
Name: firstpod-6bb4574d94-rqk76
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: ckad-1/10.128.0.2
Start Time: Wed, 25 Jul 2018 06:13:18 +0000
Labels: pod-template-hash=2660130850
app=firstpod
Annotations: cni.projectcalico.org/podIP: 192.168.200.65/32
Status: Running
IP: 192.168.200.65
Controlled By: ReplicaSet/firstpod-6bb4574d94
<output_omitted>
4. Note that the resources are in the default namespace. Get a list of available namespaces.
student@ckad-1:~$ kubectl get namespaces
NAME STATUS AGE
default Active 20m
kube-node-lease Active 20m
kube-public Active 20m
kube-system Active 20m
5. There are two other namespaces. Look at the pods in the kube-system namespace.
student@ckad-1:~$ kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
calico-node-5ftrr 2/2 Running 0 24m
calico-node-f7zrw 2/2 Running 0 21m
coredns-fb8b8dccf-cmkds 1/1 Running 0 24m
coredns-fb8b8dccf-grltk 1/1 Running 0 24m
etcd-v141-r24p 1/1 Running 0 23m
<output_omitted>
6. Now look at the pods in a namespace that does not exist. Note you do not receive an error.
student@ckad-1:~$ kubectl get pod -n fakenamespace
No resources found.
7. You can also view resources in all namespaces at once. Use the --all-namespaces options to select objects in all
namespaces at once.
LFD259: V 2019-06-27 © Copyright the Linux Foundation 2019. All rights reserved.
13
student@ckad-1:~$ kubectl get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default firstpod-69cfdfd8d9-kj6ql 1/1 Running 0 44m
kube-system calico-node-5ftrr 2/2 Running 0 92m
kube-system calico-node-f7zrw 2/2 Running 0 89m
kube-system coredns-fb8b8dccf-cmkds 1/1 Running 0 92m
<output_omitted>
8. View several resources at once. Note that most resources have a short name such as rs for ReplicaSet, po for Pod,
svc for Service, and ep for endpoint. Note the endpoint still exists after we deleted the pod.
student@ckad-1:~$ kubectl get deploy,rs,po,svc,ep
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.extensions/firstpod 1/1 1 1 4m
NAME DESIRED CURRENT READY....
replicaset.extensions/firstpod-6bb4574d94-rqk76 1 1 1 ....
NAME READY STATUS RESTARTS AGE
pod/firstpod-6bb4574d94-rqk76 1/1 Running 0 4m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/basicservice NodePort 10.108.147.76 <none> 80:31601/TCP 21m
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 21m
NAME ENDPOINTS AGE
endpoints/basicservice <none> 21m
endpoints/kubernetes 10.128.0.3:6443 21m
9. Delete the ReplicaSet and view the resources again. Note that the age on the ReplicaSet and the pod it controls is
now less than a minute. The deployment controller started a new ReplicaSet when we deleted the existing one, which
started another pod when the desired configuration did not match the current status.
student@ckad-1:~$ kubectl delete rs firstpod-6bb4574d94-rqk76
replicaset.extensions "firstpod-6bb4574d94-rqk76" deleted
student@ckad-1:~$ kubectl get deployment,rs,po,svc,ep
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.extensions/firstpod 1/1 1 1 7m
NAME DESIRED CURRENT....
replicaset.extensions/firstpod-6bb4574d94-rqk76 1 1 ....
NAME READY STATUS RESTARTS AGE
pod/firstpod-7d99ffc75-p9hbw 1/1 Running 0 12s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 24m
NAME ENDPOINTS AGE
endpoints/kubernetes 10.128.0.2:6443 80m
endpoints/basicservice <none> 21m
10. This time delete the top-level controller. After about 30 seconds for everything to shut down you should only see the
cluster service and endpoint remain for the cluster and the service we created.
student@ckad-1:~$ kubectl delete deployment firstpod
deployment.extensions "firstpod" deleted
LFD259: V 2019-06-27 © Copyright the Linux Foundation 2019. All rights reserved.
14 CHAPTER 2. KUBERNETES ARCHITECTURE
student@ckad-1:~$ kubectl get deployment,rs,po,svc,ep
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/basicservice NodePort 10.108.147.76 <none> 80:31601/TCP 35m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 24m
NAME ENDPOINTS AGE
endpoints/basicservice <none> 21m
kubernetes 10.128.0.3:6443 24m
11. As we won’t need it for a while, delete the basicservice service as well.
student@ckad-1:~$ kubectl delete svc basicservice
service "basicservice" deleted
LFD259: V 2019-06-27 © Copyright the Linux Foundation 2019. All rights reserved.
Chapter 3
Build
Exercise 3.1: Deploy a New Application
Overview
In this lab we will deploy a very simple Python application, test it using Docker, ingest it into Kubernetes and con-
figure probes to ensure it continues to run. This lab requires the completion of the previous lab, the installation and
configuration of a Kubernetes cluster.
Working with Python
1. Install python on your master node. It may already be installed, as is shown in the output below.
student@ckad-1:~$ sudo apt-get -y install python
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version (2.7.12-1~16.04).
python set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
student@ckad-1:~$
2. Locate the python binary on your system.
student@ckad-1:~$ which python
/usr/bin/python
3. Create and change into a new directory. The Docker build process pulls everything from the current directory into the
image file by default. Make sure the chosen directory is empty.
student@ckad-1:~$ mkdir app1
student@ckad-1:~$ cd app1
student@ckad-1:~/app1$ ls -l
total 0
15
剩余93页未读,继续阅读
gaoyidong
- 粉丝: 2
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 多模态联合稀疏表示在视频目标跟踪中的应用
- Kubernetes资源管控与Gardener开源软件实践解析
- MPI集群监控与负载平衡策略
- 自动化PHP安全漏洞检测:静态代码分析与数据流方法
- 青苔数据CEO程永:技术生态与阿里云开放创新
- 制造业转型: HyperX引领企业上云策略
- 赵维五分享:航空工业电子采购上云实战与运维策略
- 单片机控制的LED点阵显示屏设计及其实现
- 驻云科技李俊涛:AI驱动的云上服务新趋势与挑战
- 6LoWPAN物联网边界路由器:设计与实现
- 猩便利工程师仲小玉:Terraform云资源管理最佳实践与团队协作
- 类差分度改进的互信息特征选择提升文本分类性能
- VERITAS与阿里云合作的混合云转型与数据保护方案
- 云制造中的生产线仿真模型设计与虚拟化研究
- 汪洋在PostgresChina2018分享:高可用 PostgreSQL 工具与架构设计
- 2018 PostgresChina大会:阿里云时空引擎Ganos在PostgreSQL中的创新应用与多模型存储
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功