Kustomize Flashcards

1
Q

What is kustomize?

A
  • kubernetes native tool
  • for customizing kubernetes manifest files
  • doesnt require complex templating or additional tools
  • uses yaml
  • built into kubectl
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you use kustomize?

A

kubectl apply -k < kustomize-directory >

While having inside a kustomization.yaml

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

Why is kustomize used?

A
  • helps customizing config files in a template free way
  • provides methods and common values like generators to make customization easier#
  • common values help making labels, names and annotations consistent
  • generators let you define secrets and config files for you pods
  • easiliy define changes for different environments
  • done by using patching and overlays, that needs a single folder for each environment
  • easy to use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are basic folders used by kustomize and what do they contain?

A
  • base:
  • overlay: contains environment specific folders which contain the kustomization.yaml and config.properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the kustomization.yaml file contain?

A
  • resources: which manifest files should be included in kustomization
  • common attributes: specify common configurations that you want to be consistent, like labels, annotations and names
  • generators: for creating/managing configmaps and kubernetes secrets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Show an example for a kustomization.yaml

A

resources:
- deployment.yaml
- service.yaml

commonLabels:
app: mykustomapp

commonAnnotations:
app: mykustom-annotations

namePrefix:
kustom-

nameSuffix:
-v1

configMapGenerator:
- name: mykustom-map
env: config.properties

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

Show an example for an overlay implementation

A

Via folder structure with patch-files.

Folder structure:
– overlays
|– dev
|– config.properties
|– kustomization.yaml
|– replicas.yaml

kustomization.yaml

namespace: prod
patches:
- replicas.yaml

configMapGenerator:
- name: mykustom-map
env: config.properties

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

How do you take a loot at the kustomize file that is going to be applied?

A

‘kubectl kustomize’

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