Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Adding deployment scripts for kubernetes
Browse files Browse the repository at this point in the history
Run the following command to start the

kubectl create -f firmament-deployment.yaml
kubectl create -f poseidon-scheduler.yaml

This will create two services 'firmament-service' and 'poseidon-stats'.
poseidon-scheduler pod will wait till the firmament pods are created.

Change-Id: I0ee8d8021eb0fa1f3f075c8612ed42d1a0e1efe9
Affected-Modules: k8sclient
  • Loading branch information
shivramsrivastava committed Jul 7, 2017
1 parent b3dee43 commit 8bb2279
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 31 deletions.
38 changes: 27 additions & 11 deletions deploy/firmament-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
apiVersion: extensions/v1beta1
kind: Service
apiVersion: v1
metadata:
name: firmament-service
namespace: kube-system
spec:
selector:
scheduler: firmament
ports:
- protocol: TCP
port: 9090
targetPort: 9090
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: firmament-scheduler
namespace: kube-system
labels:
app: firmament
name: firmament-deployment
scheduler: firmament
spec:
replicas: 1
template:
metadata:
labels:
app: firmament
name: firmament
labels:
scheduler: firmament
spec:
containers:
- name: firmament
image: camsas/firmament:dev
command: ["/firmament/src/firmament_scheduler", "--flagfile=/firmament/default.conf"]
ports:
- containerPort: 9090
- command: [/firmament/src/firmament_scheduler, --flagfile=/firmament/default.conf, --firmament_scheduler_service_address=0.0.0.0]
image: camsas/firmament:dev
name: firmament-scheduler
ports:
- containerPort: 9090
hostNetwork: true
hostPID: false
volumes: []
55 changes: 38 additions & 17 deletions deploy/poseidon-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
apiVersion: extensions/v1beta1
kind: Service
apiVersion: v1
metadata:
name: poseidon-stats
namespace: kube-system
spec:
selector:
poseidonservice: stats
ports:
- protocol: TCP
port: 9091
targetPort: 9091
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
app: poseidon
name: poseidon-deployment
component: scheduler
tier: control-plane
poseidonservice: stats
name: poseidon
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
app: poseidon
name: poseidon
labels:
component: scheduler
tier: control-plane
version: first
poseidonservice: stats
spec:
containers:
- name: poseidon
image: camsas/poseidon:dev
command:
- poseidon
- --logtostderr
- --kubeConfig=<path_kubeconfig_file>
- --firmamentAddress=<host>:9090
- --statsServerAddress=<host>:9091
- --kubeVersion=1.5
ports:
- containerPort: 9091
- command: [ /go/bin/poseidon ,--logtostderr ,--kubeConfig="", --firmamentAddress="", --firmamentAddress="", --kubeVersion=="1.6" ]
image: camsas/poseidon:dev
name: poseidon
initContainers:
- name: init-firmamentservice
image: radial/busyboxplus:curl
command: ['sh', '-c', 'until nslookup firmament-service.kube-system; do echo waiting for firmamentservice; sleep 1; done;']
securityContext:
privileged: false
volumeMounts: []
hostNetwork: true
hostPID: false
volumes: []

6 changes: 3 additions & 3 deletions poseidon.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var (

func init() {
flag.StringVar(&schedulerName, "schedulerName", "poseidon", "The scheduler name with which pods are labeled")
flag.StringVar(&firmamentAddress, "firmamentAddress", "127.0.0.1:9090", "Firmament scheduler service address and port")
flag.StringVar(&firmamentAddress, "firmamentAddress", "firmament-service.kube-system:9090", "Firmament scheduler service address and port")
flag.StringVar(&kubeConfig, "kubeConfig", "kubeconfig.cfg", "Path to the kubeconfig file")
flag.StringVar(&kubeVersion, "kubeVersion", "1.5.6", "Kubernetes version")
flag.StringVar(&statsServerAddress, "statsServerAddress", "127.0.0.1:9091", "Address on which the stats server listens")
flag.StringVar(&kubeVersion, "kubeVersion", "1.6", "Kubernetes version")
flag.StringVar(&statsServerAddress, "statsServerAddress", "0.0.0.0:9091", "Address on which the stats server listens")
flag.IntVar(&schedulingInterval, "schedulingInterval", 10, "Time between scheduler runs (in seconds)")
flag.Parse()
}
Expand Down

0 comments on commit 8bb2279

Please sign in to comment.