Skip to content

Commit

Permalink
Merge pull request #130 from linkernetworks/johnlin/vortex-namespace
Browse files Browse the repository at this point in the history
rbac and namespace
  • Loading branch information
John-Lin authored Jul 19, 2018
2 parents 264350e + 8519eec commit 71bfdda
Show file tree
Hide file tree
Showing 29 changed files with 100 additions and 44 deletions.
4 changes: 2 additions & 2 deletions config/k8s.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
"mongo": {
"url": "mongodb://mongo-0.mongo:27017/vortex",
"url": "mongodb://mongo-0.vortex:27017/vortex",
"public": {
"url": "mongodb://35.189.177.37:31717/votex"
}
Expand All @@ -40,4 +40,4 @@
"version": "<GIT_COMMIT>",
"logFileName": "access_log"
}
}
}
6 changes: 0 additions & 6 deletions deploy/helm/apps/vortex-server/requirements.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions deploy/helm/apps/vortex-server/templates/_helpers.tpl

This file was deleted.

File renamed without changes.
5 changes: 5 additions & 0 deletions deploy/helm/apps/vortex/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: vortex
version: 0.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
effect: NoSchedule
containers:
- name: network-controller-server-tcp
image: sdnvortex/network-controller:{{ .Values.global.tag }}
image: sdnvortex/network-controller:{{ .Values.image.tag }}
securityContext:
privileged: true
command: ["/go/bin/server"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
effect: NoSchedule
containers:
- name: network-controller-server-unix
image: sdnvortex/network-controller:{{ .Values.global.tag }}
image: sdnvortex/network-controller:{{ .Values.image.tag }}
securityContext:
privileged: true
command: ["/go/bin/server"]
Expand Down
21 changes: 21 additions & 0 deletions deploy/helm/apps/vortex/charts/vortex-server/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "vortex-server.fullname" . }}
namespace: vortex
labels:
app: {{ template "vortex-server.name" . }}
chart: {{ template "vortex-server.chart" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: {{ template "vortex-server.fullname" . }}
namespace: vortex
labels:
app: {{ template "vortex-server.name" . }}
chart: {{ template "vortex-server.chart" . }}
Expand Down
29 changes: 29 additions & 0 deletions deploy/helm/apps/vortex/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: cluster-admin
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: vortex
namespace: vortex
2 changes: 2 additions & 0 deletions deploy/helm/foundation/mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ global:
environment: develop
storage: 1Gi

replicaCount: 1

hostpath:
enabled: false

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1
apiVersion: rbac.authorization.k8s.io/v1
# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
Expand Down
29 changes: 29 additions & 0 deletions deploy/kubernetes/apps/vortex/01-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: cluster-admin
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: vortex
namespace: vortex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: vortex-server
namespace: vortex
labels:
app: vortex-server
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: vortex-server
namespace: vortex
labels:
app: vortex-server
spec:
Expand All @@ -13,4 +14,4 @@ spec:
targetPort: 7890
nodePort: 32326
name: vortex-server
type: NodePort
type: NodePort
1 change: 1 addition & 0 deletions deploy/kubernetes/service/mongodb/service-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
labels:
environment: testing
name: mongo-external
namespace: vortex
spec:
externalTrafficPolicy: Cluster
ports:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/service/mongodb/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
name: mongo
service: mongo
namespace: vortex
spec:
ports:
- port: 27017
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/service/mongodb/statefulset-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mongo
namespace: vortex
spec:
serviceName: "mongo"
replicas: 1
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/service/mongodb/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mongo
namespace: vortex
spec:
serviceName: "mongo"
replicas: 1
Expand Down

0 comments on commit 71bfdda

Please sign in to comment.