admin 管理员组文章数量: 887021
2024年1月17日发(作者:go语言高级教程)
[root@k8s-master01 ingress]# cat
apiVersion: v1kind: Servicemetadata: name: myapp namespace: defaultspec: selector: app: myapp release: canary ports: - name: http port: 80 targetPort: 80---apiVersion: apps/v1kind: Deploymentmetadata:
name: myapp-deployspec: replicas: 5 selector:
matchLabels: app: myapp release: canary template: metadata: labels: app: myapp release: canary spec: containers: - name: myapp image: ikubernetes/myapp:v2 ports: - name: httpd containerPort: 80
创建相关服务及检查状态是否就绪
[root@k8s-master ingress-nginx]# kubectl apply -f
service "myapp" "myapp-deploy" created[root@k8s-master ingress-nginx]# kubectl get podsNAME READY STATUS RESTARTS AGEmyapp-deploy-5cfd895984-ffzm5 1/1 Running 0 1mmyapp-deploy-5cfd895984-ftg9t 1/1 Running 0 1mmyapp-deploy-5cfd895984-jg887 1/1 Running 0 1mmyapp-deploy-5cfd895984-mk4jq 1/1 Running 0 1mmyapp-deploy-5cfd895984-nqz6s 1/1 Running 0 1mmyweb-hrfqm 1/1 Running 0 8dmyweb-pb5tb 1/1 Running 0 8dmyweb-xrk22 1/1 Running 0 8d[root@k8s-master ingress-nginx]# kubectl get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEkubernetes ClusterIP 10.96.0.1
版权声明:本文标题:kubernetes学习笔记之七:Ingress-nginx部署使用 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1705463541h485777.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论