Skip to content

Commit

Permalink
Add cloud provider specific install scripts. (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Jul 22, 2017
1 parent 1f1219f commit 1132d72
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 3 deletions.
13 changes: 13 additions & 0 deletions hack/deploy/acs.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=azure
export CLOUD_CONFIG=/etc/kubernetes/azure.json
export INGRESS_CLASS=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/acs.sh [--rbac]'
fi
13 changes: 13 additions & 0 deletions hack/deploy/aws.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=aws
export CLOUD_CONFIG=
export INGRESS_CLASS=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/aws.sh [--rbac]'
fi
13 changes: 13 additions & 0 deletions hack/deploy/azure.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=azure
export CLOUD_CONFIG=/etc/kubernetes/azure.json
export INGRESS_CLASS=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/azure.sh [--rbac]'
fi
12 changes: 12 additions & 0 deletions hack/deploy/baremetal.sh
@@ -0,0 +1,12 @@
#!/bin/bash

export CLOUD_PROVIDER=
export CLOUD_CONFIG=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/baremetal.sh [--rbac]'
fi
55 changes: 55 additions & 0 deletions hack/deploy/deployments.yaml
@@ -0,0 +1,55 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: voyager
name: voyager-operator
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
app: voyager
spec:
containers:
- name: voyager
args:
- run
- --cloud-provider=$CLOUD_PROVIDER
- --cloud-config=$CLOUD_CONFIG # ie. /etc/kubernetes/azure.json for azure
- --v=3
- --ingress-class=$INGRESS_CLASS
image: appscode/voyager:3.1.0
env:
- name: OPERATOR_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
ports:
- containerPort: 56790
name: http
protocol: TCP
volumeMounts:
- mountPath: /etc/kubernetes
name: cloudconfig
readOnly: true
volumes:
- hostPath:
path: /etc/kubernetes
name: cloudconfig
---
apiVersion: v1
kind: Service
metadata:
labels:
app: voyager
name: voyager-operator
namespace: kube-system
spec:
ports:
- name: http
port: 56790
targetPort: http
selector:
app: voyager
13 changes: 13 additions & 0 deletions hack/deploy/gce.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=gce
export CLOUD_CONFIG=
export INGRESS_CLASS=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/gce.sh [--rbac]'
fi
13 changes: 13 additions & 0 deletions hack/deploy/gke.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=gke
export CLOUD_CONFIG=
export INGRESS_CLASS=voyager

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/gke.sh [--rbac]'
fi
13 changes: 13 additions & 0 deletions hack/deploy/minikube.sh
@@ -0,0 +1,13 @@
#!/bin/bash

export CLOUD_PROVIDER=minikube
export CLOUD_CONFIG=
export INGRESS_CLASS=

if [ $# -eq 0 ]; then
cat ./hack/deploy/without-rbac.yaml | envsubst | kubectl apply -f -
elif [ $1 == '--rbac' ]; then
cat ./hack/deploy/with-rbac.yaml | envsubst | kubectl apply -f -
else
echo 'Usage: ./hack/deploy/minikube.sh [--rbac]'
fi
5 changes: 3 additions & 2 deletions hack/deploy/with-rbac.yaml
Expand Up @@ -102,10 +102,11 @@ spec:
- name: voyager
args:
- run
- --cloud-provider=$CLOUD_PROVIDER
- --cloud-config=$CLOUD_CONFIG # ie. /etc/kubernetes/azure.json for azure
- --v=3
- --rbac
- --cloud-provider=$CLOUD_PROVIDER
- --cloud-config=$CLOUD_CONFIG # ie. /etc/kubernetes/azure.json for azure
- --ingress-class=$INGRESS_CLASS
image: appscode/voyager:3.1.0
ports:
- containerPort: 56790
Expand Down
3 changes: 2 additions & 1 deletion hack/deploy/without-rbac.yaml
Expand Up @@ -16,9 +16,10 @@ spec:
- name: voyager
args:
- run
- --v=3
- --cloud-provider=$CLOUD_PROVIDER
- --cloud-config=$CLOUD_CONFIG # ie. /etc/kubernetes/azure.json for azure
- --v=3
- --ingress-class=$INGRESS_CLASS
image: appscode/voyager:3.1.0
ports:
- containerPort: 56790
Expand Down

0 comments on commit 1132d72

Please sign in to comment.