Skip to content

Commit

Permalink
Merge pull request #15 from KhaosResearch/feat/kubernetes
Browse files Browse the repository at this point in the history
Add reference Kubernetes manifest for deploying eidos
  • Loading branch information
benhid committed Jun 18, 2024
2 parents 2182d96 + 2657bae commit a7326fa
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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"

0 comments on commit a7326fa

Please sign in to comment.