在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):aireddy73/Kubernetes开源软件地址(OpenSource Url):https://github.com/aireddy73/Kubernetes开源编程语言(OpenSource Language):HTML 99.4%开源软件介绍(OpenSource Introduction):Kubernetes (K8s)CurriculumOpen Source Curriculum for CNCF Certification Courses This is the the latest version of the curriculum for the following CNCF exams:
Getting Started with Docker
Getting Started with Kubernetes
CKAD ExercisesA set of exercises that helped me prepare for the Certified Kubernetes Application Developer exam, offered by the Cloud Native Computing Foundation, organized by curriculum domain. They may as well serve as learning and practicing with Kubernetes. During the exam, you are allowed to keep only one other browser tab open to refer official documentation. Make a mental note of the breadcrumb at the start of the excercise section, to quickly locate the relevant document in kubernetes.io. It is recommended that you read official documents before attempting exercises below it. Contents
Where to Practice
Create 2 node Cluster on Linux Academy playgroud or you can spinup cluster in one of the cloud providers (AWS, Azure or GCP)creating 2 node cluster with Kubeadm Tasks from Kubernetes DocThe following are primarily links to either the 'concepts' or 'tasks' section of the kubernetes.io documentation. The 'task' items are very useful to use as labs. I've tied them directly to the curriculum to ensure they are appropriate study material for the exam. Core Concepts and Kubectl
Multi-Container PodsPod Design
Configuration
Observability
Services and NetworkingState PersistenceCRON
CKAD Exam Preparation NotesList of resources and notes for passing the Certified Kubernetes Application Developer (CKAD) exam. Official links below.
Current Kubernetes Version (EXAM)Version: 1.20 Important vi TipsThe moment you get into your exam terminal the first thing is you need to is below
kubectl TipsTo set nano as your editor for 'kubectl edit'
OutlineRight now there are five primary sections to this document.
TipsOkay, this section is new and contains some general pointers to help pass the exam. First, as discussed later, the exam is primarily about speed. With that in mind, the best way to approach the moderate to complex questions is to generate the initial YAML via the dry run flag. Then, edit the file with either vi or nano, and then create the required resource. The steps are outlined below.
There you go. If you're not satisfied with the results. Delete the resource, re-edit the declaritive yaml file, and redo.
OverviewThe CKAD exam requires an excellent understanding of K8s along with how to efficiently use kubectl to accomplish various tasks on Kubernetes. I'm sure they use this exam approach as it pretty much precludes any form of cheating. You either know the material and can very quickly implement it or not. You will be given a list of 'tasks' to accomplish on one of four kubernetes clusters (these are described in the official exam tips above). The exam is 'open book' but only with the content available at kubernetes.io. You will have one tab for the exam content and one additional tab for kubernetes.io. However, don't expect that you can just research questions during the exam, as there will be very little time for 'learning' a specific k8s concept at exam time. It's there to help with YAML syntax detail only, IMO. The items in this particular repo / page describe and follow the official curriculum and point back to the various documents at Kubernetes.io. There is a lot of content on k8s and a lot of it does not pertain to the CKAD exam, so I've pulled out the sections that are pertinent based on the curriculum. There is a nice checklist below that you can update once you think you have mastered a particular topic. Create 2 Node Cluster on GKEThis particular exam is difficult for me as I didn't have a k8s cluster to use at work. CKA exam prepation requires more cluster-level work, I tried different approaches for an inexpensive k8s environment. I setup my 2 node cluster in Linux Academy Playgroud as well as Docker-Desktop single node cluster on Windows Laptop. In my opinion, that is all it required to pass this exam. You can also setup a gcloud account, and use a two-node GKE cluster for studying. You can even use the very nice google cloud shell and not even leave your browser. gcloud command line (SDK) documentation Here are commands used to create a two-node cluster for studying. I keep these here just so I can fire up and destroy a cluster for a few hours each day for study. Notice that you can tailor the cluster version to match the k8s version for the exam.
The result:
Setting kubectl CredentialsIf using the cloud shell, you'll sometimes need to authorize kubectl to connect to your cluster instance.
Deleting Your ClusterNo need to keep the cluster around when not studying, so:
To Get Current GKE Kubernetes Versions
Detailed ReviewThe exam is about speed and efficiency. If you spend very much time looking at documentation, you will have zero chance of completing the many questions. With that said, the following will help with time management. I've aligned the tips to follow the curriculum. This section is best used to provide a quick overview of the curriculum along with the needed kubectl commands for a hands-on exam. CORE CONCEPTSThe core concepts section covers the core K8s API and its primitives and resources. It also covers the important concept of a POD. This is the basic unit of deployment for app developers and so this 'POD' concept is important to understand as well as how they are managed with kubectl. To me, this is embodied in the kubectl RUN command. Using the RUN/CREATE command for Pods, Deployments, etc.The The specific, underlying resource created from a particular
The above is helpful in the exam as speed is important. If the question indicates to 'create a pod', use the quick syntax to get a pod going. CONFIGURATIONConfiguration covers how run-time 'config' data is provided to your applications running in k8s. This includes environment variables, config maps, secrets, etc. Other items that are pertinent to config are the service account and security contexts used to execute the containers. The below items are covered by this part of the curriculum. Config Maps / Environment VariablesThe exam is about application development and its support within Kubernetes. With that said, high on the list of objectives is setting up config options and secrets for your applications. To create the most basic config map with a key value pair, see below.
There are many ways to map config map items to environment variables within a container process. One quick, but tricky (syntax) option is shown below. This would be for a simple nginx container.
Here is another way to map a specific value to a specific environment variable value.
Now to verify it worked.
Security ContextsSecurity contexts can be applied at either the pod or container level. Of course pod-level contexts apply to all containers within that pod. There are several ways of defining privileges and access controls with these contexts. These concepts are covered well in the tasks section below, but here is a basic RunAs example from the doc that shows both pod and container contexts being used.
App Resource RequirementsDefining the memory and cpu requirements for your containers is something that should always be done. It allows for more efficient scheduling and better overall hygiene for your application environment. Again, covered well in the tasks section below, but here is a brief snippet for the standard mem/cpu specification.
Now to verify:
SecretsTo quickly generate secrets, use the --from-literal flag like this:
This produces the following secret that can then be consumed by your containers. The value is encoded.
Now create the secret:
Now have a look at it:
Decode it:
Secrets can be mounted as data volumes or be exposed as environment variables to be used by a container in a pod. Here we'll mount our above secret as a volume.
Service AccountsWhen pods are created by K8s they are provided an identify via the service account. In most cases, pods use the default service account, but it can be specified directly.
MULTI-CONTAINER PODSThis particular section needs additional detail as these concepts are not covered that well via the tasks provided at kubernetes.io. Actually, the best coverage (for sidecars) is in the concepts section under logging architecture.
Concepts -> Logging Architecture POD DESIGNThe Pod design section mostly covers deployments, rolling updates, and rollbacks (and jobs). These are all covered well in the tasks section later in this document. The primary trick here is to really understand the basic commands for updating a deployment which causes a new replicaSet to be created for the rollout. Both replica sets exist as the rollout continues and completes. Deployment UpdatesBelow is a quick example of creating a deployment and then updating its image. This will force a rolling deployment to start. You can then roll it back.
Okay, now force a rolling update by updating its image.
Now you can check the status of the roll out.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论