Browse Source

Add prometheus & grafana container image tags

To upgrade cluster we need to be able to set image tags
so this change adds to labels for corresponding containers

Task: 23314
Story: 2003171

Change-Id: I4cd0270a69fb889c59bdb28966821adb11fd0292
tags/8.0.0.0rc1
Sergey Filatov 10 months ago
parent
commit
0cf61dfb74

+ 1
- 1
doc/source/user/index.rst View File

@@ -1075,7 +1075,7 @@ _`container_infra_prefix`
1075 1075
   Images that must be mirrored:
1076 1076
 
1077 1077
   * docker.io/coredns/coredns:1.0.1
1078
-  * docker.io/grafana/grafana:latest
1078
+  * docker.io/grafana/grafana:5.1.5
1079 1079
   * docker.io/openstackmagnum/kubernetes-apiserver
1080 1080
   * docker.io/openstackmagnum/kubernetes-controller-manager
1081 1081
   * docker.io/openstackmagnum/kubernetes-kubelet

+ 2
- 2
magnum/drivers/common/templates/kubernetes/fragments/enable-prometheus-monitoring.sh View File

@@ -220,7 +220,7 @@ spec:
220 220
       serviceAccountName: prometheus
221 221
       containers:
222 222
       - name: prometheus
223
-        image: ${CONTAINER_INFRA_PREFIX:-docker.io/prom/}prometheus:v1.8.2
223
+        image: ${CONTAINER_INFRA_PREFIX:-docker.io/prom/}prometheus:${PROMETHEUS_TAG}
224 224
         args:
225 225
           - '-storage.local.retention=6h'
226 226
           - '-storage.local.memory-chunks=500000'
@@ -314,7 +314,7 @@ spec:
314 314
         role: db
315 315
     spec:
316 316
       containers:
317
-        - image: ${CONTAINER_INFRA_PREFIX:-docker.io/grafana/}grafana:4.6.3
317
+        - image: ${CONTAINER_INFRA_PREFIX:-docker.io/grafana/}grafana:${GRAFANA_TAG}
318 318
           imagePullPolicy: Always
319 319
           name: grafana
320 320
           env:

+ 2
- 0
magnum/drivers/common/templates/kubernetes/fragments/write-heat-params-master.yaml View File

@@ -76,3 +76,5 @@ write_files:
76 76
       OCTAVIA_ENABLED="$OCTAVIA_ENABLED"
77 77
       KUBE_SERVICE_ACCOUNT_KEY="$KUBE_SERVICE_ACCOUNT_KEY"
78 78
       KUBE_SERVICE_ACCOUNT_PRIVATE_KEY="$KUBE_SERVICE_ACCOUNT_PRIVATE_KEY"
79
+      PROMETHEUS_TAG="$PROMETHEUS_TAG"
80
+      GRAFANA_TAG="$GRAFANA_TAG"

+ 3
- 1
magnum/drivers/heat/k8s_fedora_template_def.py View File

@@ -109,7 +109,9 @@ class K8sFedoraTemplateDefinition(k8s_template_def.K8sTemplateDefinition):
109 109
                       'calico_tag', 'calico_cni_tag',
110 110
                       'calico_kube_controllers_tag', 'calico_ipv4pool',
111 111
                       'etcd_tag', 'flannel_tag',
112
-                      'cloud_provider_enabled']
112
+                      'cloud_provider_enabled',
113
+                      'prometheus_tag',
114
+                      'grafana_tag']
113 115
 
114 116
         for label in label_list:
115 117
             label_value = cluster.labels.get(label)

+ 12
- 0
magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml View File

@@ -494,6 +494,16 @@ parameters:
494 494
     description: Enable or disable the openstack kubernetes cloud provider
495 495
     default: true
496 496
 
497
+  prometheus_tag:
498
+    type: string
499
+    description: tag of the prometheus container
500
+    default: v1.8.2
501
+
502
+  grafana_tag:
503
+    type: string
504
+    description: tag of grafana container
505
+    default: 5.1.5
506
+
497 507
 resources:
