Starting a Kubernetes Video Stream Cloud Phone
Perform the following operations on the master node.
- Modify the k8s-video.yaml file.
1 2
cd /home/k8s/k8s/script vi k8s-video.yaml
Change the following fields to the actual values:
- spec.containers.image: video stream image. Enter the name of the video stream image imported to the worker node.
- spec.containers.resources.limits.cpu and spec.containers.resources.requests.cpu: number of cores to be bound to containers. The two fields need to be modified together.
- spec.containers.resources.limits.memory and spec.containers.resources.requests.memory: container memory. The two fields need to be modified together.
- Start a Kubernetes video stream cloud phone.
1./k8s-video.sh start ${index1} ${index2}
${index1} and ${index2} indicate Pod IDs, and ${index2} can be left blank. Example:
- Create a Pod video2.
./k8s-video.sh start 2
- Create five Pods from video1 to video5.
./k8s-video.sh start 1 5
- Create a Pod video2.
- Check whether the Pods are successfully started.
1kubectl get pods -o wide
It is expected that the STATUS column of Pods whose names start with video is Running.
- Connect to the video stream cloud phone and container. In the NODE column, you can view the node corresponding to the Pod of the video stream cloud phone.
1kubectl get pods -o wide
Access the video stream cloud phone based on Accessing a Video Stream Cloud Phone. The client connection port is 8000 + ${index}, where ${index} indicates the Pod ID.
- On the master node, you can run the following command to access the container. The following uses video1 as an example:
1kubectl exec -it video1 -- sh
- On the worker node, you can run the crictl ps command to view the cloud phone instance. The corresponding Pod is displayed in the NAME field. Run the following command to access the container. ${CONTAINER} is the first column in the output of the crictl ps command.
1crictl exec -it ${CONTAINER} sh
- On the master node, you can run the following command to access the container. The following uses video1 as an example:
Parent topic: Starting a Video Stream Cloud Phone