From 209ef3f8879b1a524ee77b18a0aa8e21f80edb97 Mon Sep 17 00:00:00 2001 From: walkafwalka <2865898-walkafwalka@users.noreply.gitlab.com> Date: Wed, 27 Feb 2019 20:28:12 -0800 Subject: Add support for ingress hostnames --- .../clusters/components/applications.vue | 153 ++++++++++----------- .../javascripts/clusters/stores/clusters_store.js | 5 + app/models/clusters/applications/ingress.rb | 1 + app/models/clusters/applications/jupyter.rb | 4 +- app/models/clusters/applications/knative.rb | 1 + app/models/clusters/cluster.rb | 1 + app/serializers/cluster_application_entity.rb | 1 + .../check_ingress_ip_address_service.rb | 16 ++- app/views/clusters/clusters/_form.html.haml | 2 +- app/views/clusters/clusters/show.html.haml | 4 +- changelogs/unreleased/ingress-hostnames.yml | 5 + ...add_external_hostname_to_ingress_and_knative.rb | 10 ++ db/schema.rb | 4 +- doc/user/project/clusters/index.md | 39 +++--- doc/user/project/clusters/serverless/index.md | 22 +-- .../prometheus_library/nginx_ingress.md | 2 +- .../prometheus_library/nginx_ingress_vts.md | 2 +- locale/gitlab.pot | 36 ++--- qa/qa/page/project/operations/kubernetes/show.rb | 4 +- .../projects/clusters/applications_spec.rb | 8 +- spec/fixtures/api/schemas/cluster_status.json | 1 + .../clusters/components/applications_spec.js | 32 ++++- spec/javascripts/clusters/services/mock_data.js | 2 + .../clusters/stores/clusters_store_spec.js | 2 + spec/models/clusters/applications/ingress_spec.rb | 8 ++ spec/models/clusters/applications/jupyter_spec.rb | 7 + spec/models/clusters/applications/knative_spec.rb | 8 ++ spec/models/clusters/cluster_spec.rb | 1 + .../check_ingress_ip_address_service_spec.rb | 10 +- ...k_ingress_ip_address_service_shared_examples.rb | 8 ++ 30 files changed, 240 insertions(+), 159 deletions(-) create mode 100644 changelogs/unreleased/ingress-hostnames.yml create mode 100644 db/migrate/20190301182457_add_external_hostname_to_ingress_and_knative.rb diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index 0cf187d4189..696788a0bd0 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -86,53 +86,26 @@ export default { ingressInstalled() { return this.applications.ingress.status === APPLICATION_STATUS.INSTALLED; }, - ingressExternalIp() { - return this.applications.ingress.externalIp; + ingressExternalEndpoint() { + return this.applications.ingress.externalIp || this.applications.ingress.externalHostname; }, certManagerInstalled() { return this.applications.cert_manager.status === APPLICATION_STATUS.INSTALLED; }, ingressDescription() { - const extraCostParagraph = sprintf( - _.escape( - s__( - `ClusterIntegration|%{boldNotice} This will add some extra resources - like a load balancer, which may incur additional costs depending on - the hosting provider your Kubernetes cluster is installed on. If you are using - Google Kubernetes Engine, you can %{pricingLink}.`, - ), - ), - { - boldNotice: `${_.escape(s__('ClusterIntegration|Note:'))}`, - pricingLink: ` - ${_.escape(s__('ClusterIntegration|check the pricing here'))}`, - }, - false, - ); - - const externalIpParagraph = sprintf( + return sprintf( _.escape( s__( - `ClusterIntegration|After installing Ingress, you will need to point your wildcard DNS - at the generated external IP address in order to view your app after it is deployed. %{ingressHelpLink}`, + `ClusterIntegration|Installing Ingress may incur additional costs. Learn more about %{pricingLink}.`, ), ), { - ingressHelpLink: ` - ${_.escape(s__('ClusterIntegration|More information'))} - `, + pricingLink: ` + ${_.escape(s__('ClusterIntegration|pricing'))}`, }, false, ); - - return ` -

- ${extraCostParagraph} -

-

- ${externalIpParagraph} -

- `; }, certManagerDescription() { return sprintf( @@ -176,8 +149,23 @@ export default { knativeInstalled() { return this.applications.knative.status === APPLICATION_STATUS.INSTALLED; }, - knativeExternalIp() { - return this.applications.knative.externalIp; + knativeExternalEndpoint() { + return this.applications.knative.externalIp || this.applications.knative.externalHostname; + }, + knativeDescription() { + return sprintf( + _.escape( + s__( + `ClusterIntegration|Installing Knative may incur additional costs. Learn more about %{pricingLink}.`, + ), + ), + { + pricingLink: ` + ${_.escape(s__('ClusterIntegration|pricing'))}`, + }, + false, + ); }, }, created() { @@ -247,30 +235,30 @@ export default { -
+ -