Skip to content

Latest commit

 

History

History
127 lines (89 loc) · 2.72 KB

scheduling.md

File metadata and controls

127 lines (89 loc) · 2.72 KB

Core Concepts (13%)

kubernetes.io > Documentation > Reference > kubectl CLI > kubectl Cheat Sheet

kubernetes.io > Documentation > Tasks > Monitoring, Logging, and Debugging > Get a Shell to a Running Container

kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > Configure Access to Multiple Clusters

kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > Accessing Clusters using API

kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > Use Port Forwarding to Access Applications in a Cluster

Create a deployment from a YAML file named deploy.yml

show

kubectl apply -f deploy.yml

Describe a pod named nginx

show

kubectl describe po nginx

Delete a pod named nginx

show

kubectl delete po nginx

Create a deployment named nginx and use the image nginx

show

kubectl create deploy nginx --image=nginx

Create the YAML specification for a deployment named nginx, outputting to a file named deploy.yml

show

kubectl create deployment nginx --image=nginx --dry-run -o yaml > deploy.yml

Create a configmap named my-configmap with two values, one single line and one multi-line

show

# create a file named my-configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap
data:
  key1: Hello, world!
  key2: |
    Test
    multiple lines
    more lines

# create the confimap from the file my-configmap.yml
kubectl apply -f my-configmap.yml

# view the configmap data in the cluster
kubectl describe configmap my-configmap

Create a secret via yaml that contains two base64 encoded values

show

# create two base64 encoded strings
echo -n 'secret' | base64

echo -n 'anothersecret' | base64

# create a file named secret.yml
apiVersion: v1
kind: Secret
metadata:
  name: my-secret
type: Opaque
data:
  secretkey1: <base64 String 1>
  secretkey2: <base64 String 2>

# create a secret
kubectl create -f secretl.yml