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

Install dashboard of kubernetes 1.6 under ubuntu 16.04

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In the previous two articles, we introduced the installation of kubernetes 1.6 in the ubuntu 16.04 environment. At this point, the master and minion side of kubernetes have been installed, and then we need to deploy some applications with kubernetes. This article takes kubernetes-dashboard as an example to introduce the application deployment of kubernetes.

In order to facilitate the experiment, we download the image we need on minion in advance.

Mirror with docker pull on minion

Docker pull huanwei/kubernetes-dashboard-amd64

First create a service file in yaml format for dashboard

Cat dashboard-svc.yaml

Kind: Service

ApiVersion: v1

Metadata:

Labels:

K8s-app: kubernetes-dashboard

Name: kubernetes-dashboard

Namespace: kube-system

Spec:

Type: NodePort

Ports:

-port: 80

TargetPort: 9090

NodePort: 1080

Selector:

K8s-app: kubernetes-dashboard

Create a rc file for dashboard, which is also in yaml format

Cat dashboard-rc.yaml

# Example usage: kubectl create-f

Kind: ReplicationController

ApiVersion: v1

Metadata:

Labels:

K8s-app: kubernetes-dashboard

Name: kubernetes-dashboard

Namespace: kube-system

Spec:

Replicas: 1

Selector:

K8s-app: kubernetes-dashboard

Template:

Metadata:

Labels:

K8s-app: kubernetes-dashboard

Spec:

Containers:

-name: kubernetes-dashboard

Image: huanwei/kubernetes-dashboard-amd64:latest

ImagePullPolicy: IfNotPresent

Ports:

-containerPort: 9090

Protocol: TCP

Args:

-apiserver-host= http://192.168.100.20:8080

LivenessProbe:

HttpGet:

Path: /

Port: 9090

InitialDelaySeconds: 30

TimeoutSeconds: 30

Create a kubernetes-dashboard service and then a kubernetes-dashboard RC (ReplicationController) with kubectl create-f dashboard-svc.yaml,kubectl create-f dashboard-rc.yaml.

Once created, you can use kubectl get pods-n kube-system to view the created pod, kubectl get svc-n kube-system to view the service, and kubectl get rc-n kube-system to view the created RC. Where-n kube-system indicates namespace, and the default is default.

As shown in the figure above, the red box is the created service,rc and pod

You can use kubectl get pods-n kube-system-o wide to see which node the pod starts from.

Because nodeport is bound in service, you can use nodeip:nodeport to access dashboard, as shown in the following figure

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

Servers

Wechat

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

12
Report