Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1007 Bytes

03.ImperativeCommands.md

File metadata and controls

50 lines (32 loc) · 1007 Bytes
# ConfigMap 
$ kubectl create configmap <name> --from-literal=db=staging --from-literal=username=joe
$ kubectl create configmap <name> --from-env-file=<filepath>
$ kubectl create configmap <name> --from-file=<filepath>

# Secret
$ kubectl create secret generic <name> --from-literal=username='fahmi' --from-literal='*!¥pass'

# Define command in a pod
$ kubectl run busybox --image busybox --restart Never --command -- wget -O test.json www.ibm.com/config.json
command:
- wget
- -O
- test.json
- www.ibm.com/config.json

$ kubectl create deployment <deployment-name> --image=<image-name>

$ kubectl expose deployment <deployment-name> --target-port=<port-number>


# Resource Quota 
$ kubectl create quota <name> --hard=pods=1,cpu=1,memory=1Gi
kind: ResourceQuota 
spec: 
  hard: 
    pods="1"
    cpu=1
    memory=1Gi

$ kubectl create quota <name> --hard=pods=1,requests.cpu=1,limits.cpu=2
kind: ResourceQuota
status:
  hard:
    pods="1"
    requests.cpu: "1"
    limits.cpu: "2"