Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3b5aaea0
Commit
3b5aaea0
authored
Jan 13, 2020
by
Adrien Kohlbecker
Committed by
Mike Greiling
Jan 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove kibana from elastic stack
we'll do our own interface
parent
d20a0afb
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
20 additions
and
235 deletions
+20
-235
app/assets/javascripts/clusters/components/applications.vue
app/assets/javascripts/clusters/components/applications.vue
+0
-40
app/assets/javascripts/clusters/stores/clusters_store.js
app/assets/javascripts/clusters/stores/clusters_store.js
+0
-8
app/controllers/clusters/applications_controller.rb
app/controllers/clusters/applications_controller.rb
+1
-1
app/models/clusters/applications/elastic_stack.rb
app/models/clusters/applications/elastic_stack.rb
+3
-30
app/models/clusters/applications/ingress.rb
app/models/clusters/applications/ingress.rb
+1
-5
app/serializers/cluster_application_entity.rb
app/serializers/cluster_application_entity.rb
+0
-1
app/services/clusters/applications/base_service.rb
app/services/clusters/applications/base_service.rb
+0
-4
locale/gitlab.pot
locale/gitlab.pot
+0
-6
spec/features/clusters/installing_applications_shared_examples.rb
...tures/clusters/installing_applications_shared_examples.rb
+0
-3
spec/fixtures/api/schemas/cluster_status.json
spec/fixtures/api/schemas/cluster_status.json
+0
-1
spec/frontend/clusters/components/applications_spec.js
spec/frontend/clusters/components/applications_spec.js
+10
-56
spec/frontend/clusters/services/mock_data.js
spec/frontend/clusters/services/mock_data.js
+1
-1
spec/frontend/clusters/stores/clusters_store_spec.js
spec/frontend/clusters/stores/clusters_store_spec.js
+0
-12
spec/models/clusters/applications/elastic_stack_spec.rb
spec/models/clusters/applications/elastic_stack_spec.rb
+2
-53
spec/services/clusters/applications/create_service_spec.rb
spec/services/clusters/applications/create_service_spec.rb
+1
-6
vendor/elastic_stack/values.yaml
vendor/elastic_stack/values.yaml
+1
-8
No files found.
app/assets/javascripts/clusters/components/applications.vue
View file @
3b5aaea0
...
...
@@ -222,9 +222,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
elasticStackInstalled
()
{
return
this
.
applications
.
elastic_stack
.
status
===
APPLICATION_STATUS
.
INSTALLED
;
},
elasticStackKibanaHostname
()
{
return
this
.
applications
.
elastic_stack
.
kibana_hostname
;
},
knative
()
{
return
this
.
applications
.
knative
;
},
...
...
@@ -681,9 +678,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
:uninstall-successful=
"applications.elastic_stack.uninstallSuccessful"
:uninstall-failed=
"applications.elastic_stack.uninstallFailed"
: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"
>
<div
slot=
"description"
>
...
...
@@ -694,40 +688,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
)
}}
</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>
</application-row>
</div>
...
...
app/assets/javascripts/clusters/stores/clusters_store.js
View file @
3b5aaea0
...
...
@@ -5,7 +5,6 @@ import {
JUPYTER
,
KNATIVE
,
CERT_MANAGER
,
ELASTIC_STACK
,
CROSSPLANE
,
RUNNER
,
APPLICATION_INSTALLED_STATUSES
,
...
...
@@ -97,7 +96,6 @@ export default class ClusterStore {
elastic_stack
:
{
...
applicationInitialState
,
title
:
s__
(
'
ClusterIntegration|Elastic Stack
'
),
kibana_hostname
:
null
,
},
},
environments
:
[],
...
...
@@ -236,12 +234,6 @@ export default class ClusterStore {
}
else
if
(
appId
===
RUNNER
)
{
this
.
state
.
applications
.
runner
.
version
=
version
;
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
'
,
);
}
});
}
...
...
app/controllers/clusters/applications_controller.rb
View file @
3b5aaea0
...
...
@@ -47,7 +47,7 @@ class Clusters::ApplicationsController < Clusters::BaseController
end
def
cluster_application_params
params
.
permit
(
:application
,
:hostname
,
:
kibana_hostname
,
:
email
,
:stack
,
:modsecurity_enabled
)
params
.
permit
(
:application
,
:hostname
,
:email
,
:stack
,
:modsecurity_enabled
)
end
def
cluster_application_destroy_params
...
...
app/models/clusters/applications/elastic_stack.rb
View file @
3b5aaea0
...
...
@@ -15,24 +15,15 @@ module Clusters
include
::
Clusters
::
Concerns
::
ApplicationData
include
::
Gitlab
::
Utils
::
StrongMemoize
default_value_for
:version
,
VERSION
def
set_initial_status
return
unless
not_installable?
return
unless
cluster
&
.
application_ingress_available?
include
IgnorableColumns
ignore_column
:kibana_hostname
,
remove_with:
'12.8'
,
remove_after:
'2020-01-22'
ingress
=
cluster
.
application_ingress
self
.
status
=
status_states
[
:installable
]
if
ingress
.
external_ip_or_hostname?
end
default_value_for
:version
,
VERSION
def
chart
'stable/elastic-stack'
end
def
values
content_values
.
to_yaml
end
def
install_command
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name:
'elastic-stack'
,
...
...
@@ -78,24 +69,6 @@ module Clusters
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
[
Gitlab
::
Kubernetes
::
KubectlCmd
.
delete
(
"pvc"
,
"--selector"
,
"release=elastic-stack"
)
...
...
app/models/clusters/applications/ingress.rb
View file @
3b5aaea0
...
...
@@ -42,7 +42,7 @@ module Clusters
end
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
def
install_command
...
...
@@ -155,10 +155,6 @@ module Clusters
def
application_jupyter_nil_or_installable?
cluster
.
application_jupyter
.
nil?
||
cluster
.
application_jupyter
&
.
installable?
end
def
application_elastic_stack_nil_or_installable?
cluster
.
application_elastic_stack
.
nil?
||
cluster
.
application_elastic_stack
&
.
installable?
end
end
end
end
app/serializers/cluster_application_entity.rb
View file @
3b5aaea0
...
...
@@ -8,7 +8,6 @@ class ClusterApplicationEntity < Grape::Entity
expose
:external_ip
,
if:
->
(
e
,
_
)
{
e
.
respond_to?
(
:external_ip
)
}
expose
:external_hostname
,
if:
->
(
e
,
_
)
{
e
.
respond_to?
(
:external_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
:stack
,
if:
->
(
e
,
_
)
{
e
.
respond_to?
(
:stack
)
}
expose
:modsecurity_enabled
,
if:
->
(
e
,
_
)
{
e
.
respond_to?
(
:modsecurity_enabled
)
}
...
...
app/services/clusters/applications/base_service.rb
View file @
3b5aaea0
...
...
@@ -19,10 +19,6 @@ module Clusters
application
.
hostname
=
params
[
:hostname
]
end
if
application
.
has_attribute?
(
:kibana_hostname
)
application
.
kibana_hostname
=
params
[
:kibana_hostname
]
end
if
application
.
has_attribute?
(
:email
)
application
.
email
=
params
[
:email
]
end
...
...
locale/gitlab.pot
View file @
3b5aaea0
...
...
@@ -3824,9 +3824,6 @@ msgstr ""
msgid "ClusterIntegration|Copy Jupyter Hostname"
msgstr ""
msgid "ClusterIntegration|Copy Kibana Hostname"
msgstr ""
msgid "ClusterIntegration|Copy Knative Endpoint"
msgstr ""
...
...
@@ -4043,9 +4040,6 @@ msgstr ""
msgid "ClusterIntegration|Key pair name"
msgstr ""
msgid "ClusterIntegration|Kibana Hostname"
msgstr ""
msgid "ClusterIntegration|Knative"
msgstr ""
...
...
spec/features/clusters/installing_applications_shared_examples.rb
View file @
3b5aaea0
...
...
@@ -181,11 +181,8 @@ shared_examples "installing applications on a cluster" do
context
'when user installs Elastic Stack'
do
before
do
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_ingress
,
:installed
,
external_ip:
'127.0.0.1'
,
cluster:
cluster
)
page
.
within
(
'.js-cluster-application-row-elastic_stack'
)
do
click_button
'Install'
...
...
spec/fixtures/api/schemas/cluster_status.json
View file @
3b5aaea0
...
...
@@ -35,7 +35,6 @@
"external_ip"
:
{
"type"
:
[
"string"
,
"null"
]
},
"external_hostname"
:
{
"type"
:
[
"string"
,
"null"
]
},
"hostname"
:
{
"type"
:
[
"string"
,
"null"
]
},
"kibana_hostname"
:
{
"type"
:
[
"string"
,
"null"
]
},
"email"
:
{
"type"
:
[
"string"
,
"null"
]
},
"stack"
:
{
"type"
:
[
"string"
,
"null"
]
},
"modsecurity_enabled"
:
{
"type"
:
[
"boolean"
,
"null"
]
},
...
...
spec/frontend/clusters/components/applications_spec.js
View file @
3b5aaea0
...
...
@@ -199,7 +199,7 @@ describe('Applications', () => {
prometheus
:
{
title
:
'
Prometheus
'
},
jupyter
:
{
title
:
'
JupyterHub
'
,
hostname
:
''
},
knative
:
{
title
:
'
Knative
'
,
hostname
:
''
},
elastic_stack
:
{
title
:
'
Elastic Stack
'
,
kibana_hostname
:
''
},
elastic_stack
:
{
title
:
'
Elastic Stack
'
},
},
});
...
...
@@ -433,79 +433,33 @@ describe('Applications', () => {
});
describe
(
'
Elastic Stack application
'
,
()
=>
{
describe
(
'
with
ingress installed with ip &
elastic stack installable
'
,
()
=>
{
describe
(
'
with elastic stack installable
'
,
()
=>
{
it
(
'
renders hostname active input
'
,
()
=>
{
vm
=
mountComponent
(
Applications
,
{
applications
:
{
...
APPLICATIONS_MOCK_STATE
,
ingress
:
{
title
:
'
Ingress
'
,
status
:
'
installed
'
,
externalIp
:
'
1.1.1.1
'
,
},
},
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-cluster-application-row-elastic_stack .js-hostname
'
)
.
getAttribute
(
'
readonly
'
),
).
toEqual
(
null
);
});
});
describe
(
'
with ingress installed without external ip
'
,
()
=>
{
it
(
'
does not render hostname input
'
,
()
=>
{
vm
=
mountComponent
(
Applications
,
{
applications
:
{
...
APPLICATIONS_MOCK_STATE
,
ingress
:
{
title
:
'
Ingress
'
,
status
:
'
installed
'
},
},
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-cluster-application-row-elastic_stack .js-hostname
'
)).
toBe
(
null
,
);
.
querySelector
(
'
.js-cluster-application-row-elastic_stack .js-cluster-application-install-button
'
,
)
.
getAttribute
(
'
disabled
'
),
).
toEqual
(
'
disabled
'
);
});
});
describe
(
'
with ingress &
elastic stack installed
'
,
()
=>
{
it
(
'
renders
readonly input
'
,
()
=>
{
describe
(
'
elastic stack installed
'
,
()
=>
{
it
(
'
renders
uninstall button
'
,
()
=>
{
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
:
''
},
elastic_stack
:
{
title
:
'
Elastic Stack
'
,
status
:
'
installed
'
},
},
});
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
(
vm
.
$el
.
querySelector
(
...
...
spec/frontend/clusters/services/mock_data.js
View file @
3b5aaea0
...
...
@@ -157,7 +157,7 @@ const APPLICATIONS_MOCK_STATE = {
prometheus
:
{
title
:
'
Prometheus
'
},
jupyter
:
{
title
:
'
JupyterHub
'
,
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
};
spec/frontend/clusters/stores/clusters_store_spec.js
View file @
3b5aaea0
...
...
@@ -167,7 +167,6 @@ describe('Clusters Store', () => {
installFailed
:
true
,
statusReason
:
mockResponseData
.
applications
[
7
].
status_reason
,
requestReason
:
null
,
kibana_hostname
:
''
,
installed
:
false
,
uninstallable
:
false
,
uninstallSuccessful
:
false
,
...
...
@@ -216,16 +215,5 @@ describe('Clusters Store', () => {
`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`
,
);
});
});
});
spec/models/clusters/applications/elastic_stack_spec.rb
View file @
3b5aaea0
...
...
@@ -10,45 +10,8 @@ describe Clusters::Applications::ElasticStack do
include_examples
'cluster application version 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
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!
(
:elastic_stack
)
{
create
(
:clusters_applications_elastic_stack
)
}
subject
{
elastic_stack
.
install_command
}
...
...
@@ -80,8 +43,7 @@ describe Clusters::Applications::ElasticStack do
end
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
,
cluster:
ingress
.
cluster
)
}
let!
(
:elastic_stack
)
{
create
(
:clusters_applications_elastic_stack
)
}
subject
{
elastic_stack
.
uninstall_command
}
...
...
@@ -100,19 +62,6 @@ describe Clusters::Applications::ElasticStack do
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
context
'cluster is nil'
do
it
'returns nil'
do
...
...
spec/services/clusters/applications/create_service_spec.rb
View file @
3b5aaea0
...
...
@@ -163,8 +163,7 @@ describe Clusters::Applications::CreateService do
context
'elastic stack application'
do
let
(
:params
)
do
{
application:
'elastic_stack'
,
kibana_hostname:
'example.com'
application:
'elastic_stack'
}
end
...
...
@@ -182,10 +181,6 @@ describe Clusters::Applications::CreateService do
cluster
.
reload
end
.
to
change
(
cluster
,
:application_elastic_stack
)
end
it
'sets the kibana_hostname'
do
expect
(
subject
.
kibana_hostname
).
to
eq
(
'example.com'
)
end
end
end
...
...
vendor/elastic_stack/values.yaml
View file @
3b5aaea0
...
...
@@ -11,14 +11,7 @@ elasticsearch:
replicas
:
1
kibana
:
enabled
:
true
env
:
ELASTICSEARCH_HOSTS
:
http://elastic-stack-elasticsearch-client:9200
ingress
:
enabled
:
true
annotations
:
kubernetes.io/ingress.class
:
"
nginx"
kubernetes.io/tls-acme
:
"
true"
enabled
:
false
logstash
:
enabled
:
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment