github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-kube-apply.1.md (about) 1 % podman-kube-apply 1 2 3 ## NAME 4 podman-kube-apply - Apply Kubernetes YAML based on containers, pods, or volumes to a Kubernetes cluster 5 6 ## SYNOPSIS 7 **podman kube apply** [*options*] [*container...* | *pod...* | *volume...*] 8 9 ## DESCRIPTION 10 **podman kube apply** deploys a podman container, pod, or volume to a Kubernetes cluster. Use the `--file` option to deploy a Kubernetes YAML (v1 specification) to a Kubernetes cluster as well. 11 12 Note that the Kubernetes YAML file can be used to run the deployment in Podman via podman-play-kube(1). 13 14 ## OPTIONS 15 16 #### **--ca-cert-file**=*ca cert file path | "insecure"* 17 18 The path to the CA cert file for the Kubernetes cluster. Usually the kubeconfig has the CA cert file data and `generate kube` automatically picks that up if it is available in the kubeconfig. If no CA cert file data is available, set this to `insecure` to bypass the certificate verification. 19 20 #### **--file**, **-f**=*kube yaml filepath* 21 22 Path to the kubernetes yaml file to deploy onto the kubernetes cluster. This file can be generated using the `podman kube generate` command. The input may be in the form of a yaml file, or stdin. For stdin, use `--file=-`. 23 24 #### **--kubeconfig**, **-k**=*kubeconfig filepath* 25 26 Path to the kubeconfig file to be used when deploying the generated kube yaml to the Kubernetes cluster. The environment variable `KUBECONFIG` can be used to set the path for the kubeconfig file as well. 27 Note: A kubeconfig can have multiple cluster configurations, but `kube generate` always picks the first cluster configuration in the given kubeconfig. 28 29 #### **--ns**=*namespace* 30 31 The namespace or project to deploy the workloads of the generated kube yaml to in the Kubernetes cluster. 32 33 #### **--service**, **-s** 34 35 Used to create a service for the corresponding container or pod being deployed to the cluster. In particular, if the container or pod has portmap bindings, the service specification includes a NodePort declaration to expose the service. A random port is assigned by Podman in the service specification that is deployed to the cluster. 36 37 ## EXAMPLES 38 39 Apply a podman volume and container to the "default" namespace in a Kubernetes cluster. 40 ``` 41 $ podman kube apply --kubeconfig /tmp/kubeconfig myvol vol-test-1 42 Deploying to cluster... 43 Successfully deployed workloads to cluster! 44 $ kubectl get pods 45 NAME READY STATUS RESTARTS AGE 46 vol-test-1-pod 1/1 Running 0 9m 47 ``` 48 49 Apply a Kubernetes YAML file to the "default" namespace in a Kubernetes cluster. 50 ``` 51 $ podman kube apply --kubeconfig /tmp/kubeconfig -f vol.yaml 52 Deploying to cluster... 53 Successfully deployed workloads to cluster! 54 $ kubectl get pods 55 NAME READY STATUS RESTARTS AGE 56 vol-test-2-pod 1/1 Running 0 9m 57 ``` 58 59 Apply a Kubernetes YAML file to the "test1" namespace in a Kubernetes cluster. 60 ``` 61 $ podman kube apply --kubeconfig /tmp/kubeconfig --ns test1 vol-test-3 62 Deploying to cluster... 63 Successfully deployed workloads to cluster! 64 $ kubectl get pods --namespace test1 65 NAME READY STATUS RESTARTS AGE 66 vol-test-3-pod 1/1 Running 0 9m 67 68 ``` 69 70 ## SEE ALSO 71 **[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **[podman-pod(1)](podman-pod.1.md)**, **[podman-kube-play(1)](podman-kube-play.1.md)**, **[podman-kube-generate(1)](podman-kube-generate.1.md)** 72 73 ## HISTORY 74 September 2022, Originally compiled by Urvashi Mohnani (umohnani at redhat dot com)