Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reference Kubernetes manifest for deploying eidos #15

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Example:
curl -X POST -H "Content-Type: application/json" -d '{"who": "me"}' http://localhost:8090/api/v1/execution/salute
```

To deploy the container in Kubernetes, a reference deployment is available and documented at [deployments](deployments/).

## Testing

`pytest` is used for testing. You can run the tests with the following command:
Expand Down
8 changes: 8 additions & 0 deletions deployments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Kubernetes deployment of eidos
This folder contains all required files and configuration to have a working deployment of `eidos` in Kubernetes.

The configuration provided creates a deployment with 3 replicas using the base `eidos` instance (to deploy a instance with custom functions just change the docker image) behind a service for load balancing between the different pods.

# Disclaimer

The provided Kubernetes manifests are for reference only. You must review and adjust these manifests to suit your specific cluster and configuration. Ensure that resource requests and limits, image names, environment variables, and other configurations are appropriate for your setup.
78 changes: 78 additions & 0 deletions deployments/eidos-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: v1
kind: Namespace
metadata:
name: eidos-namespace
labels:
app: eidos
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: eidos-deployment
labels:
app: eidos
namespace: eidos-namespace
spec:
replicas: 3
selector:
matchLabels:
app: eidos
template:
metadata:
labels:
app: eidos
namespace: eidos-namespace
spec:
containers:
- name: eidos
image: ghcr.io/khaosresearch/eidos:v1.0.0 # This image must be changed to deploy a custom functions
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
limits:
memory: "1Gi"
cpu: "1"
requests:
memory: "256Mi"
cpu: "500m"
env:
- name: API_KEY
valueFrom:
configMapKeyRef:
name: eidos-configmap
key: EIDOS_API_KEY
- name: ROOT_PATH
valueFrom:
configMapKeyRef:
name: eidos-configmap
key: EIDOS_ROOT_PATH
- name: FUNCTIONS_FOLDER
valueFrom:
configMapKeyRef:
name: eidos-configmap
key: EIDOS_FUNCTIONS_FOLDER
---
apiVersion: v1
kind: Service
metadata:
name: eidos-service
namespace: eidos-namespace
spec:
type: NodePort
selector:
app: eidos
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: v1
kind: ConfigMap
metadata:
name: eidos-configmap
namespace: eidos-namespace
data:
EIDOS_API_KEY: "Sample_API_key_for_eidos"
EIDOS_ROOT_PATH: "/eidos"
EIDOS_FUNCTIONS_FOLDER: "functions"