k8s-07-Test Demo k8s

Source: Internet
Author: User
Tags k8s

Kubectl Run Nginx--image=nginx--replicas=3
[[email protected] ~]# Kubectl get pod-o Wide
NAME ready STATUS Restarts IP NODE
NGINX-8586CF59-C5QPW 1/1 Running 0 8m 172.17.96.2 192.168.56.12
nginx-8586cf59-lm85p 1/1 Running 0 8m 172.17.2.2 192.168.56.11
NGINX-8586CF59-N58BM 1/1 Running 0 8m 172.17.96.3 192.168.56.12
[[email protected] ~]# kubectl get pod
NAME Ready STATUS Restarts
NGINX-8586CF59-C5QPW 1/1 Running 0 8m
nginx-8586cf59-lm85p 1/1 Running 0 8m
NGINX-8586CF59-N58BM 1/1 Running 0 8m
[Email protected] ~]#

[[email protected] ~]# Kubectl Get Service
NAME TYPE cluster-ip external-ip PORT (S) Age
Kubernetes clusterip 10.10.10.1 <none> 443/tcp 3h
[Email protected] ~]# kubectl expose deployment Nginx--port=88--target-port=80--type=nodeport
Service "Nginx" exposed
[[email protected] ~]# Kubectl Get Service
NAME TYPE cluster-ip external-ip PORT (S) Age
Kubernetes clusterip 10.10.10.1 <none> 443/tcp 3h
Nginx nodeport 10.10.10.86 <none> 88:35712/tcp 2s
[[email protected] ~]# Kubectl Get service Nginx
NAME TYPE cluster-ip external-ip PORT (S) Age
Nginx nodeport 10.10.10.86 <none> 88:35712/tcp 21s
[Email protected] ~]#

Node nodes test


k8s-07-Test Demo k8s

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.