-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c14a932
commit 91a038a
Showing
7 changed files
with
101 additions
and
1 deletion.
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,4 @@ | ||
#ignore intellig config | ||
.idea | ||
|
||
**.iml |
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 +1,34 @@ | ||
# streaming-ibmcloud-workshop | ||
# streaming-ibmcloud-workshop | ||
|
||
## prerequisite | ||
* ibmcloud cli | ||
* ibmcloud plugin container-service container-reigstry | ||
* docker | ||
* kubernetes | ||
* helm | ||
* terraform | ||
* terraform ibm cloud plugin | ||
|
||
### play with kube | ||
* docker, kubernete preinstalled | ||
* use /env/install.sh to install the rest | ||
|
||
## login with your ibm cloud account | ||
ibmcloud login (--sso(according to your case)) | ||
|
||
## provision your needed ibm cloud service with terraform (is possible) | ||
|
||
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 | ||
|
||
provider.tf | ||
```hcl-terraform | ||
provider "ibm" { | ||
ibmcloud_api_key = "<api-key>" | ||
} | ||
``` | ||
### kubernetes cluster | ||
### namespace for docker registry | ||
### toolchain |
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,30 @@ | ||
#bin/bash | ||
#========== install ibmcloud standalone cli ========== | ||
#========== ref doc: https://cloud.ibm.com/docs/cli?topic=cloud-cli-install-ibmcloud-cli&locale=en-us | ||
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
|
||
#========== install ibmcloud plugin container-service, container-registry ========== | ||
ibmcloud plugin install container-service | ||
ibmcloud plugin install container-registry | ||
|
||
#========== install helm ========== | ||
#========== ref doc: https://helm.sh/docs/intro/install/ ========== | ||
yum install -y openssl which | ||
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh | ||
chmod 700 get_helm.sh | ||
./get_helm.sh | ||
|
||
|
||
#========== install terraform ========== | ||
#========== ref doc: https://developer.ibm.com/recipes/tutorials/infrastructure-automation-with-terraform-on-ibm-cloud-iaas/ ========== | ||
yum install -y wget unzip | ||
wget https://releases.hashicorp.com/terraform/0.12.17/terraform_0.12.17_linux_amd64.zip | ||
unzip terraform_0.12.17_linux_amd64.zip | ||
mv terraform /usr/local/bin/terraform | ||
|
||
#========== install terraform ibm cloud provider========== | ||
#========== ref doc: https://github.com/IBM-Cloud/terraform-provider-ibm/releases ========== | ||
wget https://github.com/IBM-Cloud/terraform-provider-ibm/releases/download/v1.0.0/linux_amd64.zip | ||
mkdir -p $HOME/.terraform.d/plugins | ||
unzip linux_amd64.zip | ||
mv terraform-provider-ibm_v1.0.0 $HOME/.terraform.d/plugins/terraform-provider-ibm_v1.0.0 |
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,6 @@ | ||
#ignore secrets | ||
ibmcloud_apikey.json | ||
|
||
#ignore terraform files | ||
**/.terraform | ||
terraform/tfstate** |
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,17 @@ | ||
# provision your needed ibm cloud service with terraform (is possible) | ||
|
||
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 | ||
|
||
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 | ||
## namespace for docker registry | ||
## toolchain |
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,7 @@ | ||
resource "ibm_container_cluster" "streaming_kubernetes_cluster" { | ||
name = "streaming" | ||
datacenter = "dal10" | ||
machine_type = "free" | ||
hardware = "shared" | ||
|
||
} |
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,3 @@ | ||
provider "ibm" { | ||
ibmcloud_api_key = "<api-key>" | ||
} |