Class: Clusters::Applications::Knative

Inherits:
ApplicationRecord show all
Includes:
AfterCommitQueue, Concerns::ApplicationCore, Concerns::ApplicationData, Concerns::ApplicationStatus, Concerns::ApplicationVersion
Defined in:
app/models/clusters/applications/knative.rb

Overview

DEPRECATED for removal in %14.0 See gitlab.com/groups/gitlab-org/-/epics/4280

Constant Summary collapse

VERSION =
'0.10.0'
REPOSITORY =
'https://charts.gitlab.io'
METRICS_CONFIG =
'https://gitlab.com/gitlab-org/charts/knative/-/raw/v0.9.0/vendor/istio-metrics.yml'
FETCH_IP_ADDRESS_DELAY =
30.seconds
API_GROUPS_PATH =
'config/knative/api_groups.yml'

Constants included from Concerns::ApplicationVersion

Concerns::ApplicationVersion::EXTERNAL_VERSION

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods included from Concerns::ApplicationData

#files, #repository

Methods included from Concerns::ApplicationVersion

#update_available?

Methods included from Concerns::ApplicationStatus

#available?, #status_states, #update_in_progress?, #updateable?

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#allowed_to_uninstall?Boolean

Returns:

  • (Boolean)

70
71
72
# File 'app/models/clusters/applications/knative.rb', line 70

def allowed_to_uninstall?
  !pre_installed?
end

#available_domainsObject


62
63
64
# File 'app/models/clusters/applications/knative.rb', line 62

def available_domains
  PagesDomain.instance_serverless
end

#chartObject


54
55
56
# File 'app/models/clusters/applications/knative.rb', line 54

def chart
  'knative/knative'
end

#find_available_domain(pages_domain_id) ⇒ Object


66
67
68
# File 'app/models/clusters/applications/knative.rb', line 66

def find_available_domain(pages_domain_id)
  available_domains.find_by(id: pages_domain_id)
end

#ingress_serviceObject


94
95
96
# File 'app/models/clusters/applications/knative.rb', line 94

def ingress_service
  cluster.kubeclient.get_service('istio-ingressgateway', Clusters::Kubernetes::ISTIO_SYSTEM_NAMESPACE)
end

#install_commandObject


74
75
76
77
78
79
80
81
82
83
84
# File 'app/models/clusters/applications/knative.rb', line 74

def install_command
  helm_command_module::InstallCommand.new(
    name: name,
    version: VERSION,
    rbac: cluster.platform_kubernetes_rbac?,
    chart: chart,
    files: files,
    repository: REPOSITORY,
    postinstall: install_knative_metrics
  )
end

#original_set_initial_statusObject


24
# File 'app/models/clusters/applications/knative.rb', line 24

alias_method :original_set_initial_status, :set_initial_status

#schedule_status_updateObject


86
87
88
89
90
91
92
# File 'app/models/clusters/applications/knative.rb', line 86

def schedule_status_update
  return unless installed?
  return if external_ip
  return if external_hostname

  ClusterWaitForIngressIpAddressWorker.perform_async(name, id)
end

#set_initial_statusObject


25
26
27
28
29
# File 'app/models/clusters/applications/knative.rb', line 25

def set_initial_status
  return unless cluster&.platform_kubernetes_rbac?

  original_set_initial_status
end

#uninstall_commandObject


98
99
100
101
102
103
104
105
106
# File 'app/models/clusters/applications/knative.rb', line 98

def uninstall_command
  helm_command_module::DeleteCommand.new(
    name: name,
    rbac: cluster.platform_kubernetes_rbac?,
    files: files,
    predelete: delete_knative_services_and_metrics,
    postdelete: delete_knative_istio_leftovers
  )
end

#valuesObject


58
59
60
# File 'app/models/clusters/applications/knative.rb', line 58

def values
  { "domain" => hostname }.to_yaml
end