Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of installing and running nginx in kubernetes minikube

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Kubernetes minikube installation and running nginx example analysis, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

1. Referenc

Install minikube

Solution to installation failure due to network problems in China

Hello-minikube

2.minikube installation

References 1, 2

2.1 problems encountered

Failed to download minikube-v1.3.0.iso file. Copy the file to the ~ / .minikube / cache/iso directory after manual download

Due to network problems in China, the relevant containers of google cannot be downloaded. You can use the-- image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers parameter to create a kubernetes cluster, that is, minikube start-- image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers.

3. Use 3.1to create and view Pod

NginxPod.yaml:

ApiVersion: v1kind: Podmetadata: name: nginx labels: app: nginxspec: containers:-image: nginx name: nginx ports:-containerPort: 80

Create Pod

Kubectl create-f nginxPod.yaml > > pod/nginx created

View Pod

Kubectl get pod > > NAME READY STATUS RESTARTS AGE nginx 1 Running 1 Running 0 5m31s3.2 create Service

NginxService.yml:

ApiVersion: v1kind: Servicemetadata: name: nginxspec: type: LoadBalancer ports:-port: 80 targetPort: 80 selector: app: nginx

Create Service

Kubectl create-f nginxService.yaml > > service/nginx created

View Service

Kubectl get pod > > NAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEkubernetes ClusterIP 10.96.0.1 443/TCP 6h49mnginx LoadBalancer 10.103.218.102 80:30521/TCP 8m23s3.3 access Service

On cloud providers that support load balancers, an external IP address will be configured to access the service. On Minikube, the LoadBalancer type makes the service accessible through the minikube service command.

Minikube:

Minikube service nginxService

Or access it directly through the host IP: Port, such as http://192.168.99.100:30521

3.4 dashboard usage

Running the following command automatically opens the browser to the management interface

Minikube dashboard on the installation of kubernetes minikube and running nginx instance analysis questions to share here, I hope the above content can be of some help to you, if you still have a lot of doubts to solve, you can follow the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report