Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Go to version `1.10` or later.

* Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)

* Install [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)

#### Login to Azure

```
Expand All @@ -63,13 +65,13 @@ export KL_AZURE_SUBSCRIPTION_ID=$(az account show --output tsv --query id)
export KL_AZURE_TENANT_ID="$(az account show --output tsv --query tenantId)"
```

#### Service Principle for Kunlun
#### Service Principal for Kunlun

If you don't already have a service principle for Kunlun we need to create one now. If you
If you don't already have a service principal for Kunlun we need to create one now. If you
have already created one you simply need to grab its client id, see the last command in this
section.

To create/use a Service Principle for Kunlun to use to manage your resources we will first
To create/use a service principal for Kunlun to use to manage your resources we will first
capture some important values in environment variables. First we need a name for the service
principle. The below command generates a name that includes a UUID, you may choose to provide
a more memorable name:
Expand All @@ -85,7 +87,7 @@ Obviously you don't want to do this in the real world.
export KL_AZURE_CLIENT_SECRET=password
```

Now we are ready to create the service principle:
Now we are ready to create the service principal:

```
az ad sp create-for-rbac --name $KL_AZURE_APP_NAME --password $KL_AZURE_CLIENT_SECRET
Expand Down Expand Up @@ -132,21 +134,23 @@ KL_AZURE_APP_NAME=kunlun
### Analyze the Application you wish to deploy

Change into your project working directory. For our demo we will create a
new project directory:
new project directory and fetch the kunlun tool

```
mkdir kunlun-test
cd kunlun-test
go get github.com/kunlun/kun-lun
cd go/src/github.com/kun-lun/kunlun/cmd/kl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this depend on where $GOHOME is? that is there is no guarantee that it will be in the current directory. Should it be cd $GOHOME...?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left out the $GOHOME business as it's one more setting to keep track of or set. What I was wondering was if it makes sense to create a $KUNLUN_HOME and pushd the working directory for the kunlun (kl) binary/tool. I'll share that with Thomas/team.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key is that the commands in the README should work every time. Without fail. I have a tool that will actually run the commands as a test, but it will only work if they are 100% accurate steps.

GOHOME has to be set as part of the GO install. The user need not manage it as part of managing Kunlun, so once it is done, it is done.

I'm not following your suggestion re KUNLUN_HOM, but I would observe that IS an additional environment variable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking was that once the user installs Kunlun, they really have no need for go. Or GO_HOME. They need to be in the Kunlun working directory. Which is where KUNLUN_HOME came from. We don't need another environmental variable as long we make it easy to find the working directory ($HOME/go/src/github.com/kun-lun/kunlun/cmd/kl or $GO_HOME/...) both look clunky.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is true to say they need to be in Kunlun home. In fact, why are you changing to the directory at all? After the kl tool is installed you can run kl from anywhere. Indeed, since the tool outputs data into your current directory you should be running it from your project directory.

This is what the original documentation did. These two lines should not be added. They duplicate the instructions in an earlier section (Installing Kunlun from source).

I believe that if you follow those install steps the instructions work in their original format and all that should be left in this PR is the grammar/spelling changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more quick observation... as written this commands use the old kun-kun GitHub org.

```

And now we will analyze our application in order to select the correct
infrastrcuture.
And now we will analyze the application under consideration in order to select the correct
infrastructure.

```
kl analyze
```

This will ask a number of questions, for the most part you can safely use
This will ask a number of questions, and for the most part you can safely use
the defaults. You will, however, need to provide a resource group name.
This is the name of the Azure Resource Group into which Kunlun will place
all created resources (e.g. virtual machines, networks, storage). The
Expand All @@ -169,21 +173,22 @@ Users' section for more information.
### Plan the infrastructure

Now we need to convert this Kunlun spec into something that can be
used to deploy the infrastrcuture required. the `plan_infra` command
used to deploy the infrastructure required. The `plan_infra` command
will do this:

```
kl plan_infra
```

The outputs of this command are Terraform templates, which can be
found in the `infra` folder. If the gnerated Terraform is not
sufficient for your needs you can customize the plan, see the
found in the `infra` folder. If the generated Terraform output is not
sufficient for your needs you can customize the plan. Please refer to the
'Advanced Users' section below.

### Infrastrcuture Configuration

Now it is time to deploy the infrastrcuture we need. This can be done with:
Now it is time to deploy the infrastructure required for your application.
This can be done with:

```
kl apply_infra
Expand Down