Commit bbf31849 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'ak/remove-kibana' into 'master'

Remove kibana from elastic stack

See merge request gitlab-org/gitlab!22780
parents d20a0afb 3b5aaea0
...@@ -222,9 +222,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity ...@@ -222,9 +222,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
elasticStackInstalled() { elasticStackInstalled() {
return this.applications.elastic_stack.status === APPLICATION_STATUS.INSTALLED; return this.applications.elastic_stack.status === APPLICATION_STATUS.INSTALLED;
}, },
elasticStackKibanaHostname() {
return this.applications.elastic_stack.kibana_hostname;
},
knative() { knative() {
return this.applications.knative; return this.applications.knative;
}, },
...@@ -681,9 +678,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity ...@@ -681,9 +678,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
:uninstall-successful="applications.elastic_stack.uninstallSuccessful" :uninstall-successful="applications.elastic_stack.uninstallSuccessful"
:uninstall-failed="applications.elastic_stack.uninstallFailed" :uninstall-failed="applications.elastic_stack.uninstallFailed"
:disabled="!helmInstalled" :disabled="!helmInstalled"
:install-application-request-params="{
kibana_hostname: applications.elastic_stack.kibana_hostname,
}"
title-link="https://github.com/helm/charts/tree/master/stable/elastic-stack" title-link="https://github.com/helm/charts/tree/master/stable/elastic-stack"
> >
<div slot="description"> <div slot="description">
...@@ -694,40 +688,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity ...@@ -694,40 +688,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
) )
}} }}
</p> </p>
<template v-if="ingressExternalEndpoint">
<div class="form-group">
<label for="elastic-stack-kibana-hostname">{{
s__('ClusterIntegration|Kibana Hostname')
}}</label>
<div class="input-group">
<input
v-model="applications.elastic_stack.kibana_hostname"
:readonly="elasticStackInstalled"
type="text"
class="form-control js-hostname"
/>
<span class="input-group-btn">
<clipboard-button
:text="elasticStackKibanaHostname"
:title="s__('ClusterIntegration|Copy Kibana Hostname')"
class="js-clipboard-btn"
/>
</span>
</div>
<p v-if="ingressInstalled" class="form-text text-muted">
{{
s__(`ClusterIntegration|Replace this with your own hostname if you want.
If you do so, point hostname to Ingress IP Address from above.`)
}}
<a :href="ingressDnsHelpPath" target="_blank" rel="noopener noreferrer">
{{ __('More information') }}
</a>
</p>
</div>
</template>
</div> </div>
</application-row> </application-row>
</div> </div>
......
...@@ -5,7 +5,6 @@ import { ...@@ -5,7 +5,6 @@ import {
JUPYTER, JUPYTER,
KNATIVE, KNATIVE,
CERT_MANAGER, CERT_MANAGER,
ELASTIC_STACK,
CROSSPLANE, CROSSPLANE,
RUNNER, RUNNER,
APPLICATION_INSTALLED_STATUSES, APPLICATION_INSTALLED_STATUSES,
...@@ -97,7 +96,6 @@ export default class ClusterStore { ...@@ -97,7 +96,6 @@ export default class ClusterStore {
elastic_stack: { elastic_stack: {
...applicationInitialState, ...applicationInitialState,
title: s__('ClusterIntegration|Elastic Stack'), title: s__('ClusterIntegration|Elastic Stack'),
kibana_hostname: null,
}, },
}, },
environments: [], environments: [],
...@@ -236,12 +234,6 @@ export default class ClusterStore { ...@@ -236,12 +234,6 @@ export default class ClusterStore {
} else if (appId === RUNNER) { } else if (appId === RUNNER) {
this.state.applications.runner.version = version; this.state.applications.runner.version = version;
this.state.applications.runner.updateAvailable = updateAvailable; this.state.applications.runner.updateAvailable = updateAvailable;
} else if (appId === ELASTIC_STACK) {
this.state.applications.elastic_stack.kibana_hostname = this.updateHostnameIfUnset(
this.state.applications.elastic_stack.kibana_hostname,
serverAppEntry.kibana_hostname,
'kibana',
);
} }
}); });
} }
......
...@@ -47,7 +47,7 @@ class Clusters::ApplicationsController < Clusters::BaseController ...@@ -47,7 +47,7 @@ class Clusters::ApplicationsController < Clusters::BaseController
end end
def cluster_application_params def cluster_application_params
params.permit(:application, :hostname, :kibana_hostname, :email, :stack, :modsecurity_enabled) params.permit(:application, :hostname, :email, :stack, :modsecurity_enabled)
end end
def cluster_application_destroy_params def cluster_application_destroy_params
......
...@@ -15,24 +15,15 @@ module Clusters ...@@ -15,24 +15,15 @@ module Clusters
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
include ::Gitlab::Utils::StrongMemoize include ::Gitlab::Utils::StrongMemoize
default_value_for :version, VERSION include IgnorableColumns
ignore_column :kibana_hostname, remove_with: '12.8', remove_after: '2020-01-22'
def set_initial_status
return unless not_installable?
return unless cluster&.application_ingress_available?
ingress = cluster.application_ingress default_value_for :version, VERSION
self.status = status_states[:installable] if ingress.external_ip_or_hostname?
end
def chart def chart
'stable/elastic-stack' 'stable/elastic-stack'
end end
def values
content_values.to_yaml
end
def install_command def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new( Gitlab::Kubernetes::Helm::InstallCommand.new(
name: 'elastic-stack', name: 'elastic-stack',
...@@ -78,24 +69,6 @@ module Clusters ...@@ -78,24 +69,6 @@ module Clusters
private private
def specification
{
"kibana" => {
"ingress" => {
"hosts" => [kibana_hostname],
"tls" => [{
"hosts" => [kibana_hostname],
"secretName" => "kibana-cert"
}]
}
}
}
end
def content_values
YAML.load_file(chart_values_file).deep_merge!(specification)
end
def post_delete_script def post_delete_script
[ [
Gitlab::Kubernetes::KubectlCmd.delete("pvc", "--selector", "release=elastic-stack") Gitlab::Kubernetes::KubectlCmd.delete("pvc", "--selector", "release=elastic-stack")
......
...@@ -42,7 +42,7 @@ module Clusters ...@@ -42,7 +42,7 @@ module Clusters
end end
def allowed_to_uninstall? def allowed_to_uninstall?
external_ip_or_hostname? && application_jupyter_nil_or_installable? && application_elastic_stack_nil_or_installable? external_ip_or_hostname? && application_jupyter_nil_or_installable?
end end
def install_command def install_command
...@@ -155,10 +155,6 @@ module Clusters ...@@ -155,10 +155,6 @@ module Clusters
def application_jupyter_nil_or_installable? def application_jupyter_nil_or_installable?
cluster.application_jupyter.nil? || cluster.application_jupyter&.installable? cluster.application_jupyter.nil? || cluster.application_jupyter&.installable?
end end
def application_elastic_stack_nil_or_installable?
cluster.application_elastic_stack.nil? || cluster.application_elastic_stack&.installable?
end
end end
end end
end end
...@@ -8,7 +8,6 @@ class ClusterApplicationEntity < Grape::Entity ...@@ -8,7 +8,6 @@ class ClusterApplicationEntity < Grape::Entity
expose :external_ip, if: -> (e, _) { e.respond_to?(:external_ip) } expose :external_ip, if: -> (e, _) { e.respond_to?(:external_ip) }
expose :external_hostname, if: -> (e, _) { e.respond_to?(:external_hostname) } expose :external_hostname, if: -> (e, _) { e.respond_to?(:external_hostname) }
expose :hostname, if: -> (e, _) { e.respond_to?(:hostname) } expose :hostname, if: -> (e, _) { e.respond_to?(:hostname) }
expose :kibana_hostname, if: -> (e, _) { e.respond_to?(:kibana_hostname) }
expose :email, if: -> (e, _) { e.respond_to?(:email) } expose :email, if: -> (e, _) { e.respond_to?(:email) }
expose :stack, if: -> (e, _) { e.respond_to?(:stack) } expose :stack, if: -> (e, _) { e.respond_to?(:stack) }
expose :modsecurity_enabled, if: -> (e, _) { e.respond_to?(:modsecurity_enabled) } expose :modsecurity_enabled, if: -> (e, _) { e.respond_to?(:modsecurity_enabled) }
......
...@@ -19,10 +19,6 @@ module Clusters ...@@ -19,10 +19,6 @@ module Clusters
application.hostname = params[:hostname] application.hostname = params[:hostname]
end end
if application.has_attribute?(:kibana_hostname)
application.kibana_hostname = params[:kibana_hostname]
end
if application.has_attribute?(:email) if application.has_attribute?(:email)
application.email = params[:email] application.email = params[:email]
end end
......
...@@ -3824,9 +3824,6 @@ msgstr "" ...@@ -3824,9 +3824,6 @@ msgstr ""
msgid "ClusterIntegration|Copy Jupyter Hostname" msgid "ClusterIntegration|Copy Jupyter Hostname"
msgstr "" msgstr ""
msgid "ClusterIntegration|Copy Kibana Hostname"
msgstr ""
msgid "ClusterIntegration|Copy Knative Endpoint" msgid "ClusterIntegration|Copy Knative Endpoint"
msgstr "" msgstr ""
...@@ -4043,9 +4040,6 @@ msgstr "" ...@@ -4043,9 +4040,6 @@ msgstr ""
msgid "ClusterIntegration|Key pair name" msgid "ClusterIntegration|Key pair name"
msgstr "" msgstr ""
msgid "ClusterIntegration|Kibana Hostname"
msgstr ""
msgid "ClusterIntegration|Knative" msgid "ClusterIntegration|Knative"
msgstr "" msgstr ""
......
...@@ -181,11 +181,8 @@ shared_examples "installing applications on a cluster" do ...@@ -181,11 +181,8 @@ shared_examples "installing applications on a cluster" do
context 'when user installs Elastic Stack' do context 'when user installs Elastic Stack' do
before do before do
allow(ClusterInstallAppWorker).to receive(:perform_async) allow(ClusterInstallAppWorker).to receive(:perform_async)
allow(ClusterWaitForIngressIpAddressWorker).to receive(:perform_in)
allow(ClusterWaitForIngressIpAddressWorker).to receive(:perform_async)
create(:clusters_applications_helm, :installed, cluster: cluster) create(:clusters_applications_helm, :installed, cluster: cluster)
create(:clusters_applications_ingress, :installed, external_ip: '127.0.0.1', cluster: cluster)
page.within('.js-cluster-application-row-elastic_stack') do page.within('.js-cluster-application-row-elastic_stack') do
click_button 'Install' click_button 'Install'
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
"external_ip": { "type": ["string", "null"] }, "external_ip": { "type": ["string", "null"] },
"external_hostname": { "type": ["string", "null"] }, "external_hostname": { "type": ["string", "null"] },
"hostname": { "type": ["string", "null"] }, "hostname": { "type": ["string", "null"] },
"kibana_hostname": { "type": ["string", "null"] },
"email": { "type": ["string", "null"] }, "email": { "type": ["string", "null"] },
"stack": { "type": ["string", "null"] }, "stack": { "type": ["string", "null"] },
"modsecurity_enabled": { "type": ["boolean", "null"] }, "modsecurity_enabled": { "type": ["boolean", "null"] },
......
...@@ -199,7 +199,7 @@ describe('Applications', () => { ...@@ -199,7 +199,7 @@ describe('Applications', () => {
prometheus: { title: 'Prometheus' }, prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub', hostname: '' }, jupyter: { title: 'JupyterHub', hostname: '' },
knative: { title: 'Knative', hostname: '' }, knative: { title: 'Knative', hostname: '' },
elastic_stack: { title: 'Elastic Stack', kibana_hostname: '' }, elastic_stack: { title: 'Elastic Stack' },
}, },
}); });
...@@ -433,79 +433,33 @@ describe('Applications', () => { ...@@ -433,79 +433,33 @@ describe('Applications', () => {
}); });
describe('Elastic Stack application', () => { describe('Elastic Stack application', () => {
describe('with ingress installed with ip & elastic stack installable', () => { describe('with elastic stack installable', () => {
it('renders hostname active input', () => { it('renders hostname active input', () => {
vm = mountComponent(Applications, { vm = mountComponent(Applications, {
applications: { applications: {
...APPLICATIONS_MOCK_STATE, ...APPLICATIONS_MOCK_STATE,
ingress: {
title: 'Ingress',
status: 'installed',
externalIp: '1.1.1.1',
},
}, },
}); });
expect( expect(
vm.$el vm.$el
.querySelector('.js-cluster-application-row-elastic_stack .js-hostname') .querySelector(
.getAttribute('readonly'), '.js-cluster-application-row-elastic_stack .js-cluster-application-install-button',
).toEqual(null); )
.getAttribute('disabled'),
).toEqual('disabled');
}); });
}); });
describe('with ingress installed without external ip', () => { describe('elastic stack installed', () => {
it('does not render hostname input', () => { it('renders uninstall button', () => {
vm = mountComponent(Applications, { vm = mountComponent(Applications, {
applications: { applications: {
...APPLICATIONS_MOCK_STATE, ...APPLICATIONS_MOCK_STATE,
ingress: { title: 'Ingress', status: 'installed' }, elastic_stack: { title: 'Elastic Stack', status: 'installed' },
}, },
}); });
expect(vm.$el.querySelector('.js-cluster-application-row-elastic_stack .js-hostname')).toBe(
null,
);
});
});
describe('with ingress & elastic stack installed', () => {
it('renders readonly input', () => {
vm = mountComponent(Applications, {
applications: {
...APPLICATIONS_MOCK_STATE,
ingress: {
title: 'Ingress',
status: 'installed',
externalIp: '1.1.1.1',
modsecurity_enabled: false,
},
elastic_stack: { title: 'Elastic Stack', status: 'installed', kibana_hostname: '' },
},
});
expect(
vm.$el
.querySelector('.js-cluster-application-row-elastic_stack .js-hostname')
.getAttribute('readonly'),
).toEqual('readonly');
});
});
describe('without ingress installed', () => {
beforeEach(() => {
vm = mountComponent(Applications, {
applications: APPLICATIONS_MOCK_STATE,
});
});
it('does not render input', () => {
expect(vm.$el.querySelector('.js-cluster-application-row-elastic_stack .js-hostname')).toBe(
null,
);
});
it('renders disabled install button', () => {
expect( expect(
vm.$el vm.$el
.querySelector( .querySelector(
......
...@@ -157,7 +157,7 @@ const APPLICATIONS_MOCK_STATE = { ...@@ -157,7 +157,7 @@ const APPLICATIONS_MOCK_STATE = {
prometheus: { title: 'Prometheus' }, prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub', status: 'installable', hostname: '' }, jupyter: { title: 'JupyterHub', status: 'installable', hostname: '' },
knative: { title: 'Knative ', status: 'installable', hostname: '' }, knative: { title: 'Knative ', status: 'installable', hostname: '' },
elastic_stack: { title: 'Elastic Stack', status: 'installable', kibana_hostname: '' }, elastic_stack: { title: 'Elastic Stack', status: 'installable' },
}; };
export { CLUSTERS_MOCK_DATA, DEFAULT_APPLICATION_STATE, APPLICATIONS_MOCK_STATE }; export { CLUSTERS_MOCK_DATA, DEFAULT_APPLICATION_STATE, APPLICATIONS_MOCK_STATE };
...@@ -167,7 +167,6 @@ describe('Clusters Store', () => { ...@@ -167,7 +167,6 @@ describe('Clusters Store', () => {
installFailed: true, installFailed: true,
statusReason: mockResponseData.applications[7].status_reason, statusReason: mockResponseData.applications[7].status_reason,
requestReason: null, requestReason: null,
kibana_hostname: '',
installed: false, installed: false,
uninstallable: false, uninstallable: false,
uninstallSuccessful: false, uninstallSuccessful: false,
...@@ -216,16 +215,5 @@ describe('Clusters Store', () => { ...@@ -216,16 +215,5 @@ describe('Clusters Store', () => {
`jupyter.${store.state.applications.ingress.externalIp}.nip.io`, `jupyter.${store.state.applications.ingress.externalIp}.nip.io`,
); );
}); });
it('sets default hostname for elastic stack when ingress has a ip address', () => {
const mockResponseData =
CLUSTERS_MOCK_DATA.GET['/gitlab-org/gitlab-shell/clusters/2/status.json'].data;
store.updateStateFromServer(mockResponseData);
expect(store.state.applications.elastic_stack.kibana_hostname).toEqual(
`kibana.${store.state.applications.ingress.externalIp}.nip.io`,
);
});
}); });
}); });
...@@ -10,45 +10,8 @@ describe Clusters::Applications::ElasticStack do ...@@ -10,45 +10,8 @@ describe Clusters::Applications::ElasticStack do
include_examples 'cluster application version specs', :clusters_applications_elastic_stack include_examples 'cluster application version specs', :clusters_applications_elastic_stack
include_examples 'cluster application helm specs', :clusters_applications_elastic_stack include_examples 'cluster application helm specs', :clusters_applications_elastic_stack
describe '#can_uninstall?' do
let(:ingress) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') }
let(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
subject { elastic_stack.can_uninstall? }
it { is_expected.to be_truthy }
end
describe '#set_initial_status' do
before do
elastic_stack.set_initial_status
end
context 'when ingress is not installed' do
let(:cluster) { create(:cluster, :provided_by_gcp) }
let(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: cluster) }
it { expect(elastic_stack).to be_not_installable }
end
context 'when ingress is installed and external_ip is assigned' do
let(:ingress) { create(:clusters_applications_ingress, :installed, external_ip: '127.0.0.1') }
let(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
it { expect(elastic_stack).to be_installable }
end
context 'when ingress is installed and external_hostname is assigned' do
let(:ingress) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') }
let(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
it { expect(elastic_stack).to be_installable }
end
end
describe '#install_command' do describe '#install_command' do
let!(:ingress) { create(:clusters_applications_ingress, :installed, external_ip: '127.0.0.1') } let!(:elastic_stack) { create(:clusters_applications_elastic_stack) }
let!(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
subject { elastic_stack.install_command } subject { elastic_stack.install_command }
...@@ -80,8 +43,7 @@ describe Clusters::Applications::ElasticStack do ...@@ -80,8 +43,7 @@ describe Clusters::Applications::ElasticStack do
end end
describe '#uninstall_command' do describe '#uninstall_command' do
let!(:ingress) { create(:clusters_applications_ingress, :installed, external_ip: '127.0.0.1') } let!(:elastic_stack) { create(:clusters_applications_elastic_stack) }
let!(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
subject { elastic_stack.uninstall_command } subject { elastic_stack.uninstall_command }
...@@ -100,19 +62,6 @@ describe Clusters::Applications::ElasticStack do ...@@ -100,19 +62,6 @@ describe Clusters::Applications::ElasticStack do
end end
end end
describe '#files' do
let!(:ingress) { create(:clusters_applications_ingress, :installed, external_ip: '127.0.0.1') }
let!(:elastic_stack) { create(:clusters_applications_elastic_stack, cluster: ingress.cluster) }
let(:values) { subject[:'values.yaml'] }
subject { elastic_stack.files }
it 'includes elastic stack specific keys in the values.yaml file' do
expect(values).to include('ELASTICSEARCH_HOSTS')
end
end
describe '#elasticsearch_client' do describe '#elasticsearch_client' do
context 'cluster is nil' do context 'cluster is nil' do
it 'returns nil' do it 'returns nil' do
......
...@@ -163,8 +163,7 @@ describe Clusters::Applications::CreateService do ...@@ -163,8 +163,7 @@ describe Clusters::Applications::CreateService do
context 'elastic stack application' do context 'elastic stack application' do
let(:params) do let(:params) do
{ {
application: 'elastic_stack', application: 'elastic_stack'
kibana_hostname: 'example.com'
} }
end end
...@@ -182,10 +181,6 @@ describe Clusters::Applications::CreateService do ...@@ -182,10 +181,6 @@ describe Clusters::Applications::CreateService do
cluster.reload cluster.reload
end.to change(cluster, :application_elastic_stack) end.to change(cluster, :application_elastic_stack)
end end
it 'sets the kibana_hostname' do
expect(subject.kibana_hostname).to eq('example.com')
end
end end
end end
......
...@@ -11,14 +11,7 @@ elasticsearch: ...@@ -11,14 +11,7 @@ elasticsearch:
replicas: 1 replicas: 1
kibana: kibana:
enabled: true enabled: false
env:
ELASTICSEARCH_HOSTS: http://elastic-stack-elasticsearch-client:9200
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
logstash: logstash:
enabled: false enabled: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment