Application Lifecycle Management Flashcards
What is the command to see the rollout status?
k rollout status deployment/<deployment_name></deployment_name>
What is the command to see the revisions of the deployment
k rollout history deployment/<deployment_name></deployment_name>
What is the major disadvantage of the Recreate deployment strategy?
The application will be down for some amount of time
What does the Rolling Update Deployment Strategy do?
The new version is deployed in between taking down a previous version, ensuring the application is always up
What command updates a deployment after the manifest has been modified?
k apply -f <deployment_manifest>.yaml</deployment_manifest>
What is the imperative command to update the image for a deployment?
k set image deployment/<deployment_name> \ nginx=nginx:1.9.1</deployment_name>
What is the command to rollback a deployment?
k rollout undo deployment/<deployment_name></deployment_name>
How do define a command argument to an image in a manifest?
Add the args parameter under spec. eg.
spec:
containers:
- name: ubuntu-sleeper
image: ubuntu-sleeper
args: [“10”]
How do define a docker style entrypoint in a manifest?
Add the command parameter under spec. eg.
spec:
containers:
- name: ubuntu-sleeper
image: ubuntu-sleeper
command: [“sleep2.0”]
args: [“10”]
How do you set arguments when running a pod from an imperative command?
k run <name> --image=<image_name> -- <arg1> <arg2></arg2></arg1></image_name></name>
How do you set environment variables in a manifest?
Use the env parameter under the spec section. Environment variables should be in an array. eg.
spec:
containers:
…
env:
- name:
value:
What is the purpose of a config map?
Config maps are used to pass configuration data in the form of key value pairs in Kubernetes.
What is the imperative command to create a configmap?
k create configmap \
app-config – from-literal=APP_COLOR=blue
What is the imperative command to create a configmap from a file?
k create configmap \
<config-name> --from-file=<path-to-file></path-to-file></config-name>
How do you create a declarative configmap?
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
APP_COLOR: blue
APP_MODE: prod