Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GOBBLIN-932] Create deployment for Azure, clean up existing deployments
Closes #2799 from Will-Lo/azure-deploy
- Loading branch information
Showing
14 changed files
with
214 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# GaaS on Azure Deployment Steps | ||
|
||
## Create Azure Container Registry [Optional] | ||
|
||
1\) Log into Azure Container Registry | ||
|
||
```bash | ||
$ az acr login --name gobblintest | ||
``` | ||
|
||
2\) Tag docker images to container registry | ||
|
||
```bash | ||
$ docker tag <gaas_image_id> gobblintest.azurecr.io/gobblin-service | ||
$ docker tag <standalone_image_id> gobblintest.azurecr.io/gobblin-standalone | ||
``` | ||
|
||
3\) Push the images | ||
|
||
```bash | ||
$ docker push gobblintest.azurecr.io/gobblin-service | ||
$ docker push gobblintest.azurecr.io/gobblin-standalone | ||
``` | ||
|
||
The images should now be hosted on azure with the tag:latest | ||
|
||
## Deploy the base K8s cluster | ||
|
||
1\) Create a resource group on Azure | ||
|
||
2\) Create a cluster and deploy it onto the resource group | ||
|
||
```bash | ||
az aks create --resource-group <resource_group_name> --name GaaS-cluster-test --node-count 1 --enable-addons monitoring --generate-ssh-keys | ||
``` | ||
|
||
3\) Switch kubectl to use azure | ||
|
||
4\) Check status of cluster | ||
|
||
```bash | ||
$ kubectl get pods | ||
``` | ||
|
||
## Install the nginx ingress to connect to the Azure Cluster | ||
|
||
1\) Install helm if you don't currently have it | ||
|
||
```bash | ||
brew install helm | ||
helm init | ||
``` | ||
|
||
2\) Deploy the nginx helm chart to create the ingress | ||
|
||
```bash | ||
helm install stable/nginx-ingress | ||
``` | ||
|
||
If this is the first time deploying helm (v2.0), you will need to set up the tiller, which is a helm serviceaccount with sudo permissions that lives inside of the cluster. Otherwise you'll run into this [issue](https://github.com/helm/helm/issues/2224). | ||
|
||
> Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list configmaps in the namespace "kube-system" | ||
To set up the tiller \(steps are also found in the issue link\) | ||
|
||
```bash | ||
kubectl create serviceaccount --namespace kube-system tiller | ||
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | ||
kubectl edit deploy --namespace kube-system tiller-deploy #and add the line serviceAccount: tiller to spec/template/spec | ||
``` | ||
|
||
3\) Deploy the ingress controller in `gobblin-kubernetes/gobblin-service/azure-cluster` | ||
|
||
4\) Run `kubectl get services`, and the output should look something like this: | ||
|
||
```text | ||
gaas-svc ClusterIP 10.0.176.58 <none> 6956/TCP 16h | ||
honorary-possum-nginx-ingress-controller LoadBalancer 10.0.182.255 <EXTERNAL_IP> 80:30488/TCP,443:31835/TCP 6m13s | ||
honorary-possum-nginx-ingress-default-backend ClusterIP 10.0.236.153 <none> 80/TCP 6m13s | ||
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 10d | ||
``` | ||
|
||
5\) Send a request to the IP for the `honorary-possum-nginx-ingress-controller` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: gaas-ingress | ||
annotations: | ||
# utilize an nginx ingress as default, to set up read file at incubator-gobblin/gobblin-docs/user-guide/Azure-Kubernetes-Deployment.md | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1 | ||
spec: | ||
backend: | ||
serviceName: gaas-svc | ||
servicePort: 6956 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bases: | ||
- ../mysql-cluster | ||
patchesStrategicMerge: | ||
- ingress.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# ==================================================================== | ||
# Job configurations | ||
# ==================================================================== | ||
|
||
gobblin.template.required_attributes="from,to" | ||
|
||
job.name=Distcp | ||
job.description="Distributed copy" | ||
|
||
# target location for copy | ||
data.publisher.final.dir=${gobblin.flow.output.dataset.descriptor.path} | ||
gobblin.dataset.pattern=${gobblin.flow.input.dataset.descriptor.path} | ||
|
||
gobblin.dataset.profile.class=org.apache.gobblin.data.management.copy.CopyableGlobDatasetFinder | ||
|
||
# ==================================================================== | ||
# Distcp configurations | ||
# ==================================================================== | ||
|
||
extract.namespace=org.apache.gobblin.copy | ||
data.publisher.type=org.apache.gobblin.data.management.copy.publisher.CopyDataPublisher | ||
source.class=org.apache.gobblin.data.management.copy.CopySource | ||
writer.builder.class=org.apache.gobblin.data.management.copy.writer.FileAwareInputStreamDataWriterBuilder | ||
converter.classes=org.apache.gobblin.converter.IdentityConverter | ||
|
||
task.maxretries=0 | ||
workunit.retry.enabled=false | ||
|
||
distcp.persist.dir=/tmp/distcp-persist-dir | ||
|
||
cleanup.staging.data.per.task=false | ||
gobblin.trash.skip.trash=true | ||
state.store.enabled=false | ||
job.commit.parallelize=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
apiVersion: networking.k8s.io/v1beta1 | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: gaas-ingress | ||
spec: | ||
backend: | ||
serviceName: gaas-svc | ||
servicePort: 6956 | ||
servicePort: 6956 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resources: | ||
- deployment.yaml | ||
- storage.yaml | ||
- service.yaml | ||
- ingress.yaml | ||
configMapGenerator: | ||
# only used for development purposes to allow an easy way to expose template files to GaaS | ||
# add flow templates here | ||
- name: flowconfig-templates | ||
files: | ||
- flowconfig-templates/distcp.template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: gaas-svc | ||
labels: | ||
app: gobblin-service | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- protocol: TCP | ||
port: 6956 | ||
targetPort: 6956 | ||
selector: | ||
app: gaas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters