溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

k8s用戶界面k8s-manager的本質(zhì)及如何進(jìn)行部署

發(fā)布時(shí)間:2021-10-12 09:27:50 來源:億速云 閱讀:199 作者:柒染 欄目:云計(jì)算

k8s用戶界面k8s-manager的本質(zhì)及如何進(jìn)行部署,相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

k8s用戶界面——k8s-manager

1、k8s-manager簡介:

①、k8s-manager是一個(gè)基于瀏覽器的接口Kubernetes API,功能同kubectl。

②、當(dāng)前版本和官方的kube-dashboard,但不是一個(gè)等級

③、k8s-manager鏡像有200M左右,有點(diǎn)大,登陸進(jìn)去,運(yùn)行的是nginx服務(wù),nginx配置文件:/etc/nginx/sites-enabled/default,主目錄:/var/www

④、web界面只能查看namespace、events、nodes等簡單信息

⑤、Resource Quotas功能,未開通,期待

⑥、僅供學(xué)習(xí)擴(kuò)展

2、部署:

①、下載鏡像:

docker pull mlamina/k8s-manager:latest

    看下載過程,發(fā)現(xiàn)這個(gè)鏡像在build的時(shí)候,有很多RUN

[root@localhost kube-1.2]# docker pull mlamina/k8s-manager:latest

Trying to pull repository docker.io/mlamina/k8s-manager ... latest: Pulling from mlamina/k8s-manager

cacc99976415: Pull complete

5b66679e02f4: Pull complete

1f8c9c887b89: Pull complete

f0dc6e5bff03: Pull complete

9dcf5abc367e: Pull complete

9fffafe11022: Pull complete

ca36392ac8a5: Pull complete

d26280472f7d: Pull complete

32e3fac5657a: Pull complete

3972aa49a3e3: Pull complete

4caa999e314e: Pull complete

1a2d1ead0644: Pull complete

2a06190131f5: Pull complete

104b4e83cb1b: Pull complete

2db0330dd6ee: Pull complete

af5842bf4830: Pull complete

d47dfdd163f1: Pull complete

d84ad8831181: Pull complete

dd66db5193b6: Pull complete

67fc7feb5c34: Pull complete

3cead704ab86: Pull complete

22b28de9f034: Already exists

Digest: sha256:53e80dcc60a6b23169025f323bcf85a6f5518ab1a973a8e3d294cc81e5ee0017

Status: Downloaded newer image for docker.io/mlamina/k8s-manager:latest

②、創(chuàng)建Namespace:

#創(chuàng)建namespace

[1065][root@www : kube-1.2]# cat kube-system.json

{

  "kind": "Namespace",

  "apiVersion": "v1",

  "metadata": {

    "name": "kube-system"

  }

}

[1066][root@www : kube-1.2]#

[1066][root@www : kube-1.2]# kubectl create -f kube-system.json

namespace "kube-system" created

[1067][root@www : kube-1.2]#

③、創(chuàng)建k8s-manager副本及pod:

[1069][root@www: kube-1.2]# cat k8s-manager-rc.yml

apiVersion: v1

kind: ReplicationController

metadata:

  name: k8s-manager

  namespace: kube-system

  labels:

    app: k8s-manager

spec:

  replicas: 1

  selector:

    app: k8s-manager

  template:

    metadata:

      labels:

        app: k8s-manager

    spec:

      containers:

        - image: docker.io/mlamina/k8s-manager:latest

          name: k8s-manager

          resources:

            limits:

              cpu: 100m

              memory: 50Mi

          ports:

            - containerPort: 80

              name: http

[1070][root@www: kube-1.2]#

[1070][root@www: kube-1.2]# kubectl create -f k8s-manager-rc.yml

replicationcontroller "k8s-manager" created

[1071][root@www: kube-1.2]#

[1072][root@www: kube-1.2]# kubectl get pods --all-namespaces

NAMESPACE     NAME                READY     STATUS              RESTARTS   AGE

kube-system   k8s-manager-3ry8b   0/1       ContainerCreating   0          15s

[1072][root@www: kube-1.2]#

[1073][root@www: kube-1.2]# /usr/bin/kubectl describe pod  k8s-manager-3ry8b --namespace=kube-system

