Class: Clusters::Kubernetes::ConfigureIstioIngressService

Inherits:
Object
  • Object
show all
Defined in:
app/services/clusters/kubernetes/configure_istio_ingress_service.rb

Constant Summary collapse

PASSTHROUGH_RESOURCE =
Kubeclient::Resource.new(
  mode: 'PASSTHROUGH'
).freeze
MTLS_RESOURCE =
Kubeclient::Resource.new(
  mode: 'MUTUAL',
  privateKey: '/etc/istio/ingressgateway-certs/tls.key',
  serverCertificate: '/etc/istio/ingressgateway-certs/tls.crt',
  caCertificates: '/etc/istio/ingressgateway-ca-certs/cert.pem'
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(cluster:) ⇒ ConfigureIstioIngressService

Returns a new instance of ConfigureIstioIngressService.


19
20
21
22
23
24
# File 'app/services/clusters/kubernetes/configure_istio_ingress_service.rb', line 19

def initialize(cluster:)
  @cluster = cluster
  @platform = cluster.platform
  @kubeclient = platform.kubeclient
  @knative = cluster.application_knative
end

Instance Method Details

#executeObject


26
27
28
29
30
31
32
33
34
# File 'app/services/clusters/kubernetes/configure_istio_ingress_service.rb', line 26

def execute
  return configure_certificates if serverless_domain_cluster

  configure_passthrough
rescue Kubeclient::HttpError => e
  knative.make_errored!(_('Kubernetes error: %{error_code}') % { error_code: e.error_code })
rescue StandardError
  knative.make_errored!(_('Failed to update.'))
end