498 508
 
499 509
   ######################################################################
@@ -718,6 +728,8 @@ resources:
718 728
           octavia_enabled: {get_param: octavia_enabled}
719 729
           kube_service_account_key: {get_param: kube_service_account_key}
720 730
           kube_service_account_private_key: {get_param: kube_service_account_private_key}
731
+          prometheus_tag: {get_param: prometheus_tag}
732
+          grafana_tag: {get_param: grafana_tag}
721 733
 
722 734
 
723 735
   ######################################################################

+ 10
- 0
magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml View File

@@ -391,6 +391,14 @@ parameters:
391 391
     type: boolean
392 392
     description: Enable or disable the openstack kubernetes cloud provider
393 393
 
394
+  prometheus_tag:
395
+    type: string
396
+    description: tag of prometheus container
397
+
398
+  grafana_tag:
399
+    type: string
400
+    description: tag of grafana container
401
+
394 402
 resources:
395 403
 
396 404
   master_wait_handle:
@@ -501,6 +509,8 @@ resources:
501 509
             "$OCTAVIA_ENABLED": {get_param: octavia_enabled}
502 510
             "$KUBE_SERVICE_ACCOUNT_KEY": {get_param: kube_service_account_key}
503 511
             "$KUBE_SERVICE_ACCOUNT_PRIVATE_KEY": {get_param: kube_service_account_private_key}
512
+            "$PROMETHEUS_TAG": {get_param: prometheus_tag}
513
+            "$GRAFANA_TAG": {get_param: grafana_tag}
504 514
 
505 515
   install_openstack_ca:
506 516
     type: OS::Heat::SoftwareConfig

+ 12
- 0
magnum/tests/unit/drivers/test_template_definition.py View File

@@ -373,6 +373,10 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
373 373
             'cloud_provider_enabled')
374 374
         service_cluster_ip_range = mock_cluster.labels.get(
375 375
             'service_cluster_ip_range')
376
+        prometheus_tag = mock_cluster.labels.get(
377
+            'prometheus_tag')
378
+        grafana_tag = mock_cluster.labels.get(
379
+            'grafana_tag')
376 380
 
377 381
         k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition()
378 382
 
@@ -423,6 +427,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
423 427
             'kube_service_account_key': 'public_key',
424 428
             'kube_service_account_private_key': 'private_key',
425 429
             'portal_network_cidr': service_cluster_ip_range,
430
+            'prometheus_tag': prometheus_tag,
431
+            'grafana_tag': grafana_tag,
426 432
         }}
427 433
         mock_get_params.assert_called_once_with(mock_context,
428 434
                                                 mock_cluster_template,
@@ -546,6 +552,10 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
546 552
             'cloud_provider_enabled')
547 553
         service_cluster_ip_range = mock_cluster.labels.get(
548 554
             'service_cluster_ip_range')
555
+        prometheus_tag = mock_cluster.labels.get(
556
+            'prometheus_tag')
557
+        grafana_tag = mock_cluster.labels.get(
558
+            'grafana_tag')
549 559
 
550 560
         k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition()
551 561
 
@@ -598,6 +608,8 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
598 608
             'kube_service_account_key': 'public_key',
599 609
             'kube_service_account_private_key': 'private_key',
600 610
             'portal_network_cidr': service_cluster_ip_range,
611
+            'prometheus_tag': prometheus_tag,
612
+            'grafana_tag': grafana_tag,
601 613
         }}
602 614
         mock_get_params.assert_called_once_with(mock_context,
603 615
                                                 mock_cluster_template,

+ 5
- 0
releasenotes/notes/grafana_prometheus_tag_label-78540ea106677485.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+features:
3
+  - |
4
+    Add 'grafana_tag' and 'prometheus_tag' labels for the k8s_fedora_atomic driver.
5
+    Grafana defaults to 5.1.5 and Prometheus defaults to v1.8.2.

Loading…
Cancel
Save