Skip to content

Commit

Permalink
Added cleanup instructions; Fixed some issues within the template
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-kreuzberger-dtx committed Apr 6, 2020
1 parent cd70229 commit 20b3afb
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 12 deletions.
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
# Keptn Tempberry

This is an example project for [Keptn](https://keptn.sh) for [Tempberry](https://github.com/ChristianKreuzberger/tempberry).

## Prerequesits

* A Kubernetes cluster (version 1.14 or 1.15)
* A working Keptn 0.6.1 installation

## Setup

1. Specify for project name in a variable
```console
PROJECT=tempberry
```

2. Create the project using Keptn Cli
```console
keptn create project $PROJECT --shipyard=shipyard.yaml
```

3. Onboard postgres and tempberry-backend
```console
keptn create project ck-tempberry --shipyard=shipyard.yaml
keptn onboard service postgres --project=$PROJECT --chart=./postgres --deployment-strategy=direct
keptn onboard service tempberry-backend --project=$PROJECT --chart=./tempberry-backend
```

keptn onboard service postgres --project=ck-tempberry --chart=./postgres --deployment-strategy=direct
keptn onboard service tempberry-backend --project=ck-tempberry --chart=./tempberry-backend
4. And finally, send new artifacts for postgres and tempberry-backend
```console
keptn send event new-artifact --project=$PROJECT --service=postgres --image=postgres:10.4
keptn send event new-artifact --project=$PROJECT --service=tempberry-backend --image=ckreuzberger/tempberry-backend:0.1
```

send new artifacts
## Cleanup

Make sure you have set the environment variable `$PROJECT` as specified in the Setup instructions above.

```console
keptn send event new-artifact --project=ck-tempberry --service=postgres --image=postgres:10.4
keptn send event new-artifact --project=ck-tempberry --service=tempberry-backend --image=ckreuzberger/tempberry-backend:master
```
keptn delete project $PROJECT
kubectl delete namespace $PROJECT-dev $PROJECT-hardening $PROJECT-production
```

## License

See [LICENSE](LICENSE).

1 change: 1 addition & 0 deletions postgres/templates/postgres-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
template:
metadata:
labels:
app: postgres
app.kubernetes.io/name: {{ .Values.keptn.service | default "" }} # = Keptn Service Name
app.kubernetes.io/instance: "{{ .Values.keptn.service | default "" }}-{{ .Values.keptn.deployment | default "" }}"
app.kubernetes.io/component: database
Expand Down
1 change: 0 additions & 1 deletion postgres/templates/postgres-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ kind: Service
metadata:
name: postgres
spec:
type: ClusterIP
ports:
- port: 5432
selector:
Expand Down
11 changes: 7 additions & 4 deletions tempberry-backend/templates/tempberry-backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ spec:
- name: DATABASE_HOST
value: "postgres"

- name: DATABASE_PORT
value: "5432"

- name: DATABASE_URL
value: postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME)

Expand All @@ -67,15 +70,15 @@ spec:
cpu: 100m
livenessProbe:
httpGet:
path: /
port: 8080
path: /api/
port: 8000
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /
port: 8080
path: /api/
port: 8000
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 15

0 comments on commit 20b3afb

Please sign in to comment.