Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEROGEAR-3075 Group apps into single one #65

Merged
merged 5 commits into from Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Jenkinsfile
Expand Up @@ -21,7 +21,7 @@ node ("ocp-slave") {

stage('Run APB test') {
apb_container_id = sh (
script: "docker run --detach --net=host --privileged -v $PWD:/mnt -v $HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $UID docker.io/ansibleplaybookbundle/apb-tools:${apb_version} test --registry-route docker-registry.default.svc:5000",
script: "docker run --detach --net=host --privileged -v \$PWD:/mnt -v \$HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u \$UID docker.io/ansibleplaybookbundle/apb-tools:${apb_version} test --registry-route docker-registry.default.svc:5000",
returnStdout: true
).trim()
}
Expand Down Expand Up @@ -50,4 +50,4 @@ node ("ocp-slave") {
error("APB test failed.")
}
}
}
}
1 change: 0 additions & 1 deletion playbooks/vars/test_defaults.yml
@@ -1,5 +1,4 @@
PROMETHEUS_STORAGE_SIZE: 10
GRAFANA_STORAGE_SIZE: 10
POSTGRES_STORAGE_SIZE: 10
POSTGRESQL_EPHEMERAL: true
encode_asb_binding: false
13 changes: 2 additions & 11 deletions roles/deprovision-metrics-apb/tasks/main.yml
@@ -1,14 +1,5 @@
- name: Delete all prometheus resources by app label (limited to buildconfig,deploymentconfig,service,imagestream,route and pod)
shell: oc delete all -l app=prometheus -n '{{ namespace }}'

- name: Delete all grafana resources by app label (limited to buildconfig,deploymentconfig,service,imagestream,route and pod)
shell: oc delete all -l app=grafana -n '{{ namespace }}'

- name: Delete all aerogear-app-metrics resources by app label (limited to buildconfig,deploymentconfig,service,imagestream,route and pod)
shell: oc delete all -l app=aerogear-app-metrics -n '{{ namespace }}'

- name: Delete all postgres resources by app label (limited to buildconfig,deploymentconfig,service,imagestream,route and pod)
shell: oc delete all -l app=postgres -n '{{ namespace }}'
- name: Delete all metrics resources by app label (limited to deploymentconfig,buildconfig,service,imagestream,route and pod)
shell: oc delete all -l app=metrics -n '{{ namespace }}'

- k8s_v1_secret:
name: '{{ prometheus_secret_name }}'
Expand Down
9 changes: 0 additions & 9 deletions roles/provision-metrics-apb/tasks/main.yml
Expand Up @@ -11,16 +11,7 @@

- include_tasks: provision-prometheus.yml
- include_tasks: provision-grafana.yml

- include_tasks: provision-app-metrics.yml
when:
- POSTGRESQL_EPHEMERAL is undefined or
not POSTGRESQL_EPHEMERAL

- include_tasks: provision-app-metrics-ephemeral.yml
when:
- POSTGRESQL_EPHEMERAL is defined or
POSTGRESQL_EPHEMERAL

# This is currently needed until https://github.com/openshift/ansible-service-broker/issues/847 is resolved
- name: "Make data availble for binding"
Expand Down

This file was deleted.

14 changes: 8 additions & 6 deletions roles/provision-metrics-apb/tasks/provision-app-metrics.yml
Expand Up @@ -3,7 +3,7 @@
name: "{{ postgres_claim_name}}"
namespace: "{{ namespace }}"
labels:
app: aerogear-app-metrics
app: metrics
service: aerogear-app-metrics
access_modes:
- ReadWriteMany
Expand All @@ -16,7 +16,7 @@
name: '{{ postgres_service_name }}'
namespace: '{{ namespace }}'
labels:
app: postgres
app: metrics
service: aerogear-app-metrics
replicas: 1
selector:
Expand Down Expand Up @@ -51,7 +51,7 @@
name: '{{ postgres_service_name }}'
namespace: '{{ namespace }}'
labels:
app: postgres
app: metrics
service: aerogear-app-metrics
selector:
app: postgres
Expand All @@ -66,7 +66,7 @@
name: aerogear-app-metrics
namespace: '{{ namespace }}'
labels:
app: aerogear-app-metrics
app: metrics
service: aerogear-app-metrics
replicas: 1
selector:
Expand Down Expand Up @@ -100,7 +100,7 @@
name: aerogear-app-metrics
namespace: '{{ namespace }}'
labels:
app: aerogear-app-metrics
app: metrics
service: aerogear-app-metrics
selector:
app: aerogear-app-metrics
Expand All @@ -112,10 +112,12 @@

- name: Create api server https route
openshift_v1_route:
annotations:
console.alpha.openshift.io/overview-app-route: 'true'
name: aerogear-app-metrics
namespace: '{{ namespace }}'
labels:
app: aerogear-app-metrics
app: metrics
service: aerogear-app-metrics
to_name: aerogear-app-metrics
spec_port_target_port: web
Expand Down
12 changes: 7 additions & 5 deletions roles/provision-metrics-apb/tasks/provision-grafana.yml
Expand Up @@ -32,7 +32,7 @@
name: '{{ grafana_claim_name }}'
namespace: "{{ namespace }}"
labels:
app: grafana
app: metrics
service: prometheus
access_modes:
- ReadWriteMany
Expand All @@ -45,7 +45,7 @@
name: grafana
namespace: '{{ namespace }}'
labels:
app: grafana
app: metrics
service: prometheus
replicas: 1
selector:
Expand Down Expand Up @@ -117,7 +117,7 @@
name: '{{ grafana_service_name }}'
namespace: '{{ namespace }}'
labels:
app: grafana
app: metrics
service: prometheus
selector:
app: grafana
Expand All @@ -132,7 +132,7 @@
name: '{{ grafana_internal_service_name }}'
namespace: '{{ namespace }}'
labels:
app: grafana
app: metrics
service: prometheus
selector:
app: grafana
Expand All @@ -145,10 +145,12 @@

- name: create grafana route
openshift_v1_route:
annotations:
console.alpha.openshift.io/overview-app-route: 'true'
name: '{{ grafana_route_name }}'
namespace: '{{ namespace }}'
labels:
app: grafana
app: metrics
service: prometheus
to_name: grafana
spec_port_target_port: web
Expand Down
12 changes: 7 additions & 5 deletions roles/provision-metrics-apb/tasks/provision-prometheus.yml
Expand Up @@ -11,7 +11,7 @@
name: '{{ prometheus_claim_name }}'
namespace: "{{ namespace }}"
labels:
app: prometheus
app: metrics
service: prometheus
access_modes:
- ReadWriteOnce
Expand All @@ -24,7 +24,7 @@
name: prometheus
namespace: '{{ namespace }}'
labels:
app: prometheus
app: metrics
service: prometheus
replicas: 1
selector:
Expand Down Expand Up @@ -75,7 +75,7 @@
name: '{{ prometheus_service_name }}'
namespace: '{{ namespace }}'
labels:
app: prometheus
app: metrics
service: prometheus
selector:
app: prometheus
Expand All @@ -90,7 +90,7 @@
name: '{{ prometheus_internal_service_name }}'
namespace: '{{ namespace }}'
labels:
app: prometheus
app: metrics
service: prometheus
selector:
app: prometheus
Expand All @@ -102,10 +102,12 @@

- name: create prometheus route
openshift_v1_route:
annotations:
console.alpha.openshift.io/overview-app-route: 'true'
name: '{{ prometheus_route_name }}'
namespace: '{{ namespace }}'
labels:
app: prometheus
app: metrics
service: prometheus
to_name: prometheus
spec_port_target_port: web
Expand Down