1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [exec](<https://delaparra-services.nl/knowledge-hub/exec>)

  

Category: Kubernetes 

# exec

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is exec?

 

exec: Run a command inside a running container — usually an interactive shell for debugging. ` kubectl exec ` runs a command inside a running container. ` kubectl exec -it web-7d9f8c -- sh ` opens an interactive shell, and ` kubectl exec deploy/web -- php artisan migrate ` runs a one-off command. It is the standard way to look inside a container when something is wrong: check a config file, test a database connection, or run a maintenance command.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about exec

  

### What should you keep in mind with exec?

 

Treat it as a diagnostic tool. Changes you make inside a container by hand are lost when the pod restarts, so real fixes belong in the image or the manifests. Many production images are minimal and have no shell at all, which is good for security. For those, ` kubectl debug ` can attach a temporary debugging container to the pod without changing the original image.

    

### What does an example of exec look like?

 

```
kubectl exec -it web-7d9f8c-abc12 -- sh
```

 

## At a glance

   CategoryKubernetes Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Kubernetes terms

 

- [describe](<https://delaparra-services.nl/knowledge-hub/describe>) 
- [edit](<https://delaparra-services.nl/knowledge-hub/edit>) 
- [emptyDir](<https://delaparra-services.nl/knowledge-hub/emptydir>) 
- [get](<https://delaparra-services.nl/knowledge-hub/get>) 
- [HPA (HorizontalPodAutoscaler)](<https://delaparra-services.nl/knowledge-hub/hpa-horizontalpodautoscaler>) 
- [Ingress](<https://delaparra-services.nl/knowledge-hub/ingress>)

 

[All terms starting with E](<https://delaparra-services.nl/knowledge-hub#letter-e>)

 

## Skills

 

- ### Kubernetes Manifest Generator

 

Create production-ready Kubernetes manifests for Deployments, Services, ConfigMaps, and Secrets following best practices and security standards. Use when generating Kubernetes YAML manifests, creating K8s resources, or implementing production-grade Kubernetes configurations.

 [View skill](<https://delaparra-services.nl/skills/k8s-manifest-generator>) [Download zip](<https://delaparra-services.nl/skills/k8s-manifest-generator/download>) 
- ### Helm Chart Scaffolding

 

Design, organize, and manage Helm charts for templating and packaging Kubernetes applications with reusable configurations. Use when creating Helm charts, packaging Kubernetes applications, or implementing templated deployments.

 [View skill](<https://delaparra-services.nl/skills/helm-chart-scaffolding>) [Download zip](<https://delaparra-services.nl/skills/helm-chart-scaffolding/download>) 
- ### GitOps Workflow

 

Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes deployments with continuous reconciliation. Use when implementing GitOps practices, automating Kubernetes deployments, or setting up declarative infrastructure management.

 [View skill](<https://delaparra-services.nl/skills/gitops-workflow>) [Download zip](<https://delaparra-services.nl/skills/gitops-workflow/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/exec/skills.zip>)

 

## Manuals

 

- [Kubernetes and Terraform: do you need them?](<https://delaparra-services.nl/manuals/kubernetes-en-terraform-heb-je-het-nodig>) 
- [Docker for your Laravel app](<https://delaparra-services.nl/manuals/docker-voor-je-laravel-app>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/exec)
