This repository has been archived by the owner on Mar 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Added Sentry Nulecule application on Docker, Kubernetes. #20
Open
rtnpro
wants to merge
1
commit into
projectatomic:master
Choose a base branch
from
rtnpro:sentry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM projectatomic/atomicapp:0.1.3 | ||
|
||
MAINTAINER Ratnadeep Debnath <rtnpro@redhat.com> | ||
|
||
LABEL io.projectatomic.nulecule.specversion="0.0.2" \ | ||
io.projectatomic.nulecule.providers="kubernetes,docker" | ||
|
||
ADD /Nulecule gpl-3.0.txt /application-entity/ | ||
ADD /artifacts /application-entity/artifacts |
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,68 @@ | ||
--- | ||
specversion: 0.0.2 | ||
id: sentry-atomicapp | ||
|
||
metadata: | ||
name: sentry Atomic App | ||
appversion: 1.0.0 | ||
description: This is sentry | ||
|
||
params: | ||
- name: db_user | ||
description: Database user | ||
default: sentry | ||
- name: db_pass | ||
description: Database password | ||
default: password | ||
- name: db_name | ||
description: Database name | ||
default: sentry | ||
|
||
graph: | ||
- name: postgresql | ||
params: | ||
- name: name | ||
description: Container name for postgresql | ||
default: postgres | ||
- name: image | ||
description: Container image name for postgresql | ||
default: postgres | ||
artifacts: | ||
docker: | ||
- file://artifacts/docker/postgres | ||
kubernetes: | ||
- file://artifacts/kubernetes/postgres-pod.yaml | ||
- file://artifacts/kubernetes/postgres-service.yaml | ||
|
||
- name: redis | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could some other redis atomicapp be reused? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give it a shot. |
||
params: | ||
- name: name | ||
description: Container name for redis | ||
default: redis | ||
- name: image | ||
description: Container image name for redis | ||
default: redis | ||
artifacts: | ||
docker: | ||
- file://artifacts/docker/redis | ||
kubernetes: | ||
- file://artifacts/kubernetes/redis-pod.yaml | ||
- file://artifacts/kubernetes/redis-service.yaml | ||
|
||
- name: sentry | ||
params: | ||
- name: name | ||
description: Container name for sentry | ||
default: sentry | ||
- name: image | ||
description: Container image name for sentry | ||
default: rtnpro/sentry | ||
- name: nodePort | ||
description: Host port to bind sentry service to | ||
default: 30001 | ||
artifacts: | ||
docker: | ||
- file://artifacts/docker/sentry | ||
kubernetes: | ||
- file://artifacts/kubernetes/sentry-pod.yaml | ||
- file://artifacts/kubernetes/sentry-service.yaml |
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,49 @@ | ||
# Build | ||
|
||
``` | ||
[sudo] docker build -t projectatomic/sentry . | ||
``` | ||
|
||
# Run | ||
|
||
- Copy ``answers.conf.sample`` to ``answers.conf`` and customize as needed. | ||
|
||
``` | ||
[sudo] atomic run projectatomic/sentry | ||
``` | ||
|
||
## Kubernetes | ||
|
||
Run ``kubectl get pods`` to check if the pods for ``redis``, ``postgres`` | ||
and ``sentry`` are up and running. | ||
|
||
Check info for ``sentry`` service. | ||
|
||
``` | ||
$ kubectl get services sentry | ||
NAME LABELS SELECTOR IP(S) PORT(S) | ||
sentry name=sentry name=sentry 10.254.131.20 9000/TCP | ||
``` | ||
|
||
## Docker | ||
|
||
Run ``sudo docker ps`` to check if the containers for sentry are running. | ||
|
||
``` | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
e0c500f83ea8 rtnpro/sentry "/docker-entrypoint.s" 2 seconds ago Up 2 seconds 0.0.0.0:30001->9000/tcp sentry | ||
dc6a8ef80731 redis "/entrypoint.sh redis" 3 seconds ago Up 2 seconds 6379/tcp sentry_redis | ||
0b8c51d12644 postgres "/docker-entrypoint.s" 3 seconds ago Up 3 seconds 5432/tcp sentry_postgres | ||
``` | ||
|
||
# Usage | ||
|
||
## Kubernetes | ||
|
||
- Setup sentry: ``kubectl exec -ti sentry sentry upgrade`` | ||
|
||
- Open ``http://10.254.131.20:9000`` in browser to access Sentry. | ||
|
||
## Docker | ||
- Setup sentry: ``sudo docker exec -ti sentry sentry upgrade`` | ||
- Open ``http://localhost:30001`` in browser to access Sentry. |
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,19 @@ | ||
[general] | ||
namespace=default | ||
provider=kubernetes | ||
db_user=sentry | ||
db_pass=sentry | ||
db_name=sentry | ||
|
||
[postgresql] | ||
name=postgres | ||
image=postgres | ||
|
||
[redis] | ||
name=redis | ||
image=redis | ||
|
||
[sentry] | ||
name=sentry | ||
image=rtnpro/sentry | ||
nodePort=30001 |
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 @@ | ||
docker run --name=sentry_postgres -e POSTGRES_PASSWORD=$db_pass -d $image |
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 @@ | ||
docker run --name=sentry_redis -d $image |
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 @@ | ||
docker run --name sentry --link sentry_redis:redis --link sentry_postgres:postgres --publish $nodePort:9000 -d $image |
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,18 @@ | ||
apiVersion: v1 | ||
id: postgres | ||
spec: | ||
containers: | ||
- name: $name | ||
image: $image | ||
env: | ||
- name: POSTGRES_USER | ||
value: $db_user | ||
- name: POSTGRES_PASSWORD | ||
value: $db_pass | ||
ports: | ||
- containerPort: 5432 | ||
metadata: | ||
name: postgres | ||
labels: | ||
name: postgres | ||
kind: Pod |
19 changes: 19 additions & 0 deletions
19
sentry-atomicapp/artifacts/kubernetes/postgres-service.yaml
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,19 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: $name | ||
labels: | ||
name: postgres | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 5432 | ||
targetPort: 5432 | ||
nodePort: 0 | ||
selector: | ||
name: postgres | ||
portalIP: None | ||
type: ClusterIP | ||
sessionAffinity: None | ||
status: | ||
loadBalancer: {} |
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,13 @@ | ||
apiVersion: v1 | ||
id: redis | ||
spec: | ||
containers: | ||
- name: $name | ||
image: $image | ||
ports: | ||
- containerPort: 6379 | ||
metadata: | ||
name: redis | ||
labels: | ||
name: redis | ||
kind: Pod |
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,19 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: $name | ||
labels: | ||
name: redis | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 6379 | ||
targetPort: 6379 | ||
nodePort: 0 | ||
selector: | ||
name: redis | ||
portalIP: None | ||
type: ClusterIP | ||
sessionAffinity: None | ||
status: | ||
loadBalancer: {} |
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,18 @@ | ||
apiVersion: v1 | ||
id: sentry | ||
spec: | ||
containers: | ||
- name: sentry | ||
image: rtnpro/sentry | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: POSTGRES_ENV_POSTGRES_USER | ||
value: $db_user | ||
- name: POSTGRES_ENV_POSTGRES_PASSWORD | ||
value: $db_pass | ||
metadata: | ||
name: sentry | ||
labels: | ||
name: sentry | ||
kind: Pod |
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,15 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: sentry | ||
labels: | ||
name: sentry | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 9000 | ||
targetPort: 9000 | ||
nodePort: $nodePort | ||
selector: | ||
name: sentry | ||
type: "NodePort" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this update to :latest?