Home » Introduction to Containers, Kubernetes, and OpenShift V2 Cognitive Class Exam Answers

Introduction to Containers, Kubernetes, and OpenShift V2 Cognitive Class Exam Answers

by IndiaSuccessStories
0 comment

Introduction to Containers, Kubernetes, and OpenShift V2

Containers

Containers are a form of virtualization that allows applications to be packaged along with their dependencies and configuration files. They provide consistency across different computing environments (development, testing, production) by ensuring that an application and its runtime environment are isolated from other applications running on the same host.

Key characteristics of containers:

  • Lightweight: They share the host operating system kernel, making them more efficient than traditional virtual machines.
  • Portable: Containers can run on any system that supports the container runtime (e.g., Docker).
  • Scalable: Containers are easy to scale horizontally, allowing applications to handle varying loads seamlessly.

Kubernetes

Kubernetes (often abbreviated as K8s) is an open-source container orchestration platform originally developed by Google. It automates the deployment, scaling, and management of containerized applications. Kubernetes provides a framework for automating the deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery.

Key features of Kubernetes:

banner
  • Orchestration: Kubernetes automates the deployment and scaling of containers.
  • Service discovery and load balancing: It manages network traffic to and between containers.
  • Storage orchestration: It automatically mounts storage systems.
  • Automated rollouts and rollbacks: Kubernetes can change the state of your application, and it maintains history.
  • Self-healing: Kubernetes restarts containers that fail, replaces containers, kills containers that don’t respond to your user-defined health check, and doesn’t advertise them to clients until they are ready to serve.

OpenShift

OpenShift is a Kubernetes container platform developed by Red Hat. It builds on top of Kubernetes and adds additional features to simplify the development and deployment of containerized applications.

Key features of OpenShift:

  • Developer-friendly: OpenShift provides streamlined workflows for building, deploying, and scaling applications.
  • Enterprise-ready: It includes security features, multi-tenancy support, and integration with existing systems.
  • Source-to-Image (S2I): OpenShift provides a framework for building reproducible container images from source code.
  • Service mesh: OpenShift offers integration with Istio for managing microservices communication.
  • Logging and monitoring: It includes built-in tools for monitoring application performance and logging.

In summary, Containers provide a way to package and run applications, Kubernetes orchestrates and manages those containers at scale, and OpenShift extends Kubernetes with additional developer and enterprise-friendly features. Together, they form a powerful ecosystem for building and managing modern, cloud-native applications.

Introduction to Containers, Kubernetes, and OpenShift V2 Cognitive Class Certification Answers

Question 1: Which of the following are benefits of containers?

  • Each container runs its own operating system (OS).
  • Containers provide a standardized way to package and ship software.
  • Like virtual machines (VMs), containers virtualize your infrastructure.
  • Each container is fully isolated and therefore secure.

Question 2: What is an image?

  • An isolated process running on a local or remote host with its own file system and networking.
  • A read-only file that contains the source code, libraries, and dependencies that are needed to run an application.
  • A YAML file with key/value pairs specifying the attributes of a container.
  • A text file that contains the commands and settings that will run a container and the apps running in that container.

Question 3: In this sample Dockerfile, what does the FROM instruction do?

FROM ubuntu:18.04

COPY . /app

RUN make /app

CMD python /app/app.py

  • It defines the virtualized host operating system on which the container will run.
  • It defines the operating system on which the docker build command must be run.
  • It defines the base image, which in this case is Ubuntu version 18.04.
  • It defines the minimum version of the operating system for the docker build command to use.

Question 4: What does the docker build command do?

  • It uses an image to create a container.
  • It uses a Dockerfile to create an image.
  • It creates a Dockerfile.
  • It creates a Docker app.

Question 5: You can use the Docker COPY instruction to copy files from your local machine to a container.

  • True
  • False

Question 1: Which of the following statements describes what Kubernetes is?

  • Open source software.
  • Container orchestration platform.
  • Widely available.
  • A tool that facilitates declarative management.
  • All of the above.

Question 2: Which of the following components is part of the Kubernetes control plane?

  • The worker nodes.
  • etcd
  • The kubelet
  • The Kubernetes network proxy.

