Tasks
Create a pod named
pod-httpd
using thehttpd
image with thelatest
tag. Ensure to specify the tag ashttpd:latest
.Set the
app
label tohttpd_app
, and name the container ashttpd-container
.
Steps
Create a pod called
pod-httpd
using thehttpd
image with thelatest
tag, ensuring the tag is specified ashttpd:latest
.- Create a yaml file
cat > pod-httpd.yaml <<EOF
apiVersion: v1
kind: Pod
metadata:
name: pod-httpd
labels:
app: httpd_app
spec:
containers:
- name: httpd-container
image: httpd:latest
EOF
apiVersion: v1
kind: Pod
metadata:
name: pod-httpd
labels:
app: httpd_app
spec:
containers:
- name: httpd-container
image: httpd:latest
You can apply this configuration with this command.
kubectl apply -f pod-httpd.yaml
To ensure or check the create pods.
kubectl get pods
#k8s #pods #devops