K8 basics Flashcards

1
Q

What is a manifest for a docker image?

A

A single manifest is info about an image such as layers, size and digest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is kubectl?

A

A command line tool from Kubernetes for communicating with a Kubernetes cluster

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does it mean to dockerize an app?

A

The process of packing and app to run in a Docker container (give it everything it needs to run there)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where is the manifest for Kubernetes deployment?

A

A manifest is a YAML-formatted representation of the Kubernetes resources that were generated from this release’s chart(s).

This command fetches the generated manifest for a given release.

helm get manifest RELEASE_NAME [flags]

Two ways manifest can be generated
1- by hand (create the yaml) - lives in the repo
2- render a helm chart into a manifest (helm chart can live in the repo or somewhere else like artifactory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where is the Docker file in our repos?

A

Depends on teams application repository, depends on the project structure. In SOCR it’s in the ci-cd directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to generate the manifest from a Helm template?

A

In the pipleline there’s a ‘render-chart’ template that will produce it otherwise do it by hand using the ‘helm template’ + location command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is needed to run a GitLab CI/CD pipeline?

A

To use GitLab CI/CD, you need:
Application code hosted in a Git repository.
A file called .gitlab-ci.yml in the root of your repository, which contains the CI/CD configuration.
In the .gitlab-ci.yml file, you can define:
The scripts you want to run.
Other configuration files and templates you want to include.
Dependencies and caches.
The commands you want to run in sequence and those you want to run in parallel.
The location to deploy your application to.
Whether you want to run the scripts automatically or trigger any of them manually.
The scripts are grouped into jobs, and jobs run as part of a larger pipeline. You can group multiple independent jobs into stages that run in a defined order. The CI/CD configuration needs at least one job that is not hidden.
You should organize your jobs in a sequence that suits your application and is in accordance with the tests you wish to perform. To visualize the process, imagine the scripts you add to jobs are the same as CLI commands you run on your computer.
When you add a .gitlab-ci.yml file to your repository, GitLab detects it and an application called GitLab Runner runs the scripts defined in the jobs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a container?

A
  1. An isolated environment for your code.
  2. It has all the files (os, app code, dependencies)
  3. By definition “it’s a package with the program to execute and all its dependencies, such as the code, runtime, system libraries, et cetera, [all] bound together in a box,”
  4. Runs in a pod
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a pod?

A
  • A wrapper or housing for your individual containers when deploying them in Kubernetes.
  • Containers for your containers. Think about each pod as a transparent wrapper that would provide a slot for the container.
  • A group of pods, related or unrelated, run on a cluster.
  • A pod is a unit of replication on a cluster;
  • The pod is the smallest deployable object for Kubernetes and will contain one or more containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a node?

A
  • Worker machines, called nodes, that run containerized applications.
  • Every cluster has at least one worker node.
  • The worker node(s) host the Pods that are the components of the application workload.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a cluster?

A
  • Central to thebasic architecture of Kubernetes: If you’re running Kubernetes, you’re running at least one cluster.
  • A cluster is like a central nervous system for your application(s).
  • A cluster contains nodes (1 or more)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a namespace?

A

A mechanism for isolating groups of resources within a single cluster.

Alternatively, isolation of groups of resources can be done on the clusters (instead of namespaces)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an image?

A

A container image represents binary data that encapsulates an application and all its software dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List the hierarchy of components (cluster, node, container, etc)

A
  • Cluster
  • Node
  • Pod
  • Container
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to find container id with kubectl

A
  1. auth in to system
  2. kubectl get nodes
  3. kubectl get pods –namespace (your-namespace)
  4. locate the desired pod
  5. kubectl describe pod (pod-name) –namespace –(your-namespace)
  6. Output shows container info
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Capstan?

A

Our deployment system that uses a collection of technologies

17
Q

What are the tools for troubleshooting deployments?

A
  1. OpenLens
  2. Argo
  3. Kubectl
  4. K8’s dashboard
18
Q

Where are application logs visible?

A
  • OpenLens
  • Kubectl
  • K8’s dashboard, find your app search for your pod
19
Q

How to find a pod?

A
  1. auth in
  2. kubectl get pods –namespace (your-namespace)
20
Q

What is in the ci-cd directory in the project?

A

Depends on your team. Mine is:
.app.gitlab-ci.yml
.integration.gitlab-ci.yml
Dockerfile
prod-values.yml
test-values.yml

21
Q

What is Kubernetes?

A

Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.

Container orchestration tool