Question 3: Which of the following are Kubernetes objects?

  • B and C
  • Namespaces
  • ConfigMaps
  • Kubelets
  • Clusters

Question 4: Which Kubernetes object represents a single instance of processes running in a container?

  • Deployment
  • Pod
  • ReplicaSet
  • Cluster
  • Kubelet

Question 5: In this sample kubectl command, what does create do?

  • kubectl create -f nginx.yaml
  • It creates a YAML file named nginx.yaml.
  • It creates an object using the details in the nginx.yaml file.
  • It creates a new cluster using the details in the nginx.yaml file.
  • It creates a configuration file for a nginx web server.

Question 1: Which of the following statements describes what a ReplicaSet does? Select all that apply.

  • Maintains a stable set of Pods in a cluster, spinning up or deleting pods as needed.
  • Provides configuration details to Deployments.
  • Rolls out app changes in an automated and controlled manner.
  • Replicates a Deployment.
  • Autoscales an application.

Question 2: Which of the following Kubernetes objects are used to run applications? Select all that apply.

  • ReplicaSets
  • ConfigMaps
  • Secrets
  • Service bindings
  • ibmcloud CLI

Question 3: In this sample kubectl command, what does get deployments tell us? Select all that apply.

» kubectl get deployments

NAME READY           UP-TO-DATE AVAILABLE   AGE

Nginx-deploy  1/3       1          1         

3s                                

  • How many replicas of the application are ready.
  • The number of replicas that have been updated to the desired state.
  • How many replicas of the application are available.
  • How long the application has been running.
  • The Kubernetes namespace in which the Deployments live.

Question 4: Which of the following Kubernetes objects is used to store and manage sensitive information?

  • Service bindings
  • ConfigMaps
  • Secrets
  • ReplicaSets

Question 5: Which of the following can be used to create ConfigMaps? Select all that apply.

  • The kubectl add configmap command.
  • A file with key-value pairs.
  • A YAML configuration file.
  • Service bindings.
  • Horizontal Pod Autoscaler.

Question 1: Which of the following most accurately describes the relationship between Red Hat OpenShift and Kubernetes?

  • OpenShift packages Kubernetes with additional tooling to make developers and administrators more successful.
  • OpenShift is a tool in the Kubernetes that ecosystem that can be used in conjunction with Kubernetes to deploy cloud-native applications.
  • OpenShift can be deployed on a Kubernetes cluster to provide additional tooling such as logging, monitoring, and CI/CD.
  • OpenShift plugs into Kubernetes through custom resource definitions to provide build and other capabilities.

Question 2: Which of the following are Red Hat OpenShift build triggers? Select all that apply.

  • Webhook
  • Image change
  • Configuration change
  • Source-to-image
  • Docker build

Question 3: Which of the following are possible with Istio service mesh? Select all that apply.

  • Routing traffic to two versions of a microservice.
  • Setting policies that stipulate which services can talk to each other.
  • Encrypting traffic between services.
  • Creating protocols for service to service communication.
  • Decouple applications into smaller, loosely coupled microservices.

Question 4: Which of the following are types of operators available in OperatorHub? Select all that apply.

  • Red Hat
  • Certified
  • Community
  • Custom controller
  • CRD

Question 5: Image streams can point to images in which of the following locations. Select all that apply.

  • Other image streams.
  • Public external registries.
  • Private external registries.
  • The OpenShift internal registry.
  • A Kubernetes cluster.

Question 1: What does the Docker CLI build command do?

  • It builds an image from a Dockerfile.
  • It builds a microservice that will run in an image.
  • It builds a Dockerfile.
  • It builds a new container.
  • It builds a new cluster.

Question 2: In this sample Dockerfile, what does the FROM instruction do?

FROM alpine:3.9

COPY . /app

RUN make /app

CMD python /app/app.py

  • It defines the base image, which in this case is Alpine version 3.9.
  • It defines the virtualized host operating system on which the container will run.
  • It defines the minimum version of the operating system for the docker build command to use.
  • It defines the operating system on which the docker build command must be run.

