Skip to content

Commit

Permalink
some docs rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
frodopwns committed Oct 10, 2019
1 parent ef4f388 commit c1101a9
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 250 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ The project was built using

[Kubebuilder](https://book.kubebuilder.io/)

## Install the operator

Information on how to build, test and run the operator, refer to the link below.
[Building, testing and running the operator](/docs/contents.md)

## Azure Services supported

1. Resource Group
2. EventHub
3. [Azure SQL](/docs/azuresql/azuresql.md)

For information on how to build, test and run the operator, refer to the link below.
[Building, testing and running the operator](/docs/development.md)

## Testing

Expand Down
12 changes: 12 additions & 0 deletions docs/contents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Azure Service Operator Documentation

## Contents

1. [Prereqs](prereqs.md)
Find the list of tools and dependencies needed to develop and deploy the Azure Service Operator here.

2. [Developing](development.md)
Useful information for running the operator locally can be found here.

3. [Deploying](deploy.md)
If you are ready to deploy to an AKS cluster go here.
88 changes: 88 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Building and deploying the Azure Service Operator


## Build the operator

1. Clone the repository.

2. Make sure the environment variable `GO111MODULE` is set to `on`.
```bash
export GO111MODULE=on
```

3. Build the image and push it to docker hub.

```shell
docker login
IMG=<dockerhubusername>/<imagename>:<tag> make build-and-push
```

## Deploy the operator

1. Set up the Cluster

a. Create the namespace you want to deploy the operator to.

**Note** The scripts currently are configured to deploy to the ```azureoperator-system``` namespace

```shell
kubectl create namespace azureoperator-system
```

b. Set the ```azureoperatorsettings``` secret.

First, set the following environment variables `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`, `REQUEUE_AFTER`.

```shell
export AZURE_TENANT_ID=xxxxxxx
export AZURE_CLIENT_ID=yyyyyyy
export AZURE_CLIENT_SECRET=zzzzzz
export AZURE_SUBSCRIPTION_ID=aaaaaaa
export REQUEUE_AFTER=30
```

From the same terminal, run the below command.

```shell
kubectl --namespace azureoperator-system \
create secret generic azureoperatorsettings \
--from-literal=AZURE_CLIENT_ID="$AZURE_CLIENT_ID" \
--from-literal=AZURE_CLIENT_SECRET="$AZURE_CLIENT_SECRET" \
--from-literal=AZURE_SUBSCRIPTION_ID="$AZURE_SUBSCRIPTION_ID" \
--from-literal=AZURE_TENANT_ID="$AZURE_TENANT_ID"
```

c. Install [Cert Manager](https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html)

```shell
make install-cert-manager
```

3. Give the default service account on the azureoperator-system namespace "cluster-admin" access to the namespace where the operator deploys the resources by default.

**Note** Not recommended for production.

```shell
kubectl create clusterrolebinding cluster-admin-aso \
--clusterrole=cluster-admin \
--user=system:serviceaccount:azureoperator-system:default
```


4. Deploy the operator to the Kubernetes cluster

```shell
make deploy
```

5. Check that the operator is deployed to the cluster using the following commands.
```shell
kubectl get pods -n azureoperator-system
```

6. You can view the logs from the operator using the following command. The `podname` is the name of the pod in the output from `kubectl get pods -n azureoperator-system`, `manager` is the name of the container inside the pod.

```shell
kubectl logs <podname> -c manager -n azureoperator-system
```

Loading

0 comments on commit c1101a9

Please sign in to comment.