Skip to content

Commit

Permalink
add okteto-hello-world docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhole89 committed Mar 22, 2020
1 parent 40d546d commit 4776b16
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions okteto-hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# okteto-hello-world
Example of running [hello-world](https://hub.docker.com/r/okteto/hello-world) on
[okteto-cloud](https://cloud.okteto.com/) using pure terraform

Prerequisites
* [Terraform > 0.12](https://www.terraform.io/downloads.html)
* [Okteto Cloud account](https://cloud.okteto.com/#/login)

Steps:
1. Clone repo: `git clone [email protected]:jhole89/terraform-k8s-example.git`
2. Change to this directory: `cd okteto-hello-world`
3. Initialise terraform: `terraform init`
4. Copy tfvars template: `cp terraform.tfvars.template terraform.tfvars`
5. Fill in `terraform.tfvars` with Okteto values (found in your `okteto-kube.config` - make sure your
`okteto-kube.config` is also in your `~/.kube/config`)
6. Apply terraform plan: `tf apply --auto-approve` - you should see the following output
```
kubernetes_deployment.example_deployment: Creating...
kubernetes_deployment.example_deployment: Creation complete after 5s [id=jhole89/hello-world-deployment]
kubernetes_service.example_service: Creating...
kubernetes_service.example_service: Creation complete after 0s [id=jhole89/hello-world-service]
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Outputs:
url = https://hello-world-service-jhole89.cloud.okteto.net/
```
6. The plan outputs the `url` exposed through the kubernetes service. You can now hit the endpoint using curl:
`curl https://hello-world-service-jhole89.cloud.okteto.net/`
7. Once no longer required you can remove all resources: `terraform destroy --auto-approve`

0 comments on commit 4776b16

Please sign in to comment.