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

How to configure the Kubebox mode of Kubernetes

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

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to configure the Kubebox mode of Kubernetes". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to configure the Kubebox mode of Kubernetes" can help you solve your doubts.

Kubebox terminal mode

1. Start Kubebox

Start Kubebox on the Kubernetes Master node using Docker

Docker run-it-- rm-v ~ / .kube/:/home/node/.kube/:ro astefanutti/kubebox

2. Operate Namespace

[⬆️⬇️] Select Namespace, [enter] confirm selection, [n] evoke Namespace option again

3. Operate Pod

[⬆️⬇️] Select Pod, and [enter] confirm the selection, and the following information of Pod will be displayed:

[M key] memory

[C key] CPU

[t key] network

[click on the Logs box and scroll through the ⬆️⬇️] log

4. Operate the container

[mouse Click Pods box, ⬆️⬇️] Select the container, [r key] enter the container, and enter exit to exit the container.

5. Debug option

[⬅️➡️] switch between Namespace and Debug, or [2] enter the Debug tab. Some of your actions on Kubebox are recorded here, which is of little practical use.

Kubebox Web mode

Deploy the following resources in the Kubernetes cluster (for reference only):

# Create Service AccountapiVersion: v1kind: ServiceAccountmetadata: name: admin-user namespace: kube-system---# Create ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: admin-userroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-adminsubjects:-kind: ServiceAccount name: admin-user namespace: kube-system---# Deploy KubeboxapiVersion: apps/v1kind: Deploymentmetadata: name: kube-box namespace: kube-systemspec: strategy: type: Recreate selector: matchLabels : k8s-app: kube-box template: metadata: name: kube-box labels: k8s-app: kube-box spec: serviceAccountName: admin-user containers:-image: astefanutti/kubebox:server imagePullPolicy: Always name: kube-box ports:-containerPort: 8080 protocol: TCP---# Expose kubebox servicekind: ServiceapiVersion: v1metadata: Name: kube-box-service namespace: kube-systemspec: ports:-port: 8080 targetPort: 8080 nodePort: 30001 selector: k8s-app: kube-box type: NodePort

Visit http://:30001/ to enter the kubebox interface

common problem

1. Local Kubebox connects to remote Kubernetes cluster

Method ①: copy the directory ~ / .kube / under the Kubernetes Master node to the local directory ~ / .kube /, modify the IP of server in the config file to your local accessible IP address, and then execute docker run-it-- rm-v ~ / .kube/:/home/node/.kube/:ro astefanutti/kubebox

②: execute docker run-it-rm astefanutti/kubebox to enter the login page and enter the correct user information.

After reading this, the article "how to configure the Kubebox mode of Kubernetes" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

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