Initial commit of getting started (#40)

* Initial commit of getting started

* add additional note for vm driver

* fix some

* fix typos

* refine more

* Updates to readme

* Update to getting started

* Update changes to getting started

* fix cr

* fix cr

* fix cr

* wip

* rename to readme.md
This commit is contained in:
Young Bu Park 2019-10-03 22:12:48 -07:00 committed by GitHub
parent 36f1654d5b
commit 081e5b032c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 253 additions and 6 deletions

View File

@ -0,0 +1,60 @@
# Set up an Azure Kubernetes Service cluster
## Prerequisites
- [Docker](https://docs.docker.com/install/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)
## Deploy an Azure Kubernetes Service cluster
This guide walks you through installing an Azure Kubernetes Service cluster. If you need more information, refer to [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure CLI](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough)
1. Login to Azure
```bash
az login
```
2. Set the default subscription
```bash
az account set -s [your_subscription_id]
```
3. Create a resource group
```bash
az group create --name [your_resource_group] --location [region]
```
4. Create an Azure Kubernetes Service cluster
Use 1.13.x or newer version of Kubernetes with `--kubernetes-version`
```bash
az aks create --resource-group [your_resource_group] --name [your_aks_cluster_name] --node-count 2 --kubernetes-version 1.14.6 --enable-addons http_application_routing --enable-rbac --generate-ssh-keys
```
5. Get the access credentials for the Azure Kubernetes cluster
```bash
az aks get-credentials -n [your_aks_cluster_name] -g [your_resource_group]
```
## (optional) Install Helm and deploy Tiller
1. [Install Helm client](https://helm.sh/docs/using_helm/#installing-the-helm-client)
2. Create the Tiller service account
```bash
kubectl apply -f https://raw.githubusercontent.com/Azure/helm-charts/master/docs/prerequisities/helm-rbac-config.yaml
```
3. Run the following to install Tiller into the cluster
```bash
helm init --service-account tiller --history-max 200
```
4. Ensure that Tiller is deployed and running
```bash
kubectl get pods -n kube-system
```

View File

@ -0,0 +1,68 @@
# Set up a Minikube cluster
## Prerequisites
- [Docker](https://docs.docker.com/install/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Minikube](https://minikube.sigs.k8s.io/docs/start/)
> Note: For Windows, enable Virtualization in BIOS and [install Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v)
## Start the Minikube cluster
1. (optional) Set the default VM driver
```bash
minikube config set vm-driver [driver_name]
```
> Note: See [DRIVERS](https://minikube.sigs.k8s.io/docs/reference/drivers/) for details on supported drivers and how to install plugins.
2. Start the cluster
Use 1.13.x or newer version of Kubernetes with `--kubernetes-version`
```bash
minikube start --cpus=4 --memory=4096 --kubernetes-version=1.14.6 --extra-config=apiserver.authorization-mode=RBAC
```
3. Enable dashboard and ingress addons
```bash
# Enable dashboard
minikube addons enable dashboard
# Enable ingress
minikube addons enable ingress
```
## (optional) Install Helm and deploy Tiller
1. [Install Helm client](https://helm.sh/docs/using_helm/#installing-the-helm-client)
2. Create the Tiller service account
```bash
kubectl create serviceaccount -n kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
```
3. Install Tiller to the minikube
```bash
helm init --service-account tiller --history-max 200
```
4. Ensure that Tiller is deployed and running
```bash
kubectl get pods -n kube-system
```
### Troubleshooting
If Tiller is not running properly, get the logs from `tiller-deploy` deployment to understand the problem:
```bash
kubectl describe deployment tiller-deploy --namespace kube-system
```

125
getting-started/readme.md Normal file
View File

@ -0,0 +1,125 @@
# Getting Started
This article describes how to install Dapr to a local standalone developer machine or to a Kubernetes cluster.
Dapr can be run in either Standalone or Kubernetes modes. Running Dapr runtime in Standalone mode enables you to develop Dapr applications in your local development environment and then deploy and run them in other Dapr supported environments. For example, you can develop Dapr applications in Standalone mode and then deploy them to any Kubernetes cluster.
Once Dapr is installed, you can try out the [dapr samples](https://github.com/dapr/samples) and [howtos](../howto/)
## Contents
- [Prerequsites](#prerequisites)
- [Running Dapr in standalone mode](#running-dapr-as-a-standalone-mode)
- [Running Dapr on Kubernetes cluster](#running-dapr-on-kubernetes-cluster)
## Prerequisites
Download the [Dapr CLI](https://github.com/dapr/cli/releases), unpack it and move it to your desired location.
> For Mac/Linux - `/usr/local/bin`.
> For Windows, create a directory and add this to your System PATH. For example create a directory called `c:\dapr` and add this directory to your path, by editing your system environment variable.
## Installing Dapr in standalone mode
### Install Dapr runtime using the CLI
Install Dapr by running `dapr init` from a command prompt
> For Linux users, if you run your docker cmds with sudo, you need to use "**sudo dapr init**"
> For Windows users, make sure that you run the cmd terminal in administrator mode
> **Note:** See [Dapr CLI](https://github.com/dapr/cli) for details on the usage of Dapr CLI
```bash
$ dapr init
⌛ Making the jump to hyperspace...
Downloading binaries and setting up components
✅ Success! Dapr is up and running
```
To see that Dapr has been installed successful, from a command prompt run the `docker ps` command and check that the `actionscore.azurecr.io/dapr:latest` and `redis` container images are both running.
### Install a specific runtime version
You can install or upgrade to a specific version of the Dapr runtime using `dapr init --runtime-version`
```bash
# Install v0.4.0-alpha.4 runtime
$ dapr init --runtime-version v0.4.0-alpha.4
# Check the versions of cli and runtime
$ dapr --version
cli version: v0.2.0-alpha.2
runtime version: v0.4.0-alpha.4
```
## Installing Dapr on a Kubernetes cluster
When setting up Kubernetes you can do this either via the Dapr CLI or Helm
### Setup Cluster
* [Setup Minikube Cluster](./cluster/setup-minikube.md)
* [Setup Azure Kubernetes Service Cluster](./cluster/setup-aks.md)
### Using the Dapr CLI
You can install Dapr to Kubernetes cluster using CLI.
#### Install Dapr to Kubernetes
```bash
$ dapr init --kubernetes
⌛ Making the jump to hyperspace...
✅ Deploying the Dapr Operator to your cluster...
✅ Success! Dapr has been installed. To verify, run 'kubectl get pods' in your terminal.
```
Dapr CLI installs Dapr to `default` namespace of Kubernetes cluster.
#### Uninstall Dapr on Kubernetes
```bash
$ dapr uninstall --kubernetes
```
### Using Helm (Advanced)
You can install Dapr to Kubernetes cluster using a Helm chart.
#### Install Dapr to Kubernetes
1. Make sure Helm is initialized in your running Kubernetes cluster.
2. Add Azure Container Registry as a Helm repo
```bash
helm repo add dapr https://actionscore.azurecr.io/helm/v1/repo \
--username 390401a7-d7a6-46da-b10f-3ceff7a1cdd5 \
--password 485b3522-59bb-4152-8938-ca8b90108af6
```
3. Install the Dapr chart on your cluster in the `dapr-system` namespace
```bash
helm install actionscore/dapr-operator --name dapr --namespace dapr-system
```
#### Verify installation
Once the chart installation is complete, verify the dapr-operator, dapr-placement and dapr-sidecar-injector pods are running in the `dapr-system` namespace:
```bash
$ kubectl get pods -n dapr-system -w
NAME READY STATUS RESTARTS AGE
dapr-operator-7bd6cbf5bf-xglsr 1/1 Running 0 40s
dapr-placement-7f8f76778f-6vhl2 1/1 Running 0 40s
dapr-sidecar-injector-8555576b6f-29cqm 1/1 Running 0 40s
```
#### Uninstall Dapr on Kubernetes
```bash
helm del -n dapr
```
> **Note:** See [here](https://github.com/dapr/dapr/blob/master/charts/dapr-operator/README.md) for details on Dapr helm charts.

View File

@ -1,3 +0,0 @@
# documentation
Content for this file to be added

View File

@ -1,3 +0,0 @@
# documentation
Content for this file to be added