Skip to content

Commit

Permalink
test: e2e withServiceMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Oct 20, 2020
1 parent 3f50b15 commit 6d58002
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Expand Up @@ -448,6 +448,25 @@ spec:
apiVersion: apps/v1
kind: Deployment
---
metadata:
labels:
app: www
name: www-monitor
namespace: sample-kosko
spec:
endpoints:
- path: /path/to/metrics
port: http
interval: 30s
namespaceSelector:
matchNames:
- sample-kosko
selector:
matchLabels:
app: www
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
---
metadata:
annotations:
kubernetes.io/ingress.class: nginx
Expand Down
3 changes: 2 additions & 1 deletion src/components/app/index.ts
Expand Up @@ -93,7 +93,8 @@ export const create = (
addWaitForPostgres(deployment);
}

if (envParams.withServiceMonitor) {
// add a service monitor in production
if (env.env === "prod" && envParams.withServiceMonitor) {
const monitor = getServiceMonitor({
namespace: envParams.namespace.name,
appName: name,
Expand Down
2 changes: 1 addition & 1 deletion templates/simple/components/www.ts
Expand Up @@ -16,7 +16,7 @@ const manifests = create("www", {
},
},
containerPort: 8080,
withMonitor: {
withServiceMonitor: {
path: "/path/to/metrics",
interval: "30s",
},
Expand Down

0 comments on commit 6d58002

Please sign in to comment.