Class: Clusters::Applications::ElasticStack

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

Constant Summary collapse

VERSION =
'3.0.0'

Constants included from Concerns::ApplicationVersion

Concerns::ApplicationVersion::EXTERNAL_VERSION

Constants included from Concerns::ElasticsearchClient

Concerns::ElasticsearchClient::ELASTICSEARCH_NAMESPACE, Concerns::ElasticsearchClient::ELASTICSEARCH_PORT

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from Concerns::ApplicationData

#values

Methods included from Concerns::ApplicationVersion

#update_available?

Methods included from Concerns::ApplicationStatus

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

Methods included from Concerns::ElasticsearchClient

#elasticsearch_client

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

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

#chartObject


33
34
35
# File 'app/models/clusters/applications/elastic_stack.rb', line 33

def chart
  'elastic-stack/elastic-stack'
end

#chart_above_v2?Boolean

Returns:

  • (Boolean)

67
68
69
# File 'app/models/clusters/applications/elastic_stack.rb', line 67

def chart_above_v2?
  Gem::Version.new(version) >= Gem::Version.new('2.0.0')
end

#chart_above_v3?Boolean

Returns:

  • (Boolean)

71
72
73
# File 'app/models/clusters/applications/elastic_stack.rb', line 71

def chart_above_v3?
  Gem::Version.new(version) >= Gem::Version.new('3.0.0')
end

#filesObject


63
64
65
# File 'app/models/clusters/applications/elastic_stack.rb', line 63

def files
  super.merge('wait-for-elasticsearch.sh': File.read("#{Rails.root}/vendor/elastic_stack/wait-for-elasticsearch.sh"))
end

#install_commandObject


41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/models/clusters/applications/elastic_stack.rb', line 41

def install_command
  helm_command_module::InstallCommand.new(
    name: 'elastic-stack',
    version: VERSION,
    rbac: cluster.platform_kubernetes_rbac?,
    chart: chart,
    repository: repository,
    files: files,
    preinstall: migrate_to_3_script,
    postinstall: post_install_script
  )
end

#repositoryObject


37
38
39
# File 'app/models/clusters/applications/elastic_stack.rb', line 37

def repository
  'https://charts.gitlab.io'
end

#uninstall_commandObject


54
55
56
57
58
59
60
61
# File 'app/models/clusters/applications/elastic_stack.rb', line 54

def uninstall_command
  helm_command_module::DeleteCommand.new(
    name: 'elastic-stack',
    rbac: cluster.platform_kubernetes_rbac?,
    files: files,
    postdelete: post_delete_script
  )
end