From 460797dec3dc143943390e86a09d6e6b45a465d8 Mon Sep 17 00:00:00 2001 From: walkafwalka <2865898-walkafwalka@users.noreply.gitlab.com> Date: Thu, 7 Mar 2019 13:51:43 -0800 Subject: [PATCH] Add support for ingress hostnames --- .../clusters/components/applications.vue | 132 ++++++++---------- .../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 + ...xternal_hostname_to_ingress_and_knative.rb | 10 ++ db/schema.rb | 4 +- doc/user/project/clusters/index.md | 43 +++--- doc/user/project/clusters/serverless/index.md | 22 +-- .../prometheus_library/nginx_ingress.md | 2 +- .../prometheus_library/nginx_ingress_vts.md | 2 +- locale/gitlab.pot | 32 ++--- .../project/operations/kubernetes/show.rb | 4 +- .../projects/clusters/applications_spec.rb | 12 +- spec/fixtures/api/schemas/cluster_status.json | 1 + .../clusters/components/applications_spec.js | 42 ++++-- .../clusters/services/mock_data.js | 2 + .../clusters/stores/clusters_store_spec.js | 2 + .../clusters/applications/ingress_spec.rb | 8 ++ .../clusters/applications/jupyter_spec.rb | 7 + .../clusters/applications/knative_spec.rb | 8 ++ spec/models/clusters/cluster_spec.rb | 1 + .../check_ingress_ip_address_service_spec.rb | 10 +- ...ress_ip_address_service_shared_examples.rb | 8 ++ 30 files changed, 236 insertions(+), 156 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 f74cd71de04..13e8617c515 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -89,53 +89,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( + return 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}.`, + `ClusterIntegration|Installing Ingress may incur additional costs. Learn more about %{pricingLink}.`, ), ), { - boldNotice: `${_.escape(s__('ClusterIntegration|Note:'))}`, - pricingLink: ` - ${_.escape(s__('ClusterIntegration|check the pricing here'))}`, + pricingLink: ` + ${_.escape(s__('ClusterIntegration|pricing'))}`, }, false, ); - - const externalIpParagraph = 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}`, - ), - ), - { - ingressHelpLink: ` - ${_.escape(s__('ClusterIntegration|More information'))} - `, - }, - false, - ); - - return ` -

- ${extraCostParagraph} -

-

- ${externalIpParagraph} -

- `; }, certManagerDescription() { return sprintf( @@ -196,11 +169,26 @@ export default { knativeUpgradeFailed() { return this.knative.status === APPLICATION_STATUS.UPDATE_ERRORED; }, - knativeExternalIp() { - return this.knative.externalIp; + knativeExternalEndpoint() { + return this.knative.externalIp || this.knative.externalHostname; + }, + knativeDescription() { + return sprintf( + _.escape( + s__( + `ClusterIntegration|Installing Knative may incur additional costs. Learn more about %{pricingLink}.`, + ), + ), + { + pricingLink: ` + ${_.escape(s__('ClusterIntegration|pricing'))}`, + }, + false, + ); }, canUpdateKnativeEndpoint() { - return this.knativeExternalIp && !this.knativeUpgradeFailed && !this.knativeUpgrading; + return this.knativeExternalEndpoint && !this.knativeUpgradeFailed && !this.knativeUpgrading; }, knativeHostname: { get() { @@ -289,31 +277,31 @@ export default { -
+ -