prompt stringlengths 13 282 | response stringlengths 128 3.11k |
|---|---|
Execute the command 'sleep 3600' in the container 'stardust-shuttle' of the pod 'proxy-service-pod' and retrieve the output. | Command:
```bash
kubectl exec proxy-service-pod -c stardust-shuttle -- sleep 3600
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If o... |
Add a taint with key 'dedicated' on the nodes having the label 'cluster=my-cluster' and value 'dedicated=web-node-8:PreferNoSchedule' | Command:
```bash
kubectl taint node -l cluster=my-cluster dedicated=web-node-8:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usag... |
Import specific keys from a config map to a deployment | Command:
```bash
kubectl set env --keys=API_KEY --from=configmap/log-config deployment/backend-microservice-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable defini... |
Execute the command 'kubectl exec media-stream-pod -- nginx -t' to get the output of running 'nginx -t' command inside the 'media-stream-pod' pod. | Command:
```bash
kubectl exec media-stream-pod -- nginx -t
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use the kubectl... |
Execute the 'mongod' command in the pod named 'mypod' and retrieve the output from the first container | Command:
```bash
kubectl exec mypod -- mongod
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use the kubectl.kubernetes.i... |
Retrieve the previous terminated logs of the "cyber-sleuth" container from the "vpn-service-pod" pod. | Command:
```bash
kubectl logs -p -c cyber-sleuth vpn-service-pod
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "--container", ... |
Retrieve snapshot logs from all containers in pods with the label "feature=feature-xyz" | Command:
```bash
kubectl logs -l feature=feature-xyz --all-containers=true
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "--co... |
Import the 'API_KEY' key from the 'kube-system-config' ConfigMap and set it as an environment variable in the 'frontend-deployment' deployment. | Command:
```bash
kubectl set env --keys=API_KEY --from=configmap/kube-system-config deployment/frontend-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definition... |
Set the service account for the deployment "payment-processor-deployment" to "dashboard" | Command:
```bash
kubectl set serviceaccount deployment payment-processor-deployment dashboard
```
What it does:
Update the service account of pod template resources.
Possible resources (case insensitive) can be:
replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset
Syntax:... |
Add a taint to nodes with a specific label | Command:
```bash
kubectl taint node -l environment=production disktype=k8s-node-1:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "u... |
Forward local port 8000 to the target port of the "https" service port in a selected pod by the "monitoring-service" service. | Command:
```bash
kubectl port-forward service/monitoring-service 8000:https
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will be sel... |
Remove the taint with key 'environment' and effect 'NoSchedule' from the node 'edge-node-10' if it exists | Command:
```bash
kubectl taint nodes edge-node-10 environment:NoSchedule-
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One... |
Embed the certificate authority data for the cluster-beta cluster entry by running the command: "kubectl config set-cluster cluster-beta --embed-certs --certificate-authority=~/.kube/web-cluster/kubernetes.ca.crt" | Command:
```bash
kubectl config set-cluster cluster-beta --embed-certs --certificate-authority=~/.kube/web-cluster/kubernetes.ca.crt
```
What it does:
Set a cluster entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.
Syntax:
`kubectl config set-... |
Run 'nginx -t' command on the first pod of the deployment "database-deployment" | Command:
```bash
kubectl exec deploy/database-deployment -- nginx -t
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use t... |
create a new NodePort service named media-stream-nodeport | Command:
```bash
kubectl create service nodeport media-stream-nodeport --tcp=8080:8089
```
What it does:
Create a NodePort service with the specified name.
Syntax:
`kubectl create service nodeport NAME [--tcp=port:targetPort] [--dry-run=server|client|none]`
Helpful flags:
"flag": "--output", "short": "-o", "default"... |
Create a new config map named app-name-config with the specified keys instead of file basenames on disk | Command:
```bash
kubectl create configmap app-name-config --from-file=properties=/path/to/data/file1.txt --from-file=key1=/path/to/options/file2.txt
```
What it does:
Create a config map based on a file, directory, or specified literal value.
A single config map may package one or more key/value pairs.
When creating a... |
Create a cluster role named "bar" with the specified API Group, and grant it permissions to perform update, get, and patch operations on persistent volumes resources. | Command:
```bash
kubectl create clusterrole bar --verb=update,get,patch --resource=persistentvolumes.storage.k8s.io
```
What it does:
Create a cluster role.
Syntax:
`kubectl create clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run=server|client|none]`
Helpful flags:
"fl... |
Create a copy of the auth-service-pod called debug-image-memcached with a debian debug container, and change the container images for proxy and api to nginx:1.21 and api:v2, respectively. | Command:
```bash
kubectl debug auth-service-pod -it --copy-to=debug-image-memcached --image=debian --set-image=proxy=nginx:1.21,api=api:v2
```
What it does:
Debug cluster resources using interactive debugging containers.
'debug' provides automation for common debugging tasks for cluster objects identified by resource ... |
Copy the file 'foo' from the local machine to the directory '/tmp/bar_dir' in the 'ingress-controller-pod-8' pod in the 'kube-server' namespace. | Command:
```bash
kubectl cp :/tmp/foo kube-server/ingress-controller-pod-8:/tmp/bar_dir
```
What it does:
Copy files and directories to and from containers.
Syntax:
`kubectl cp <file-spec-src> <file-spec-dest>`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, ... |
Forward local ports 9090 and 6000 to ports 6379 and 6000 in the pod | Command:
```bash
kubectl port-forward pod/proxy-server-pod 9090 6379
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will be selected a... |
Attach to the nano-bot container in the e-commerce-pod to get its output | Command:
```bash
kubectl attach e-commerce-pod -c nano-bot
```
What it does:
Attach to a process that is already running inside an existing container.
Syntax:
`kubectl attach (POD | TYPE/NAME) -c CONTAINER`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use ... |
Get the output from running the 'apache2ctl -D FOREGROUND' command in the 'time-machine' container of the 'vpn-service-pod' pod. | Command:
```bash
kubectl exec vpn-service-pod -c time-machine -- apache2ctl -D FOREGROUND
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container na... |
Retrieve the snapshot logs from the container "payment-gateway-pod-1" of the deployment named "analytics-platform-deployment". | Command:
```bash
kubectl logs deployment/analytics-platform-deployment -c payment-gateway-pod-1
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful... |
View the last 12 lines of logs from the pod named proxy-server-pod. | Command:
```bash
kubectl logs --tail=12 proxy-server-pod
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "--container", "short":... |
Get the output from running the 'python' command in the 'mycontainer' container of the 'api-service-pod' pod. | Command:
```bash
kubectl exec api-service-pod -c mycontainer -- python
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use... |
List deployments in YAML output format from the "alpha-2.0" version of the "alpha-apps" API group | Command:
```bash
kubectl get deployments.alpha-2.0.alpha-apps -o yaml
```
What it does:
Display one or many resources.
Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you w... |
Open a raw terminal session with the e-commerce pod and attach to the warp-drive container. | Command:
```bash
kubectl attach e-commerce-pod -c warp-drive -i -t
```
What it does:
Attach to a process that is already running inside an existing container.
Syntax:
`kubectl attach (POD | TYPE/NAME) -c CONTAINER`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitt... |
Enable the Google Compute Platform auth provider for the "cluster-admin" entry. | Command:
```bash
kubectl config set-credentials cluster-admin --auth-provider=gcp
```
What it does:
Set a user entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values.
Client-certificate flags:
--client-certificate=certfile --client-key=keyfile
Bearer token flags:
... |
Retrieve the logs for the container 'backend-microservice-deployment-1' in the deployment 'e-commerce-pod' | Command:
```bash
kubectl logs deployment/backend-microservice-deployment -c e-commerce-pod-1
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful fl... |
Create an ingress rule for site.com/bar to direct traffic to svc1:3000 with a TLS secret "my-cert" | Command:
```bash
kubectl create ingress app-ingress --rule="site.com/bar=svc1:3000,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Ou... |
Create an ingress called 'default-ingress' that directs requests for foo.com/module to the service svc1 on port 8010, with the TLS secret named "my-cert". | Command:
```bash
kubectl create ingress default-ingress --rule="foo.com/module=svc1:8010,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage... |
Add a taint with key 'environment' on nodes having label zone=us-east-1 | Command:
```bash
kubectl taint node -l zone=us-east-1 environment=node-2:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "O... |
Remove the taint with key 'environment' and effect 'NoSchedule' from the 'db-node-7' node | Command:
```bash
kubectl taint nodes db-node-7 environment:NoSchedule-
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of... |
Add a taint with key 'datacenter' and value 'testing-node-11' on nodes having the label 'instance=app-instance-1' | Command:
```bash
kubectl taint node -l instance=app-instance-1 datacenter=testing-node-11:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default"... |
Port forward data between local ports 8888 and 6000 and the pod's ports 8000 and 6000 | Command:
```bash
kubectl port-forward pod/backend-pod 8888 8000
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will be selected automa... |
Create a single ingress called 'app-proxy-ingress' that directs requests to foo.com/example to svc1:27017 with a TLS secret named "my-cert" | Command:
```bash
kubectl create ingress app-proxy-ingress --rule="foo.com/example=svc1:27017,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "u... |
Create a single ingress called 'private-service-ingress' that directs requests to testing.com/module to svc1:3000 with a TLS secret "my-cert" | Command:
```bash
kubectl create ingress private-service-ingress --rule="testing.com/module=svc1:3000,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default"... |
Create a config map named app-name-config from an environment file | Command:
```bash
kubectl create configmap app-name-config --from-env-file=path/to/data.env
```
What it does:
Create a config map based on a file, directory, or specified literal value.
A single config map may package one or more key/value pairs.
When creating a config map based on a file, the key will default to the b... |
Return the logs for the container named "chat-app-pod-1" in the "web-app-deployment" deployment | Command:
```bash
kubectl logs deployment/web-app-deployment -c chat-app-pod-1
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "-... |
View detailed information about a specific node | Command:
```bash
kubectl describe nodes prod-node-3.datacenter1.example.com
```
What it does:
Show details of a specific resource or group of resources.
Print a detailed description of the selected resources, including related resources such as events or controllers. You may select a single object by name, all objects... |
Return snapshot logs from container log-aggregator-deployment-1 of a deployment named e-commerce-pod | Command:
```bash
kubectl logs deployment/log-aggregator-deployment -c e-commerce-pod-1
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"... |
Start a pod named 'hazelcast' using the image 'confluentinc/cp-kafka' and allow the container to expose port 8083. | Command:
```bash
kubectl run hazelcast --image=confluentinc/cp-kafka --port=8083
```
What it does:
Create and run a particular image in a pod.
Syntax:
`kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...]`
Helpful flag... |
Create a service for the replication controller specified in the "alpine-controller.yaml" file | Command:
```bash
kubectl expose -f alpine-controller.yaml --port=9092 --target-port=808300
```
What it does:
Expose a resource as a new Kubernetes service.
Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the... |
Import the specific keys "log_level" from a config map to the environment variables of the deployment "scheduler-app-deployment" | Command:
```bash
kubectl set env --keys=log_level --from=configmap/env-vars deployment/scheduler-app-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions i... |
Update the image version (tag) of a single-container pod to v4 | Command:
```bash
kubectl get pod frontend-pod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
```
What it does:
Replace a resource by file name or stdin.
JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by
$ ... |
Create a service for the replicated nginx resource, serving on port 7000, and connecting to the containers on port 500100. | Command:
```bash
kubectl expose rc nginx --port=7000 --target-port=500100
```
What it does:
Expose a resource as a new Kubernetes service.
Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the specified port. ... |
Start port forwarding from local port 8000 to port 8080 in the frontend-pod | Command:
```bash
kubectl port-forward pod/frontend-pod 8000 8080
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will be selected autom... |
Get the output from running the command 'apache2ctl -D FOREGROUND' in the 'astro-container' within the 'auth-service-pod' pod | Command:
```bash
kubectl exec auth-service-pod -c astro-container -- apache2ctl -D FOREGROUND
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Containe... |
Create a service for the replication controller defined in the "php-controller.yaml" file | Command:
```bash
kubectl expose -f php-controller.yaml --port=80 --target-port=300100
```
What it does:
Expose a resource as a new Kubernetes service.
Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the spec... |
Start streaming the logs of the "nano-bot" container in the "log-aggregator-pod" pod. | Command:
```bash
kubectl logs -f -c nano-bot log-aggregator-pod
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "--container", "... |
Copy the file /tmp/foo from the pod named "security-scanner-pod-18" in the "ingress-nginx" namespace to your local machine and save it as /tmp/bar. | Command:
```bash
kubectl cp ingress-nginx/security-scanner-pod-18:/tmp/foo /tmp/bar
```
What it does:
Copy files and directories to and from containers.
Syntax:
`kubectl cp <file-spec-src> <file-spec-dest>`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use ... |
Get the output from running the 'geth' command in the 'stardust-shuttle' container of the 'web-app-pod' pod. | Command:
```bash
kubectl exec web-app-pod -c stardust-shuttle -- geth
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use ... |
Create a deployment named 'web' using the wordpress image, and expose port 8089 | Command:
```bash
kubectl create deployment web --image=wordpress --port=8089
```
What it does:
Create a deployment with the specified name.
Syntax:
`kubectl create deployment NAME --image=image -- [COMMAND] [args...]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of: j... |
Forward traffic from port 8080 on all addresses to port 6379 in the pod named "log-aggregator-pod" | Command:
```bash
kubectl port-forward --address 0.0.0.0 pod/log-aggregator-pod 8080:6379
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a po... |
Create a job named 'backup' using the 'node' image, and execute the 'node' command. | Command:
```bash
kubectl create job backup --image=node -- node
```
What it does:
Create a job with the specified name.
Syntax:
`kubectl create job NAME --image=image [--from=cronjob/name] -- [COMMAND] [args...]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of: json|y... |
Delete the pods and services with the names "foo" and "payment" | Command:
```bash
kubectl delete pod,service foo payment
```
What it does:
Delete resources by file names, stdin, resources and names, or by resources and label selector.
JSON and YAML formats are accepted. Only one type of argument may be specified: file names, resources and names, or resources and label selector.
Som... |
Import specific keys from a config map to a deployment's environment variables. | Command:
```bash
kubectl set env --keys=max_connections --from=configmap/log-config deployment/backend-microservice-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variabl... |
Copy the "_dir" directory from the service account secrets to the "/etc/kubernetes_dir" directory in the "admin-dashboard-pod-16" pod in the default namespace. | Command:
```bash
kubectl cp /var/run/secrets/kubernetes.io/serviceaccount/_dir admin-dashboard-pod-16:/etc/kubernetes_dir
```
What it does:
Copy files and directories to and from containers.
Syntax:
`kubectl cp <file-spec-src> <file-spec-dest>`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usa... |
Create a pod with the name 'hazelcast' using the image mcr.microsoft.com/dotnet/core/runtime and expose port 9091. | Command:
```bash
kubectl run hazelcast --image=mcr.microsoft.com/dotnet/core/runtime --port=9091
```
What it does:
Create and run a particular image in a pod.
Syntax:
`kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...... |
Forward traffic from port 9090 on all addresses to port 8000 in the pod named "analytics-pod" | Command:
```bash
kubectl port-forward --address 0.0.0.0 pod/analytics-pod 9090:8000
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod wil... |
Listen on ports 5000 and 6379 locally, forwarding data to/from ports 6379 and 6000 in a pod selected by the email-server-deployment deployment | Command:
```bash
kubectl port-forward deployment/email-server-deployment 5000 6379
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will... |
Display the last 23 lines of logs from the payment-gateway-pod pod. | Command:
```bash
kubectl logs --tail=23 payment-gateway-pod
```
What it does:
Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.
Syntax:
`kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]`
Helpful flags:
"flag": "--container", "shor... |
Create a new config map named app-settings using the configurations found in the "path/to/configurations" folder. | Command:
```bash
kubectl create configmap app-settings --from-file=path/to/configurations
```
What it does:
Create a config map based on a file, directory, or specified literal value.
A single config map may package one or more key/value pairs.
When creating a config map based on a file, the key will default to the ba... |
Copy a directory from a remote pod to your local machine | Command:
```bash
kubectl cp istio-system/task-processor-pod-17:/tmp/foo_dir :/tmp/bar
```
What it does:
Copy files and directories to and from containers.
Syntax:
`kubectl cp <file-spec-src> <file-spec-dest>`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, us... |
Remove all taints with key 'app' from node 'db-node-7' | Command:
```bash
kubectl taint nodes db-node-7 app-
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of: json|yaml|name|go... |
Create a new ClusterIP service named shipping-service-clusterip with TCP port mapping from local port 5432 to target port 8080. | Command:
```bash
kubectl create service clusterip shipping-service-clusterip --tcp=5432:8080
```
What it does:
Create a ClusterIP service with the specified name.
Syntax:
`kubectl create service clusterip NAME [--tcp=<port>:<targetPort>] [--dry-run=server|client|none]`
Helpful flags:
"flag": "--output", "short": "-o... |
Create a deployment called "nats" using the "golang" image with 7 replicas. | Command:
```bash
kubectl create deployment nats --image=golang --replicas=7
```
What it does:
Create a deployment with the specified name.
Syntax:
`kubectl create deployment NAME --image=image -- [COMMAND] [args...]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of: js... |
Add a taint with the key 'datacenter' and value 'gpu-node-12:PreferNoSchedule' on nodes having the label owner=john-doe. | Command:
```bash
kubectl taint node -l owner=john-doe datacenter=gpu-node-12:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage"... |
Check if you have permission to list the job named "security-scan-job" in the "kube-system" namespace | Command:
```bash
kubectl auth can-i list jobs.batch/security-scan-job -n kube-system
```
What it does:
Check whether an action is allowed.
VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. NONRESOURCEURL is a partial ... |
Create an ingress called 'myapp-ingress' that directs requests from foo.com/input to the service svc1:8010 with the tls secret "my-cert" | Command:
```bash
kubectl create ingress myapp-ingress --rule="foo.com/input=svc1:8010,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": ... |
Open the 'scheduler-service' service for editing using the 'notepad' editor as an alternative editor. | Command:
```bash
KUBE_EDITOR="notepad" kubectl edit svc/scheduler-service
```
What it does:
Edit a resource from the default editor.
The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment vari... |
Create a new config map named app-config using the key=value pairs found in the file at path/to/data. | Command:
```bash
kubectl create configmap app-config --from-file=path/to/data
```
What it does:
Create a config map based on a file, directory, or specified literal value.
A single config map may package one or more key/value pairs.
When creating a config map based on a file, the key will default to the basename of th... |
Forward local port 8888 to pod/api-service-pod port 5000 | Command:
```bash
kubectl port-forward pod/api-service-pod 8888 5000
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod will be selected au... |
import the LOG_LEVEL key from the app-config ConfigMap and set it as an environment variable in the payment-processor-deployment deployment | Command:
```bash
kubectl set env --keys=LOG_LEVEL --from=configmap/app-config deployment/payment-processor-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definit... |
Create a secret named jwt-secret and use files from the folder 'path/to/profiles' | Command:
```bash
kubectl create secret generic jwt-secret --from-file=path/to/profiles
```
What it does:
Create a secret based on a file, directory, or specified literal value.
A single secret may package one or more key/value pairs.
When creating a secret based on a file, the key will default to the basename of the f... |
Add environment variables to a deployment using values from a config map with a specific prefix | Command:
```bash
kubectl set env --from=configmap/namespace-config --prefix=MYSQL_ deployment/frontend-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions... |
Apply a taint with the key 'zone' of 'PreferNoSchedule' on nodes that have the label 'component=proxy'. | Command:
```bash
kubectl taint node -l component=proxy zone=edge-node-10:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "O... |
Create a copy of the 'web-app-pod' pod with a debug container, changing the container images | Command:
```bash
kubectl debug web-app-pod -it --copy-to=dgb-img --image=debian --set-image=app=app:debug,logger=logging-app:debug
```
What it does:
Debug cluster resources using interactive debugging containers.
'debug' provides automation for common debugging tasks for cluster objects identified by resource and name... |
Roll back the daemonset "my-deployment" to revision 5. | Command:
```bash
kubectl rollout undo daemonset/my-deployment --to-revision=5
```
What it does:
Roll back to a previous rollout.
Syntax:
`kubectl rollout undo (TYPE NAME | TYPE/NAME) [flags]`
Helpful flags:
"flag": "--filename", "short": "-f", "default": "[]", "usage": "Filename, directory, or URL to files identifyi... |
Update the label of the pod 'backend' to 'release=v2.0' | Command:
```bash
kubectl label pods backend release=v2.0
```
What it does:
Update the labels on a resource.
Syntax:
`kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]`
Helpful flags:
"flag": "--all-namespaces", "short": "-A", "default": "false", "usage": "... |
Create a deployment named "app" that runs the "wordpress" image with 5 replicas. | Command:
```bash
kubectl create deployment app --image=wordpress --replicas=5
```
What it does:
Create a deployment with the specified name.
Syntax:
`kubectl create deployment NAME --image=image -- [COMMAND] [args...]`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Output format. One of: ... |
Import the environment variables from the 'docker-registry-secret' secret and set them on the 'mydeployment' deployment. | Command:
```bash
kubectl set env --from=secret/docker-registry-secret deployment/mydeployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod ... |
Set the service account of the deployment "authentication-service-deployment" to "elasticsearch" | Command:
```bash
kubectl set serviceaccount deployment authentication-service-deployment elasticsearch
```
What it does:
Update the service account of pod template resources.
Possible resources (case insensitive) can be:
replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset... |
View the YAML configuration of a specific pod | Command:
```bash
kubectl get -o yaml pod api-service-pod
```
What it does:
Display one or many resources.
Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see ... |
Forward traffic from port 9090 on your local machine to port 5000 on a pod selected by the 'search-engine-deployment' deployment. | Command:
```bash
kubectl port-forward deployment/search-engine-deployment 9090 5000
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, a pod wil... |
Label the 'analytics' pod with the label 'release' and set the value to 'v2.0' | Command:
```bash
kubectl label pods analytics release=v2.0
```
What it does:
Update the labels on a resource.
Syntax:
`kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]`
Helpful flags:
"flag": "--all-namespaces", "short": "-A", "default": "false", "usage":... |
import specific keys from a config map for a deployment | Command:
```bash
kubectl set env --keys=my-example-key --from=configmap/app-settings deployment/notification-handler-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variab... |
Forward local port 6379 to port 9090 in a pod selected by the authentication-service-deployment deployment | Command:
```bash
kubectl port-forward deployment/authentication-service-deployment 6379 9090
```
What it does:
Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
If there are multiple pods matching the criteria, ... |
Set the python container CPU limits to "10" and memory to "256Mi" in the deployment named "python". | Command:
```bash
kubectl set resources deployment python -c=nginx --limits=cpu=10,memory=256Mi
```
What it does:
Specify compute resource requirements (CPU, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to ... |
execute the 'wp' command in the 'cosmic-container' of the pod 'database-pod' and obtain the output | Command:
```bash
kubectl exec database-pod -c cosmic-container -- wp
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use t... |
Execute the 'bash' command in the 'api-service-pod' pod and display the output. By default, it will use the first container. | Command:
```bash
kubectl exec api-service-pod -- bash
```
What it does:
Execute a command in a container.
Syntax:
`kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]`
Helpful flags:
"flag": "--container", "short": "-c", "default": "", "usage": "Container name. If omitted, use the kubectl.kube... |
Create a new ExternalName service named 'external-database-service' with the external address 'sample-domain.net' | Command:
```bash
kubectl create service externalname external-database-service --external-name sample-domain.net
```
What it does:
Create an ExternalName service with the specified name.
ExternalName service references to an external DNS address instead of only pods, which will allow application authors to reference s... |
Add a taint with the key 'disktype' and value 'storage-node-13:PreferNoSchedule' on nodes that have the label 'release=beta' | Command:
```bash
kubectl taint node -l release=beta disktype=storage-node-13:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage"... |
Import the DATABASE_URL key from the kube-system-config config map and set it as an environment variable in the load-balancer-deployment deployment. | Command:
```bash
kubectl set env --keys=DATABASE_URL --from=configmap/kube-system-config deployment/load-balancer-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable ... |
Create a new config map named api-config with specified keys instead of file basenames on disk | Command:
```bash
kubectl create configmap api-config --from-file=conf=/path/to/parameters/file1.txt --from-file=data=/path/to/data/file2.txt
```
What it does:
Create a config map based on a file, directory, or specified literal value.
A single config map may package one or more key/value pairs.
When creating a config ... |
Start a Redis pod and expose port 27017 | Command:
```bash
kubectl run hazelcast --image=redis --port=27017
```
What it does:
Create and run a particular image in a pod.
Syntax:
`kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...]`
Helpful flags:
"flag": "--f... |
Update the pod 'analytics' by adding the label 'unhealthy' with the value 'true' | Command:
```bash
kubectl label pods analytics unhealthy=true
```
What it does:
Update the labels on a resource.
Syntax:
`kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]`
Helpful flags:
"flag": "--all-namespaces", "short": "-A", "default": "false", "usage... |
Add a taint with key 'special' on nodes having label app=web-app | Command:
```bash
kubectl taint node -l app=web-app special=edge-node-10:PreferNoSchedule
```
What it does:
Update the taints on one or more nodes.
Syntax:
`kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N`
Helpful flags:
"flag": "--output", "short": "-o", "default": "", "usage": "Ou... |
Create an ingress resource named 'public-service-ingress' with a rule that directs requests from website.com/input to a service named svc1 on port 8080 | Command:
```bash
kubectl create ingress public-service-ingress --rule="website.com/input=svc1:8080,tls=my-cert"
```
What it does:
Create an ingress with the specified name.
Syntax:
`kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]]`
Helpful flags:
"flag": "--output", "short": "-o", "default": ... |
Import the 'debug_mode' key from the 'app-settings' config map and apply it to the 'email-server-deployment' deployment. | Command:
```bash
kubectl set env --keys=debug_mode --from=configmap/app-settings deployment/email-server-deployment
```
What it does:
Update environment variables on a pod template.
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.