/opt/outputs/nodes-z3444kd9.json
.kubectl get nodes -o json > /opt/outputs/nodes-z3444kd9.json
messaging-service
to expose the messaging
application within the cluster on port 6379
. Use imperative commands.kubectl expose pod messaging --port=6379 --name messaging-service
finance
namespace named temp-bus
with the image redis:alpine
.kubectl run temp-bus --image=redis:alpine --namespace=finance --restart=Never
orange
is deployed. There is something wrong with it. Identify and fix the issue.orange
pod:$ kubectl describe po orange
and look under the initContainers
section. There is an issue with the given command. To update the pod with an easiest way by running command:$ kubectl edit po orange
It's not possible to update the changes in the running pod so after saving the changes. It will create a temporary file in the default location /tmp/
. Use that manifest file and replace with the existing pod:$ kubectl replace -f /tmp/kubectl-edit-xxxx.yaml --force
Above command will delete the existing pod and will recreate the new pod with latest changes.hr-web-app
as service hr-web-app-service
application on port 30082
on the nodes on the cluster. The web application listens on port 8080
.kubectl expose deployment hr-web-app --type=NodePort --port=8080 --name=hr-web-app-service --dry-run=client -o yaml > hr-web-app-service.yaml
to generate a service definition file.Now, in generated service definition file add the nodePort
field with the given port number under the ports
section and create a service.osImage
s of all the nodes and store it in a file /opt/outputs/nodes_os_x43kj56.txt
. The osImages
are under the nodeInfo
section under status
of each node.kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.osImage}' > /opt/outputs/nodes_os_x43kj56.txt