In a kubernetes cluster we can create a workload and expose it in two separate commands.
- kubectl run deployment-name --image=imagename
- kubectl expose deployment deployment-name [--port=port --type=type --name=name]
Could we do it in one command?
In a kubernetes cluster we can create a workload and expose it in two separate commands.
Could we do it in one command?
Copyright © 2021 Jogjafile Inc.
This could be achieved by the below command. It will create a workload and also expose it in same time.
kubectl run nginx-digital --image=nginx --expose=true --port=80
The above command will create a deployment nginx-digital and also expose it with ClusterIP service with name nginx-digital at port 80.