随笔分类 - k8s
kubernetes
摘要:Warning FailedCreatePodSandBox 15s (x4 over 22s) kubelet, node01 (combined from similar events): Failed to create pod sandbox: rpc error: code = Unkno
阅读全文
摘要:State Persistence (8%) Defining and Mounting a PersistentVolume Create a Persistent Volume named pv, access mode ReadWriteMany, storage class name sha
阅读全文
摘要:Services & Networking (13%) Routing Traffic to Pods from Inside and Outside of a Cluster Create a deployment named myapp that creates 2 replicas for P
阅读全文
摘要:Pod Design (20%) Defining and Querying Labels and Annotations Create three different Pods with the names frontend, backend and database that use the i
阅读全文
摘要:Observability (18%) Defining a Pod’s Readiness and Liveness Probe Create a new Pod named hello with the image bonomat/nodejs-hello-world that exposes
阅读全文
摘要:Multi-Container Pods (10%) Implementing the Adapter Pattern The adapter pattern helps with providing a simplified, homogenized view of an application
阅读全文
摘要:Configuration (18%) Configuring a Pod to Use a ConfigMap Create a new file named config.txt with the following environment variables as key/value pair
阅读全文
摘要:Core Concepts (13%) Creating a Pod and Inspecting it Create the namespace ckad-prep. In the namespace ckad-prep create a new Pod named mypod with the
阅读全文
摘要:练习环境: https://www.katacoda.com/courses/kubernetes/playground CKAD考试大纲: Core Concepts (13%) Multi-Container Pods (10%) Pod Design (20%) State Persisten
阅读全文
摘要:题目: 检查有多少nodes是ready状态,(不包含node的污点,没有调度的),写入数量到 /opt/nodenum 解答: (1)获取Ready的节点数m kubectl get node | grep -w Ready | wc -l (2)获取有污点和没有调度的节点数n kubectl d
阅读全文
摘要:考试题: 向lumpy—koala添加一个init容器(已在/opt/kucc00100/pod-spec-kucc00100.yaml中定义) init容器应该创建一个名为/workdir/calm.txt的空文件 如果/workdir/calm.txt没有检测到,Pod应该退出 一旦使用init
阅读全文
摘要:创建一个secret,使用以下: 名字:super-secret credential:bob 创建一个pod名为pod-secrets-via-file 使用redis镜像,挂载名为super-secret的 挂载路径/secrets 使用redis镜像创建第二个Pod名称Pod-secrets-
阅读全文
摘要:使用kubeadm部署一个k8s集群,把节点node01加入集群。(docker已安装) 1.添加kubernetes源:(master+node01均执行该步骤) sudo apt update && sudo apt install -y apt-transport-https curl cur
阅读全文
摘要:The connection to the server localhost:8080 was refused - did you specify the right host or port?原因:kubectl命令需要使用kubernetes-admin来运行。解决办法: 1.将主节点中的/et
阅读全文
摘要:master $ kubectl top pod -n kube-systemError from server (NotFound): the server could not find the requested resource (get services http:heapster:) 问题
阅读全文
摘要:Pod: -一组功能相关的Container的封装 -共享存储和Network Namespace -K8s调度和作业运行的基本单位(Scheduler调度,Kubelet运行) -容易“走失”,需要workload和Service的“呵护” Workloads(Deployment,Statefu
阅读全文
摘要:Pod的管理对象Replication Controller、Deployment、DaemonSet和Job都是面向无状态的服务,但实际中有很多服务是有状态的,比如Mysql集群、MongoDB集群、ZooKeeper集群等,可以使用StatefulSet来管理有状态的服务。 StatefulSe
阅读全文
摘要:由于Replication Controller与Kubernetes代码中的模块Replication Controller同名,同时这个词也无法准确表达它的意思,所以从Kubernetes v1.2开始,它就升级成了另外一个新的对象——Replica Set,官方解释为“下一代的Replicat
阅读全文
摘要:Replication Controller的作用是声明Pod的副本数量在任意时刻都符合某个预期值,所以Replication Controller的定义包括如下几个部分。 Pod期待的副本数量(replicas)。 用于筛选目标Pod的Label Selector。 当Pod的副本数量小于预期数量
阅读全文
摘要:Deployment 简介 deployment 是用来管理无状态应用的,面向的是集群的管理, 举例:有一群鸭子,要吃掉一个,只需要再放一个新的鸭仔就好了,不会影响什么,而有状态的应用,就同时养三条狗一样,而每个狗都是无法代替用新的事物代替的,因为有“感情”这个状态在里面。 Deployment 为
阅读全文