Browse Source

Merge pull request #309 from Jayclifford345/main

Adding Kubernetes Deployment Documentation
ryjiang 1 year ago
parent
commit
d1010071ae
3 changed files with 66 additions and 1 deletions
  1. 12 0
      README.md
  2. 1 1
      attu-k8s-deploy.yaml
  3. 53 0
      examples/attu-k8s-deploy-ConfigMap.yaml

+ 12 - 0
README.md

@@ -25,6 +25,18 @@ docker run -p 8000:3000 -e MILVUS_URL={milvus server IP}:19530 zilliz/attu:v2.3.
 
 Make sure that the Attu container can access the Milvus IP address. After starting the container, open your web browser and enter `http://{ Attu IP }:8000` to view the Attu GUI.
 
+### Running Attu within Kubernetes
+
+Before you begin, make sure that you have Milvus installed and running within your [K8's Cluster](https://milvus.io/docs/install_cluster-milvusoperator.md). Note that Attu only supports Milvus 2.x.
+
+Here are the steps to start a container for running Attu:
+
+```code
+kubectl apply -f https://raw.githubusercontent.com/zilliztech/attu/main/attu-k8s-deploy.yaml
+```
+
+Make sure that the Attu pod can access the Milvus service. In the example provided this connects directly to `my-release-milvus:19530`. Change this based on the Milvus service name. A more flexible way to achieve this would be to introduce a `ConfigMap`. See this [example]("https://raw.githubusercontent.com/zilliztech/attu/main/examples/attu-k8s-deploy-ConfigMap.yaml") for details.
+
 #### Parameters for Docker CLI
 
 | Parameter  | Example           | Required | Description                 |

+ 1 - 1
attu-k8s-deploy.yaml

@@ -40,4 +40,4 @@ spec:
           protocol: TCP
         env:
         - name: MILVUS_URL
-          value: 127.0.0.1:19530
+          value: "my-release-milvus:19530"

+ 53 - 0
examples/attu-k8s-deploy-ConfigMap.yaml

@@ -0,0 +1,53 @@
+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: v1
+kind: ConfigMap
+metadata:
+  name: milvus-config
+data:
+  milvus_url: "<SERVICE>:<PORT>"
+---
+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:v2.3.1
+        imagePullPolicy: IfNotPresent
+        ports:
+        - name: attu
+          containerPort: 3000
+          protocol: TCP
+        env:
+        - name: MILVUS_URL
+          valueFrom:
+            configMapKeyRef:
+              name: milvus-config
+              key: milvus_url