瀏覽代碼

Merge branch 'main' of github.com:zilliztech/attu into dev

nameczz 3 年之前
父節點
當前提交
c1cfa12bb8

+ 60 - 0
attu-k8s-deploy.yaml

@@ -0,0 +1,60 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: my-attu-svc
+  labels:
+    app: attu
+spec:
+  type: ClusterIP
+  ports:
+  - name: attu
+    protocol: TCP
+    port: 3000
+    targetPort: 3000
+  selector:
+    app: attu
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: my-attu-ingress
+spec:
+  rules:
+  - host: my-attu.local
+    http:
+      paths:
+        - path: /
+          pathType: Prefix
+          backend:
+            service:
+              name: my-attu-svc
+              port:
+                number: 3000
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: my-attu
+  labels:
+    app: attu
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: attu
+  template:
+    metadata:
+      labels:
+        app: attu
+    spec:
+      containers:
+      - name: attu
+        image: zilliz/attu:latest
+        imagePullPolicy: Always
+        ports:
+        - name: attu
+          containerPort: 3000
+          protocol: TCP
+        env:
+        - name: HOST_URL
+          value: http://my-attu.local

+ 8 - 0
client/src/pages/schema/Types.ts

@@ -85,3 +85,11 @@ export interface SizingInfoParam {
     disk: string;
   } | null;
 }
+
+export enum SIZE_STATUS {
+  'B' = 1,
+  'KB' = 2,
+  'MB' = 3,
+  'GB' = 4,
+  'TB' = 5,
+}

+ 4 - 11
client/src/utils/SizingTool.ts

@@ -1,4 +1,4 @@
-import { INDEX_TYPES_ENUM } from '../pages/schema/Types';
+import { INDEX_TYPES_ENUM, SIZE_STATUS } from '../pages/schema/Types';
 
 const commonValueCalculator = (
   vector: number,
@@ -117,21 +117,14 @@ export const computMilvusRecommonds = (
 };
 
 export const formatSize = (size: number) => {
+  // 1:B, 2:KB, 3:MB, 4:GB, 5:TB
   let sizeStatus = 1;
   let status = 'BYTE';
-  while (sizeStatus < 4 && size > 4096) {
+  while (sizeStatus < 4 && size > 1024) {
     size = size / 1024;
     sizeStatus++;
   }
-  sizeStatus === 2
-    ? (status = 'KB')
-    : sizeStatus === 3
-    ? (status = 'MB')
-    : sizeStatus === 4
-    ? (status = 'GB')
-    : sizeStatus === 5
-    ? (status = 'TB')
-    : (status = 'KB');
+  status = SIZE_STATUS[sizeStatus] ?? 'KB';
 
   size = Math.ceil(size);
 

+ 57 - 0
doc/en/attu_install-kubernetes.md

@@ -0,0 +1,57 @@
+---
+id: attu_install-kubernetes.md
+label: Install attu with Kubernetes
+order: 2
+group: attu
+related_key: attu
+summary: Learn how to install Attu with Kubernetes to manage your Milvus service.
+
+---
+
+# Install Attu
+
+This topic describes how to install Attu with Kubernetes, an efficient open-source management tool for Milvus.
+
+{{tab}}
+
+## Prerequisites
+
+- Milvus installed on [your local device](https://github.com/zilliztech/attu/blob/main/doc/en/install_standalone-docker.md) or [cluster](https://github.com/zilliztech/attu/blob/main/doc/en/install_cluster-docker.md).
+- Kubernetes 1.16 or later
+- Ingress Controllers
+
+<div class="alert note">
+Attu only supports Milvus 2.x.
+</div>
+
+## Start a Attu instance
+
+1. Run the command to satrt a Attu instance
+
+```shell
+kubectl apply -f https://github.com/zilliztech/attu/blob/main/attu-k8s-deploy.yaml
+```
+
+2. Check the established Ingress.
+
+```shell
+kubectl get ingress
+```
+
+Get the following output:
+
+```
+NAME              CLASS    HOSTS               ADDRESS                               PORTS     AGE
+my-attu-ingress   <none>   my-attu.local       10.100.32.1,10.100.32.2,10.100.32.3   80        19h
+```
+
+3. Configure DNS on the device that requires the Attu service
+
+mapping the path `my-attu.local` onto any of the addresses returned above in the system file `/etc/hosts`.
+
+```shell
+10.100.32.1  my-attu.local
+```
+
+4. Visit `http://my-attu.local` in the browser, and enter the address of the Milvus service.
+

+ 65 - 0
doc/zh-CN/attu_install-kubernetes.md

@@ -0,0 +1,65 @@
+---
+id: attu_install-kubernetes.md
+label: Install attu with Kubernetes
+order: 2
+group: attu
+related_key: attu
+summary: Learn how to install Attu with Kubernetes to manage your Milvus service.
+---
+
+# 安装 Attu
+
+这篇文章将描述如何在 Kubernetes 上安装 Attu - 一个开源的 MIlvus 管理工具。
+
+{{tab}}
+
+## 先决条件
+
+- 已安装 Milvus [单机版](install_standalone-docker.md) 或者 [分布式版](install_cluster-docker.md)。
+- Kubernetes 1.16 或更高版本
+- Ingress 控制器
+
+<div class="alert note">
+Attu 只支持 Milvus 2.x。
+</div>
+
+## 启动 Attu
+
+1. 运行以下命令启动 attu
+
+```shell
+kubectl apply -f https://github.com/zilliztech/attu/blob/main/attu-k8s-deploy.yaml
+```
+
+
+
+2. 检查启动的 ingress 资源
+
+```shell
+kubectl get ingress
+```
+
+将获得以下输出:
+
+```
+NAME              CLASS    HOSTS               ADDRESS                               PORTS     AGE
+my-attu-ingress   <none>   my-attu.local       10.100.32.1,10.100.32.2,10.100.32.3   80        19h
+
+```
+
+
+
+3. 在需要访问 attu 服务的机器上配置 DNS
+
+在系统文件 `/etc/hosts` 中将路径 `my-attu.local` 映射为上述输出中 my-attu-ingress 对应的 ADDRESS 中的任意一地址。
+
+```shell
+10.100.32.1  my-attu.local
+```
+
+
+
+4. 在浏览器中访问 `http://my-attu.local`, 在页面框中输入想要访问的 Milvus 服务地址,即可查看对应的 Milvus 服务。
+
+
+