Skip to content

Commit

Permalink
Converting the demo to use Okteto 2.0 manifest (okteto#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob MacElroy authored May 13, 2022
1 parent 3fdbf4d commit e4ef41a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 43 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ $ okteto deploy
## Develop on the Result microservice

```
$ okteto up -f result/okteto.yml
$ okteto up result
```

## Develop on the Vote microservice

```
$ okteto up -f vote/okteto.yml
$ okteto up vote
```

## Develop on the Worker microservice

```
$ okteto up -f worker/okteto.yml
$ okteto up worker
$ make start
```

Expand Down
44 changes: 19 additions & 25 deletions okteto.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,54 @@
name: microservices-demo
icon: https://github.com/okteto/microservices-demo/raw/main/vote-icon.png

build:
result:
context: result
dockerfile: result/Dockerfile

vote:
context: vote
dockerfile: vote/Dockerfile

worker:
context: worker
dockerfile: worker/Dockerfile

worker-dev:
dev:
context: worker
dockerfile: worker/Dockerfile
target: dev

deploy:
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm upgrade --install postgresql bitnami/postgresql -f postgresql/values.yml --version 10.16.2
- helm upgrade --install kafka bitnami/kafka -f kafka/values.yml --version 14.5.0
- okteto build -t okteto.dev/result:${OKTETO_GIT_COMMIT} result
- helm upgrade --install result result/chart --set image.tag=${OKTETO_GIT_COMMIT}
- okteto build -t okteto.dev/vote:${OKTETO_GIT_COMMIT} vote
- helm upgrade --install vote vote/chart --set image.tag=${OKTETO_GIT_COMMIT}
- okteto build -t okteto.dev/worker:${OKTETO_GIT_COMMIT} worker
- okteto build -t okteto.dev/worker:dev --target dev worker
- helm upgrade --install worker worker/chart --set image.tag=${OKTETO_GIT_COMMIT}
- helm upgrade --install vote vote/chart --set image=${OKTETO_BUILD_VOTE_IMAGE}
- helm upgrade --install result result/chart --set image=${OKTETO_BUILD_RESULT_IMAGE}
- helm upgrade --install worker worker/chart --set image=${OKTETO_BUILD_WORKER_IMAGE}

dev:
result:
command: nodemon server.js
vote:
command: ./mvnw spring-boot:run
sync:
- result:/app
- ./vote:/app
forward:
- 5005:5005
persistentVolume:
enabled: false
vote:
command: mvn spring-boot:run

result:
command: nodemon server.js
sync:
- vote:/app
forward:
- 5005:5005
- ./result:/app
persistentVolume:
enabled: false

worker:
image: okteto.dev/worker:dev
image: ${OKTETO_BUILD_DEV_IMAGE}
command: bash
securityContext:
capabilities:
add:
- SYS_PTRACE
- SYS_PTRACE
sync:
- worker:/app
- ./worker:/app
forward:
- 2345:2345
persistentVolume:
enabled: false

2 changes: 1 addition & 1 deletion result/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
app: result
spec:
containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
- image: {{ .Values.image }}
name: result
ports:
- containerPort: 80
Expand Down
5 changes: 1 addition & 4 deletions result/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: okteto.dev/result
tag: ""
image: okteto.dev/result
2 changes: 1 addition & 1 deletion vote/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
app: vote
spec:
containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
- image: {{ .Values.image }}
name: vote
ports:
- containerPort: 8080
Expand Down
5 changes: 1 addition & 4 deletions vote/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: okteto.dev/vote
tag: ""
image: okteto.dev/vote
2 changes: 1 addition & 1 deletion worker/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ spec:
app: worker
spec:
containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
- image: {{ .Values.image }}
name: worker
5 changes: 1 addition & 4 deletions worker/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: okteto.dev/worker
tag: ""
image: okteto.dev/worker

0 comments on commit e4ef41a

Please sign in to comment.