Skip to content

Commit

Permalink
[Update step] update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas2lee committed Dec 14, 2019
1 parent d8e59b8 commit 7bc7b7a
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Provision your needed ibm cloud service with terraform (is possible)
# Provision your needed ibm cloud service with terraform (if possible) & ibmcloud cli

1. create api key for terraform
1. Create api key for terraform

ibmcloud iam api-key-create <api-key-name> -d 'ibmcloud api key for terraform' --file ibmcloud_apikey.json
1. create static tf variables
1. Create static tf variables

provider.tf
```hcl-terraform
provider "ibm" {
ibmcloud_api_key = "<api-key>"
}
```
[Terrafrom ibm cloud doc ref](https://ibm-cloud.github.io/tf-ibm-docs/index.html#using-terraform-with-the-ibm-cloud-provider)
## kubernetes cluster
provider.tf
Should replace the <api-key> by the value created in the previous step
[Example provider.tf](streaming/provider.tf)
[Get started with terrafrom & ibm cloud](https://ibm-cloud.github.io/tf-ibm-docs/index.html#using-terraform-with-the-ibm-cloud-provider)
## Create kubernetes cluster with terraform
main.tf
```hcl-terraform
resource "ibm_container_cluster" "streaming_kubernetes_cluster" {
name = "streaming"
Expand All @@ -22,11 +25,25 @@
hardware = "shared"
}
```
[Example main.tf](streaming/main.tf)
Init terraform env

terraform init

Simulate wht you want to do, not execute in ibm cloud

terraform plan

Execute what you define, and according to your payable or not resource, you may need to pay what you create, so be careful for what you do

terraform apply
## Create namespace for private docker registry via ibmcloud cr plugin
Before run this command, make sure you have installed the plugin ibmcloud cr

## namespace for docker registry
ibmcloud cr namespace-add <namespace>
## ibm event stream
## Ibm event stream
The free offer if only available in dallas region. No any possible way to create ibm event stream instance automatically.
## toolchain
## Toolchain

# Terraform ibm cloud provider document
[Example & Doc](https://ibm-cloud.github.io/tf-ibm-docs/index.html)

0 comments on commit 7bc7b7a

Please sign in to comment.