-
Notifications
You must be signed in to change notification settings - Fork 30
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
Showing
9 changed files
with
21 additions
and
131 deletions.
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 |
---|---|---|
@@ -1,98 +1,5 @@ | ||
# Helm: Voting App | ||
|
||
This example shows how to leverage [Okteto](https://github.com/okteto/okteto) to develop the Voting App directly in the cloud. The Voting App is deployed using raw Kubernetes manifests. | ||
|
||
Okteto works in any Kubernetes cluster by reading your local Kubernetes credentials. | ||
|
||
## Step 1: Install the Okteto CLI | ||
|
||
Install the Okteto CLI by following our [installation guides](https://github.com/okteto/okteto/blob/master/docs/installation.md). | ||
|
||
|
||
## Step 2: Deploy the chart | ||
|
||
Clone the repository and go to the `helm` folder: | ||
|
||
```console | ||
$ git clone https://github.com/okteto/samples | ||
$ cd samples/helm | ||
``` | ||
|
||
Deploy the Voting chart using the following command: | ||
```console | ||
$ helm install vote ./chart/vote | ||
``` | ||
|
||
Wait for one or two minutes until the application is running. | ||
|
||
## Step 3: Create your Okteto Environment | ||
|
||
With the app deployed, you can start your Okteto Environment by running the following command: | ||
|
||
```console | ||
$ okteto up | ||
✓ Okteto Environment activated | ||
✓ Files synchronized | ||
✓ Your Okteto Environment is ready | ||
Namespace: cindy | ||
Name: vote | ||
Forward: 8080 -> 8080 | ||
* Serving Flask app "app" (lazy loading) | ||
* Environment: production | ||
WARNING: Do not use the development server in a production environment. | ||
Use a production WSGI server instead. | ||
* Debug mode: on | ||
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit) | ||
* Restarting with stat | ||
* Debugger is active! | ||
* Debugger PIN: 899-835-619 | ||
``` | ||
|
||
The `okteto up` command will automatically start an Okteto Environment. It will also start a file synchronization service to keep your changes up to date between your local filesystem and your Okteto Environment. | ||
|
||
|
||
You can now access the Voting App at http://localhost:8080. | ||
|
||
## Step 4: Develop directly in the cloud | ||
|
||
Now things get more exciting. Open `app.py` in your favorite local IDE and modify the `getOptions` function with the following code, and save your file: | ||
|
||
```python | ||
def getOptions(): | ||
optionA = 'Otters' | ||
optionB = 'Dogs' | ||
return optionA, optionB | ||
``` | ||
|
||
Go back to the terminal and notice that flask already detected the code changes and reloaded your application. | ||
|
||
```console | ||
... | ||
* Detected change in '/src/app.py', reloading | ||
* Restarting with stat | ||
* Debugger is active! | ||
* Debugger PIN: 778-756-428 | ||
``` | ||
|
||
Go back to the browser, and reload the page. Notice how your changes are instantly applied. No commit, build or push required 😎! | ||
|
||
|
||
## Step 5: Cleanup | ||
|
||
Cancel the `okteto up` command by pressing `ctrl + c` and run the following command to remove the resources created by this guide: | ||
|
||
```console | ||
$ okteto down -v | ||
✓ Okteto Environment deactivated | ||
``` | ||
|
||
|
||
```console | ||
$ helm uninstall vote | ||
``` | ||
|
||
|
||
# Getting Started with Okteto and Helm | ||
|
||
This example shows how to leverage [Okteto](https://github.com/okteto/okteto) to develop the Voting App directly in the cloud. The Voting App is deployed using a Helm chart. | ||
|
||
This is the application used for the [Develop Helm Applications directly in Kubernetes](https://website-web-pchico83.cloud.okteto.net/blog/develop-helm-applications-directly-in-your-kubernetes-cluster/) blog post. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
# Default values for mychart. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
replicaCount: 1 | ||
|
||
image: | ||
repository: okteto/vote | ||
tag: "latest" | ||
pullPolicy: IfNotPresent | ||
|
||
service: | ||
type: NodePort | ||
port: 8080 |
This file was deleted.
Oops, something went wrong.
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,7 +1,11 @@ | ||
name: vote | ||
labels: | ||
app.kubernetes.io/name: vote | ||
command: ["python", "app.py"] | ||
workdir: /src | ||
environment: | ||
- FLASK_ENV=development | ||
forward: | ||
- 8080:8080 | ||
persistentVolume: | ||
enabled: false |