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

added the k8s config. #952

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
7 changes: 7 additions & 0 deletions kubernetes/nebula-configmaps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nebula-config
data:
# kubectl get pod nebula-metad-{0|1|2...} --template={{.status.podIP}}
meta_server_addrs: 10.1.0.244:45500, 10.1.0.245:45000, 10.1.0.246:45000
62 changes: 62 additions & 0 deletions kubernetes/nebula-graphd-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nebula-graphd
name: nebula-graphd
spec:
selector:
matchLabels:
app: nebula-graphd
replicas: 3
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: nebula-graphd
spec:
dnsPolicy: ClusterFirstWithHostNet
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nebula-graphd
topologyKey: kubernetes.io/hostname
containers:
- name: nebula-graphd
image: vesoft/nebula-graphd:nightly
imagePullPolicy: Always
ports:
- name: thrift
containerPort: 3699
- name: http
containerPort: 13000
- name: http2
containerPort: 13002
command: ["/usr/local/nebula/bin/nebula-graphd", "--flagfile=/usr/local/nebula/etc/nebula-graphd.conf", "--daemonize=false", "--meta_server_addrs=$(META_SERVER_ADDRS)" , "--ws_ip=0.0.0.0"]
monadbobo marked this conversation as resolved.
Show resolved Hide resolved
env:
- name: META_SERVER_ADDRS
valueFrom:
configMapKeyRef:
name: nebula-config
key: meta_server_addrs
livenessProbe:
httpGet:
path: /status
port: 13000
initialDelaySeconds: 30
timeoutSeconds: 5
resources:
limits:
memory: "1Gi"
cpu: "1"
97 changes: 97 additions & 0 deletions kubernetes/nebula-meta-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: nebula-metad
name: neubla-metad
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
publishNotReadyAddresses: true
clusterIP: None
ports:
- name: thrift
port: 44500
- name: raft
port: 44501
- name: http
port: 11000
- name: http2
port: 11002
selector:
app: nebula-metad
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nebula-metad
labels:
app: nebula
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nebula-metad label

spec:
serviceName: nebula-metad
replicas: 3
selector:
matchLabels:
app: nebula-metad
template:
metadata:
labels:
app: nebula-metad
spec:
# hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nebula-metad
topologyKey: kubernetes.io/hostname
terminationGracePeriodSeconds: 60
hostname: meta.nebula.services
containers:
- name: nebula-metad
image: vesoft/nebula-metad:nightly
imagePullPolicy: Always
ports:
- containerPort: 45500
name: thrift
- containerPort: 45501
name: raft
- containerPort: 11000
name: http
- containerPort: 11002
name: http2
command:
- "/bin/bash"
- "-ecx"
- "exec /usr/local/nebula/bin/nebula-metad --flagfile=/usr/local/nebula/etc/nebula-metad.conf --daemonize=false --local_ip=$(hostname -i) --ws_ip=0.0.0.0"
monadbobo marked this conversation as resolved.
Show resolved Hide resolved
livenessProbe:
httpGet:
path: /status
port: 11000
initialDelaySeconds: 30
timeoutSeconds: 5
volumeMounts:
- name: data
mountPath: /usr/local/nebula/data/
volumes:
- name: data
persistentVolumeClaim:
claimName: data
podManagementPolicy: Parallel
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
115 changes: 115 additions & 0 deletions kubernetes/nebula-storaged-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: nebula-storaged
name: neubla-storaged
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
publishNotReadyAddresses: true
clusterIP: None
ports:
- name: thrift
port: 45500
- name: raft
port: 45501
- name: http
port: 12000
- name: http2
port: 12002
selector:
app: nebula-storaged
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: nebula-budget
labels:
app: nebula
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nebula-budget label

spec:
selector:
matchLabels:
app: nebula-storaged
app: nebula-metad
maxUnavailable: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nebula-storaged
labels:
app: nebula-storaged
spec:
serviceName: nebula-storaged
replicas: 3
selector:
matchLabels:
app: nebula-storaged
template:
metadata:
labels:
app: nebula-storaged
spec:
# hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nebula-storaged
topologyKey: kubernetes.io/hostname
terminationGracePeriodSeconds: 60
containers:
- name: nebula-storaged
image: vesoft/nebula-storaged:nightly
imagePullPolicy: Always
ports:
- containerPort: 44500
name: thrift
- containerPort: 44501
name: raft
- containerPort: 12000
name: http
- containerPort: 12002
name: http2
command:
- "/bin/bash"
- "-ecx"
- "exec /usr/local/nebula/bin/nebula-storaged --flagfile=/usr/local/nebula/etc/nebula-storaged.conf --daemonize=false --local_ip=$(hostname -i) --meta_server_addrs=$(META_SERVER_ADDRS) --ws_ip=0.0.0.0"
env:
- name: META_SERVER_ADDRS
valueFrom:
configMapKeyRef:
name: nebula-config
key: meta_server_addrs
livenessProbe:
httpGet:
path: /status
port: 12000
initialDelaySeconds: 30
timeoutSeconds: 5
volumeMounts:
- name: data
mountPath: /usr/local/nebula/data/
volumes:
- name: data
persistentVolumeClaim:
claimName: data
podManagementPolicy: Parallel
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Gi