kubectl create -f <deployment-defn>
kubectl rollout status <deployment-name>
kubectl rollout history <deployment-name>
Entrypoint takes arguments that are supplied on command line during docker/kubectl run or from kubernetes manifests Dockerfile: ENTRYPOINT ["python", "app.py"]
ENTRYPOINT ["python", "app.py"]
CMD ["--color", "red"]
k get configmap
k create configmap <name> --from-literal=KEY=VALUE
apiVersion: v1
kind: Pod
metadata:
name: dapi-test-pod
spec:
containers:
- name: test-container
image: k8s.gcr.io/busybox
command: [ "/bin/sh", "-c", "env" ]
env:
# Define the environment variable
- name: SPECIAL_LEVEL_KEY
valueFrom:
configMapKeyRef:
# The ConfigMap containing the value you want to assign to SPECIAL_LEVEL_KEY
name: special-config
# Specify the key associated with the value
key: special.how
creating multiple secrets
kubectl create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DB_User=root --from-literal=DB_Password=password123
containers:
- name: app
image: kodekloud/event-simulator
volumeMounts:
- mountPath: /log
name: log-volume
- name: sidecar
image: kodekloud/filebeat-configured
volumeMounts:
- mountPath: /var/log/event-simulator/
name: log-volume
volumes:
- name: log-volume
hostPath:
# directory location on host
path: /var/log/webapp
# this field is optional
type: DirectoryOrCreate
Secrets have type type: kubernetes.io/service-account-token