# Kubernetes

***更新: Roboflow Enterprise Customer であれば、以下を使用して Kubernetes 環境に Roboflow Inference Service をデプロイできます*** [***この Helm chart***](https://github.com/roboflow/inference/tree/main/inference/enterprise/helm-chart)***.***

あるいは、Kubernetes cluster に pod と service をデプロイするためのシンプルな Kubernetes manifests はこちらです。

以下の Kubernetes manifest は、単一の CPU ベースの roboflow infer pod を作成し、それに cluster-IP service を接続する簡単な例を示しています。

```yaml
# Pod
---
apiVersion: v1
kind: Pod
metadata:
  name: roboflow
  labels:
    app.kubernetes.io/name: roboflow
spec:
  containers:
  - name: roboflow
    image: roboflow/roboflow-inference-server-cpu
    ports:
    - containerPort: 9001
      name: rf-pod-port


# Service
---
apiVersion: v1
kind: Service
metadata:
  name: rf-service
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: roboflow
  ports:
  - name: rf-svc-port
    protocol: TCP
    port: 9001
    targetPort: rf-pod-port
```

(上記の例では、Kubernetes cluster が Docker hub から images をダウンロードできることを前提としています)

上記の yaml の抜粋を `roboflow.yaml` として保存し、 `kubectl` cli を使って、pod と service を Kubernetes cluster の default namespace にデプロイします。

```
kubectl apply -f roboflow.yaml
```

\
Service (ClusterIP type) が作成されます。Kubernetes cluster 内から、この URI で Roboflow inference にアクセスできます: `http://rf-service.default.svc:9001`

### この例を超えて

Kubernetes を使うと、いくつかの高度な機能や拡張を Roboflow inference service に組み込めます。たとえば、以下のような、より高度な use-cases 向けに上記の例を拡張できます:

* nodeSelectors を使用して、Kubernetes 環境内の GPU machines node pools 上に pod(s) を配置し、 `roboflow/inference-server:gpu` image
* Kubernetes deployments を作成して Roboflow inference service を水平に autoscale し、CPU usage のような特定の metrics に基づく auto-scaling triggers を設定する。
* nodePort や LoadBalancer のような別の service types を使用して、Roboflow inference service を外部公開する
* ingress controllers を使って、TLS（HTTPs）などで Roboflow inference を公開する。
* Roboflow inference service に monitoring と alerting を追加する
* license server と offline modes を統合する


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/deploy/enterprise-deployment/kubernetes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
