Fix bug 1547: Add ingress.class annotation to OSM charms 93/10893/3
authorDavid Garcia <david.garcia@canonical.com>
Thu, 27 May 2021 14:06:20 +0000 (16:06 +0200)
committerbeierlm <mark.beierl@canonical.com>
Tue, 1 Jun 2021 16:41:33 +0000 (18:41 +0200)
Change-Id: I436a536929ec5f511721a77a55ee4bb55892d057
Signed-off-by: David Garcia <david.garcia@canonical.com>
installers/charm/grafana/src/charm.py
installers/charm/kafka-exporter/src/charm.py
installers/charm/keystone/src/charm.py
installers/charm/mongodb-exporter/src/charm.py
installers/charm/mysqld-exporter/src/charm.py
installers/charm/nbi/src/charm.py
installers/charm/ng-ui/src/charm.py
installers/charm/prometheus/src/charm.py

index bf6fbd9..a7cc036 100755 (executable)
@@ -175,6 +175,7 @@ class GrafanaCharm(CharmedOsmBase):
                     if config.max_file_size > 0
                     else config.max_file_size
                 ),
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
index 123fa0b..3b599a8 100755 (executable)
@@ -194,7 +194,7 @@ class KafkaExporterCharm(CharmedOsmBase):
         # Add ingress resources to PodSpec if site url exists
         if config.site_url:
             parsed = urlparse(config.site_url)
-            annotations = {}
+            annotations = {"kubernetes.io/ingress.class": "public"}
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index b5ce0cc..6693080 100755 (executable)
@@ -365,6 +365,7 @@ class KeystoneCharm(CharmedOsmBase):
                     if config.max_file_size > 0
                     else config.max_file_size
                 ),
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
index fd318fa..a2b9471 100755 (executable)
@@ -214,7 +214,7 @@ class MongodbExporterCharm(CharmedOsmBase):
         # Add ingress resources to PodSpec if site url exists
         if config.site_url:
             parsed = urlparse(config.site_url)
-            annotations = {}
+            annotations = {"kubernetes.io/ingress.class": "public"}
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index 2ae7d83..85a1e67 100755 (executable)
@@ -210,7 +210,7 @@ class MysqlExporterCharm(CharmedOsmBase):
         # Add ingress resources to PodSpec if site url exists
         if config.site_url:
             parsed = urlparse(config.site_url)
-            annotations = {}
+            annotations = {"kubernetes.io/ingress.class": "public"}
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index bbbf5ec..0af4104 100755 (executable)
@@ -249,6 +249,7 @@ class NbiCharm(CharmedOsmBase):
                     else config.max_file_size
                 ),
                 "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
index 5efaaae..1c53163 100755 (executable)
@@ -149,6 +149,7 @@ class NgUiCharm(CharmedOsmBase):
                     if config.max_file_size > 0
                     else config.max_file_size
                 ),
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
index 5fdee72..cf4f956 100755 (executable)
@@ -197,6 +197,7 @@ class PrometheusCharm(CharmedOsmBase):
                     if config.max_file_size > 0
                     else config.max_file_size
                 ),
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations