add crawl4ai deployment
This commit is contained in:
62
apps/crawl4ai/deployment.yaml
Normal file
62
apps/crawl4ai/deployment.yaml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai
|
||||||
|
namespace: crawl4ai
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: crawl4ai
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: crawl4ai
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: crawl4ai
|
||||||
|
image: unclecode/crawl4ai:latest
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: CRAWL4AI_API_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: crawl4ai-secret
|
||||||
|
key: api_token
|
||||||
|
optional: false
|
||||||
|
- name: MAX_CONCURRENT_TASKS
|
||||||
|
value: "5"
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 11235
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 6
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 15
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 6
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 1Gi
|
||||||
|
limits:
|
||||||
|
cpu: "2"
|
||||||
|
memory: 4Gi
|
||||||
|
volumeMounts:
|
||||||
|
- name: dshm
|
||||||
|
mountPath: /dev/shm
|
||||||
|
volumes:
|
||||||
|
- name: dshm
|
||||||
|
emptyDir:
|
||||||
|
medium: Memory
|
||||||
|
sizeLimit: 1Gi
|
||||||
7
apps/crawl4ai/kustomization.yaml
Normal file
7
apps/crawl4ai/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- secret.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
4
apps/crawl4ai/namespace.yaml
Normal file
4
apps/crawl4ai/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai
|
||||||
38
apps/crawl4ai/secret.yaml
Normal file
38
apps/crawl4ai/secret.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai-secret
|
||||||
|
namespace: crawl4ai
|
||||||
|
---
|
||||||
|
apiVersion: secrets.hashicorp.com/v1beta1
|
||||||
|
kind: VaultAuth
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai
|
||||||
|
namespace: crawl4ai
|
||||||
|
spec:
|
||||||
|
method: kubernetes
|
||||||
|
mount: kubernetes
|
||||||
|
kubernetes:
|
||||||
|
role: crawl4ai
|
||||||
|
serviceAccount: crawl4ai-secret
|
||||||
|
---
|
||||||
|
apiVersion: secrets.hashicorp.com/v1beta1
|
||||||
|
kind: VaultStaticSecret
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai-secret
|
||||||
|
namespace: crawl4ai
|
||||||
|
spec:
|
||||||
|
type: kv-v2
|
||||||
|
|
||||||
|
mount: secret
|
||||||
|
path: crawl4ai
|
||||||
|
|
||||||
|
destination:
|
||||||
|
create: true
|
||||||
|
name: crawl4ai-secret
|
||||||
|
type: Opaque
|
||||||
|
transformation:
|
||||||
|
excludeRaw: true
|
||||||
|
|
||||||
|
vaultAuthRef: crawl4ai
|
||||||
14
apps/crawl4ai/service.yaml
Normal file
14
apps/crawl4ai/service.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: crawl4ai
|
||||||
|
namespace: crawl4ai
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: crawl4ai
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 11235
|
||||||
|
targetPort: 11235
|
||||||
|
protocol: TCP
|
||||||
6
vault/kubernetes-roles/crawl4ai.yaml
Normal file
6
vault/kubernetes-roles/crawl4ai.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
bound_service_account_names:
|
||||||
|
- crawl4ai-secret
|
||||||
|
bound_service_account_namespaces:
|
||||||
|
- crawl4ai
|
||||||
|
token_policies:
|
||||||
|
- crawl4ai
|
||||||
3
vault/policy/crawl4ai.hcl
Normal file
3
vault/policy/crawl4ai.hcl
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
path "secret/data/crawl4ai" {
|
||||||
|
capabilities = ["read"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user