mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
added k8s files
This commit is contained in:
43
k8s/crawlab-master.yaml
Normal file
43
k8s/crawlab-master.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: crawlab
|
||||
namespace: crawlab
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: 8080
|
||||
nodePort: 30088
|
||||
selector:
|
||||
app: crawlab-master
|
||||
type: NodePort
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: crawlab-master
|
||||
namespace: crawlab
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: crawlab-master
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: crawlab-master
|
||||
spec:
|
||||
containers:
|
||||
- image: tikazyq/crawlab:latest
|
||||
name: crawlab
|
||||
env:
|
||||
- name: CRAWLAB_SERVER_MASTER
|
||||
value: "Y"
|
||||
- name: CRAWLAB_MONGO_HOST
|
||||
value: "mongo"
|
||||
- name: CRAWLAB_REDIS_ADDRESS
|
||||
value: "redis"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: crawlab
|
||||
27
k8s/crawlab-worker.yaml
Normal file
27
k8s/crawlab-worker.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: crawlab-worker
|
||||
namespace: crawlab
|
||||
spec:
|
||||
replicas: 4
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: crawlab-worker
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: crawlab-worker
|
||||
spec:
|
||||
containers:
|
||||
- image: tikazyq/crawlab:latest
|
||||
name: crawlab
|
||||
env:
|
||||
- name: CRAWLAB_SERVER_MASTER
|
||||
value: "N"
|
||||
- name: CRAWLAB_MONGO_HOST
|
||||
value: "mongo"
|
||||
- name: CRAWLAB_REDIS_ADDRESS
|
||||
value: "redis"
|
||||
28
k8s/mongo-pv.yaml
Normal file
28
k8s/mongo-pv.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mongo-pv-volume
|
||||
namespace: crawlab
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/data/k8s/mongodb/data"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mongo-pv-claim
|
||||
namespace: crawlab
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
41
k8s/mongo.yaml
Normal file
41
k8s/mongo.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo
|
||||
namespace: crawlab
|
||||
spec:
|
||||
ports:
|
||||
- port: 27017
|
||||
selector:
|
||||
app: mongo
|
||||
clusterIP: None
|
||||
---
|
||||
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongo
|
||||
namespace: crawlab
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongo
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongo
|
||||
spec:
|
||||
containers:
|
||||
- image: mongo:4
|
||||
name: mongo
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
name: mongo
|
||||
volumeMounts:
|
||||
- name: mongo-persistent-storage
|
||||
mountPath: /data/db
|
||||
volumes:
|
||||
- name: mongo-persistent-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: mongo-pv-claim
|
||||
34
k8s/redis.yaml
Normal file
34
k8s/redis.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: crawlab
|
||||
spec:
|
||||
ports:
|
||||
- port: 6379
|
||||
selector:
|
||||
app: redis
|
||||
clusterIP: None
|
||||
---
|
||||
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: crawlab
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- image: redis
|
||||
name: redis
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: redis
|
||||
Reference in New Issue
Block a user