From 108a42cbbdbfc8094d1d8bf8d0d8826adfdf760d Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 22 May 2017 09:42:19 -0700 Subject: Create logging deployments with non-zero replica counts When we currently create the set of logging `DeploymentConfig`s, we create them with zero desired replicas. This causes the deployment to immediately succeed as there is no work to be done. This inhibits our ability to use nice CLI UX features like `oc rollout status` to monitor the logging stack deployments. Instead, we should can create the configs with the correct number of replicas in the first place and stop using `oc scale` to bring them up after the fact. Signed-off-by: Steve Kuznetsov --- roles/openshift_logging_curator/tasks/main.yaml | 11 +---------- roles/openshift_logging_curator/templates/curator.j2 | 2 +- roles/openshift_logging_elasticsearch/tasks/main.yaml | 9 +-------- roles/openshift_logging_elasticsearch/templates/es.j2 | 2 +- roles/openshift_logging_kibana/tasks/main.yaml | 10 +--------- roles/openshift_logging_kibana/templates/kibana.j2 | 2 +- roles/openshift_logging_mux/tasks/main.yaml | 10 +--------- roles/openshift_logging_mux/templates/mux.j2 | 2 +- 8 files changed, 8 insertions(+), 40 deletions(-) (limited to 'roles') diff --git a/roles/openshift_logging_curator/tasks/main.yaml b/roles/openshift_logging_curator/tasks/main.yaml index 1ee380610..ae7e48caa 100644 --- a/roles/openshift_logging_curator/tasks/main.yaml +++ b/roles/openshift_logging_curator/tasks/main.yaml @@ -91,7 +91,7 @@ es_port: "{{ openshift_logging_curator_es_port }}" curator_cpu_limit: "{{ openshift_logging_curator_cpu_limit }}" curator_memory_limit: "{{ openshift_logging_curator_memory_limit }}" - replicas: "{{ openshift_logging_curator_replicas | default (0)}}" + replicas: "{{ openshift_logging_curator_replicas | default (1) }}" curator_node_selector: "{{openshift_logging_curator_nodeselector | default({})}}" check_mode: no changed_when: no @@ -106,15 +106,6 @@ - "{{ tempdir }}/templates/curator-dc.yaml" delete_after: true -# scale up -- name: Start Curator - oc_scale: - kind: dc - name: "{{ curator_name }}" - namespace: "{{ openshift_logging_namespace }}" - replicas: "{{ openshift_logging_curator_replicas | default (1) }}" - - - name: Delete temp directory file: name: "{{ tempdir }}" diff --git a/roles/openshift_logging_curator/templates/curator.j2 b/roles/openshift_logging_curator/templates/curator.j2 index db991e4a9..f8b84861f 100644 --- a/roles/openshift_logging_curator/templates/curator.j2 +++ b/roles/openshift_logging_curator/templates/curator.j2 @@ -7,7 +7,7 @@ metadata: component: "{{component}}" logging-infra: "{{logging_component}}" spec: - replicas: {{replicas|default(0)}} + replicas: {{replicas|default(1)}} selector: provider: openshift component: "{{component}}" diff --git a/roles/openshift_logging_elasticsearch/tasks/main.yaml b/roles/openshift_logging_elasticsearch/tasks/main.yaml index 1c1e33c92..8310b1b9b 100644 --- a/roles/openshift_logging_elasticsearch/tasks/main.yaml +++ b/roles/openshift_logging_elasticsearch/tasks/main.yaml @@ -256,6 +256,7 @@ es_memory_limit: "{{ openshift_logging_elasticsearch_memory_limit }}" es_node_selector: "{{ openshift_logging_elasticsearch_nodeselector | default({}) }}" deploy_type: "{{ openshift_logging_elasticsearch_deployment_type }}" + replicas: 1 - name: Set ES dc oc_obj: @@ -267,14 +268,6 @@ - "{{ tempdir }}/templates/logging-es-dc.yml" delete_after: true -# scale up -- name: Start Elasticsearch - oc_scale: - kind: dc - name: "{{ es_deploy_name }}" - namespace: "{{ openshift_logging_elasticsearch_namespace }}" - replicas: 1 - ## Placeholder for migration when necessary ## - name: Delete temp directory diff --git a/roles/openshift_logging_elasticsearch/templates/es.j2 b/roles/openshift_logging_elasticsearch/templates/es.j2 index d2db8432e..e129205ca 100644 --- a/roles/openshift_logging_elasticsearch/templates/es.j2 +++ b/roles/openshift_logging_elasticsearch/templates/es.j2 @@ -8,7 +8,7 @@ metadata: deployment: "{{deploy_name}}" logging-infra: "{{logging_component}}" spec: - replicas: {{replicas|default(0)}} + replicas: {{replicas|default(1)}} selector: provider: openshift component: "{{component}}" diff --git a/roles/openshift_logging_kibana/tasks/main.yaml b/roles/openshift_logging_kibana/tasks/main.yaml index 3bc903181..4444413e1 100644 --- a/roles/openshift_logging_kibana/tasks/main.yaml +++ b/roles/openshift_logging_kibana/tasks/main.yaml @@ -210,7 +210,7 @@ kibana_memory_limit: "{{ openshift_logging_kibana_memory_limit }}" kibana_proxy_cpu_limit: "{{ openshift_logging_kibana_proxy_cpu_limit }}" kibana_proxy_memory_limit: "{{ openshift_logging_kibana_proxy_memory_limit }}" - replicas: "{{ openshift_logging_kibana_replicas | default (0) }}" + replicas: "{{ openshift_logging_kibana_replicas | default (1) }}" kibana_node_selector: "{{ openshift_logging_kibana_nodeselector | default({}) }}" - name: Set Kibana DC @@ -223,14 +223,6 @@ - "{{ tempdir }}/templates/kibana-dc.yaml" delete_after: true -# Scale up Kibana -- is this really necessary? -- name: Start Kibana - oc_scale: - kind: dc - name: "{{ kibana_name }}" - namespace: "{{ openshift_logging_namespace }}" - replicas: "{{ openshift_logging_kibana_replicas | default (1) }}" - # update master configs? - name: Delete temp directory diff --git a/roles/openshift_logging_kibana/templates/kibana.j2 b/roles/openshift_logging_kibana/templates/kibana.j2 index ea506b12b..2298aa6d5 100644 --- a/roles/openshift_logging_kibana/templates/kibana.j2 +++ b/roles/openshift_logging_kibana/templates/kibana.j2 @@ -7,7 +7,7 @@ metadata: component: "{{ component }}" logging-infra: "{{ logging_component }}" spec: - replicas: {{ replicas | default(0) }} + replicas: {{ replicas | default(1) }} selector: provider: openshift component: "{{ component }}" diff --git a/roles/openshift_logging_mux/tasks/main.yaml b/roles/openshift_logging_mux/tasks/main.yaml index 907bb0098..e64a4d275 100644 --- a/roles/openshift_logging_mux/tasks/main.yaml +++ b/roles/openshift_logging_mux/tasks/main.yaml @@ -172,7 +172,7 @@ ops_port: "{{ openshift_logging_mux_ops_port }}" mux_cpu_limit: "{{ openshift_logging_mux_cpu_limit }}" mux_memory_limit: "{{ openshift_logging_mux_memory_limit }}" - replicas: "{{ openshift_logging_mux_replicas | default(0) }}" + replicas: "{{ openshift_logging_mux_replicas | default(1) }}" mux_node_selector: "{{ openshift_logging_mux_nodeselector | default({}) }}" check_mode: no changed_when: no @@ -187,14 +187,6 @@ - "{{ tempdir }}/templates/logging-mux-dc.yaml" delete_after: true -# Scale up Mux -- name: Start Mux - oc_scale: - kind: dc - name: "logging-mux" - namespace: "{{ openshift_logging_mux_namespace }}" - replicas: "{{ openshift_logging_mux_replicas | default (1) }}" - - name: Delete temp directory file: name: "{{ tempdir }}" diff --git a/roles/openshift_logging_mux/templates/mux.j2 b/roles/openshift_logging_mux/templates/mux.j2 index 84b8ff53d..770a2bfbd 100644 --- a/roles/openshift_logging_mux/templates/mux.j2 +++ b/roles/openshift_logging_mux/templates/mux.j2 @@ -7,7 +7,7 @@ metadata: component: "{{component}}" logging-infra: "{{logging_component}}" spec: - replicas: {{replicas|default(0)}} + replicas: {{replicas|default(1)}} selector: provider: openshift component: "{{component}}" -- cgit v1.2.3 From 2740dff958cb3c619ca508d83edb3b351f83c31d Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 22 May 2017 09:45:09 -0700 Subject: Add a readiness probe to the Kibana container In order to ensure that the Kubernetes machinery can determine when the Kibana Pods are becoming ready, we need to add a readiness probe to the Containers that make up those pods. The Kibana readiness probe simply hits the base URL at `http://localhost:5601/` and expects a 200. Signed-off-by: Steve Kuznetsov --- roles/openshift_logging_kibana/templates/kibana.j2 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'roles') diff --git a/roles/openshift_logging_kibana/templates/kibana.j2 b/roles/openshift_logging_kibana/templates/kibana.j2 index 2298aa6d5..f8043812b 100644 --- a/roles/openshift_logging_kibana/templates/kibana.j2 +++ b/roles/openshift_logging_kibana/templates/kibana.j2 @@ -63,6 +63,13 @@ spec: - name: kibana mountPath: /etc/kibana/keys readOnly: true + readinessProbe: + exec: + command: + - "/usr/share/kibana/probe/readiness.sh" + initialDelaySeconds: 5 + timeoutSeconds: 4 + periodSeconds: 5 - name: "kibana-proxy" image: {{ proxy_image }} -- cgit v1.2.3