Question 3: Containers include a guest operating system in every instance.

  • True
  • False

Question 4: In this sample docker build command, what does the -t option do?

docker build -t my-app:v1 .

  • It gives the image the name “my-app” and the tag “v1”.
  • It indicates that the files used to build the image are located in the current working directory.
  • It indicates that the version “v1” of “my-app” should be used when building the image.
  • It tags the current working directory as the target location for the image being built.

Question 5: You use the docker push command to distribute an image to a registry.

  • True
  • False

Question 6: Which of the following statements describes what Kubernetes is? Select all that apply.

  • An all-inclusive platform as a service (PaaS).
  • A service for building source code.
  • A continuous delivery pipeline.
  • A solution for sharing and storing images.
  • A container orchestration platform.

Question 7: Which of the following are container runtimes? Select all that apply.

  • Docker
  • rocket
  • CRI-O
  • DRunner
  • Kubelet

Question 8: Which of the following Kubernetes objects can you use to segregate a cluster by team or project?

  • Namespaces
  • ConfigMaps
  • Kubernetes controllers
  • Volumes

Question 9: Which Kubernetes object provides updates to Pods and ReplicaSets?

  • Deployment
  • ConfigMap
  • Secret
  • Patch

Question 10: In this sample kubectl command, what does create do?

kubectl create -f pod.json

  • It creates a JSON file named pod.json.
  • It creates an object using the details in the pod.json file.
  • It creates a new cluster using the details in the pod.json file.
  • It creates a file that contains the configuration for a Kubernetes Pod.

Question 11: How are ReplicaSets often created?

  • One is automatically created for you when you create a Ddeployment.
  • Using the kubectl create replicaset command.
  • By adding a ReplicaSet: on flag to the deployment’s configuration file.
  • By Adding a ReplicaSet: on flag to the Dockerfile used to build the container image.

Question 12: Which of the following Kubernetes objects are used to run applications? Select all that apply.

  • Plugins
  • ConfigMaps
  • ResourceSets
  • Service bindings
  • Deployments

Question 13: Which of the following are used to provide ConfigMaps to Pods and Deployments? Select all that apply.

  • String literals
  • YAML configuration files
  • Container runtimes
  • Service bindings
  • Kubernetes schedulers

Question 14: What Kubernetes capabilities enable an application to increase the number of Pods based on traffic? Select all that apply.

  • Service binding
  • Horizontal Pod Autoscaler
  • kubectl autoscale command
  • Kubernetes traffic router
  • kubectl scale command

Question 15: What does the following command do?

kubectl get secrets –namespace=default

  • Retrieves the secrets in the “default” namespace.
  • Retrieves the IBM Cloud IAM API key for your Kubernetes cluster.
  • Retrieves the binding.password values for the services bound to your Kubernetes cluster.
  • Retrieves all the Secrets in your Kubernetes cluster.

Question 16: What is the Istio service mesh used for? Select all that apply.

  • Control the flow of traffic between services.
  • Secure communication between services.
  • Encrypt Kubernetes secrets.
  • Observe and monitor services.

Question 17: Kubernetes is the sole project hosted by the CNCF.

  • True
  • False

Question 18: OpenShift can be run in which of the following environments? Select all that apply.

  • On premise
  • Public cloud
  • Private cloud
  • Hybrid cloud

Question 19: What is the open-source upstream version of OpenShift called?

  • OKD
  • Kubernetes open source
  • Istio
  • CRD
  • Red Hat Enterprise Linux CoreOS

Question 20: Which of the following build strategies injects application source code into builder images without having to write a Dockerfile?

  • Docker
  • Source-to-image
  • Custom build
  • Image stream
  • Webhook

Question 21: Image streams contain complete image data.

  • True
  • False

You may also like

Leave a Comment

Indian Success Stories Logo

Indian Success Stories is committed to inspiring the world’s visionary leaders who are driven to make a difference with their ground-breaking concepts, ventures, and viewpoints. Join together with us to match your business with a community that is unstoppable and working to improve everyone’s future.

Edtior's Picks

Latest Articles

Copyright © 2024 Indian Success Stories. All rights reserved.