Name:           k8s-manager-3ry8b

Namespace:      kube-system

Node:           192.168.16.234/192.168.16.234

Start Time:     Wed, 29 Jun 2016 14:16:30 +0800

Labels:         app=k8s-manager

Status:         Running

IP:             172.22.3.2

Controllers:    ReplicationController/k8s-manager

Containers:

  k8s-manager:

    Container ID:       docker://54cdc0e3727ef91c9d32560fa8c16ec06b4371d33e0a38bfe36a2938c2324195

    Image:              docker.io/mlamina/k8s-manager:latest

    Image ID:           docker://22b28de9f0345b9add9bae73ea191a7441783ecfc3a4f0a68abec8dc3ee803ef

    Port:               80/TCP

    QoS Tier:

      memory:   Guaranteed

      cpu:      Guaranteed

    Limits:

      cpu:      100m

      memory:   50Mi

    Requests:

      cpu:              100m

      memory:           50Mi

    State:              Running

      Started:          Wed, 29 Jun 2016 14:16:50 +0800

    Ready:              True

    Restart Count:      0

    Environment Variables:

Conditions:

  Type          Status

  Ready         True

Volumes:

  default-token-pu9pf:

    Type:       Secret (a volume populated by a Secret)

    SecretName: default-token-pu9pf

Events:

  FirstSeen     LastSeen        Count   From                            SubobjectPath                   Type            Reason          Message

  ---------     --------        -----   ----                            -------------                   --------        ------          -------

  52s           52s             1       {kubelet 192.168.16.234}        spec.containers{k8s-manager}    Normal          Pulling         pulling image "docker.io/mlamina/k8s-manager:latest"

  47s           47s             1       {default-scheduler }                                            Normal          Scheduled       Successfully assigned k8s-manager-3ry8b to 192.168.16.234

  37s           37s             1       {kubelet 192.168.16.234}        spec.containers{k8s-manager}    Normal          Pulled          Successfully pulled image "docker.io/mlamina/k8s-manager:latest"

  36s           36s             1       {kubelet 192.168.16.234}        spec.containers{k8s-manager}    Normal          Created         Created container with docker id 54cdc0e3727e

  35s           35s             1       {kubelet 192.168.16.234}        spec.containers{k8s-manager}    Normal          Started         Started container with docker id 54cdc0e3727e

 

 

[1074][root@www: kube-1.2]#

[1074][root@www: kube-1.2]# kubectl get pods --all-namespaces                

NAMESPACE     NAME                READY     STATUS    RESTARTS   AGE

kube-system   k8s-manager-3ry8b   1/1       Running   0          53s

[1075][root@www: kube-1.2]#

 

④、創(chuàng)建service:

[1075][root@www: kube-1.2]# cat k8s-manager-svc.yml

apiVersion: v1

kind: Service

metadata:

  name: k8s-manager

  namespace: kube-system

  labels:

    app: k8s-manager

spec:

  ports:

    - port: 80

      targetPort: http

  selector:

    app: k8s-manager

[1076][root@www: kube-1.2]#

[1076][root@www: kube-1.2]# kubectl create -f k8s-manager-svc.yml 

service "k8s-manager" created

[1077][root@www: kube-1.2]#

[1077][root@www: kube-1.2]#

[1077][root@www: kube-1.2]# kubectl get services --all-namespaces

NAMESPACE     NAME          CLUSTER-IP    EXTERNAL-IP   PORT(S)   AGE

default       kubernetes    10.1.0.1      <none>        443/TCP   8m

kube-system   k8s-manager   10.1.65.137   <none>        80/TCP    4s

[1078][root@www: kube-1.2]#

3、k8s-manager界面介紹:

    訪問web:

http://192.168.16.100:8080/api/v1/proxy/namespaces/kube-system/services/k8s-manager/

    官網(wǎng)上是用https的,但不行,無所謂了

k8s用戶界面k8s-manager的本質(zhì)及如何進(jìn)行部署

看完上述內(nèi)容,你們掌握k8s用戶界面k8s-manager的本質(zhì)及如何進(jìn)行部署的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

k8s
AI