Pods
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes. They are groups of one or more containers.
Requirements
To deploy a Kubernetes Pod the following requirements must be met:
- A namespace must be specified, and the user must be a member of the project to which the specified namespace is bound.
- Both resource and request limits must be specified unless the default values have been set in
field.cattle.io/containerDefaultResourceLimit
. See the Namespaces section. - The request limit (reservation) cannot be higher than the limit values.
- Enough resources must be available in the ICE Connect project quota.
An error message will be generated if any of the requirements above are not met.
Below is an example of a Pod YAML resource file:
testpod.yaml
apiVersion: v1
kind: Pod
metadata:
name: testpod
labels:
app: testapp
spec:
containers:
- name: bb
image: busybox
command: ["/bin/sh"]
args: ["-c", "while true; do date && sleep 1; done"]
resources:
requests:
memory: "128Mi"
cpu: "500m"
limits:
memory: "128Mi"
Remember to set your default namespace before continuing.
Deploy pod
This is also used to install other Kubernetes objects using YAML files
Show running
Logging
Read the standard output of the pod. The -f
option follows any new output.
Access shell
/ # uname -a
Linux testpod 4.15.0-193-generic #204-Ubuntu SMP Fri Aug 26 19:20:21 UTC 2022 x86_64 GNU/Linux
Port forward
To access a web server on the pod, running at port 80
Then open http://localhost:8080 with your web browser.