Skip to content

Commit

Permalink
Helm sample without volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
pchico83 committed Mar 30, 2020
1 parent 123eac5 commit 8015304
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 131 deletions.
99 changes: 3 additions & 96 deletions helm/README.md
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.
14 changes: 14 additions & 0 deletions helm/chart/values.yaml
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
35 changes: 0 additions & 35 deletions helm/chart/vote/values.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions helm/okteto.yml
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

0 comments on commit 8015304

Please sign in to comment.