diff options
author | João Cunha <j.a.cunha@gmail.com> | 2019-06-30 14:22:41 +0100 |
---|---|---|
committer | João Cunha <j.a.cunha@gmail.com> | 2019-07-02 17:13:01 +0100 |
commit | 0c79dae16569f7ca3effbf3dba7ad95efe5f90de (patch) | |
tree | ec21a2c6ceb41e02de5e764eb623aa6235e80429 | |
parent | e07ebe66af957c46e7c69329b3ab561bb539351b (diff) | |
download | gitlab-ce-0c79dae16569f7ca3effbf3dba7ad95efe5f90de.tar.gz |
Enable GitLabb runner to be uninstalled from cluster
- Set as uninstallable app
- Update docs
- Adjust specs
4 files changed, 14 insertions, 9 deletions
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb index f0256ff4d41..599a100471c 100644 --- a/app/models/clusters/applications/runner.rb +++ b/app/models/clusters/applications/runner.rb @@ -17,6 +17,8 @@ module Clusters default_value_for :version, VERSION + after_destroy :destroy_ci_runner + def chart "#{name}/gitlab-runner" end @@ -29,13 +31,6 @@ module Clusters content_values.to_yaml end - # Need to investigate if pipelines run by this runner will stop upon the - # executor pod stopping - # I.e.run a pipeline, and uninstall runner while pipeline is running - def allowed_to_uninstall? - false - end - def install_command Gitlab::Kubernetes::Helm::InstallCommand.new( name: name, @@ -49,6 +44,10 @@ module Clusters private + def destroy_ci_runner + runner.destroy + end + def ensure_runner runner || create_and_assign_runner end diff --git a/changelogs/unreleased/60666-kubernetes-applications-uninstall-runner.yml b/changelogs/unreleased/60666-kubernetes-applications-uninstall-runner.yml new file mode 100644 index 00000000000..3632c8eec20 --- /dev/null +++ b/changelogs/unreleased/60666-kubernetes-applications-uninstall-runner.yml @@ -0,0 +1,5 @@ +--- +title: Allow GitLab Runner to be uninstalled from the UI +merge_request: 30176 +author: +type: added diff --git a/doc/user/clusters/applications.md b/doc/user/clusters/applications.md index 469a7c09250..efad57c94ec 100644 --- a/doc/user/clusters/applications.md +++ b/doc/user/clusters/applications.md @@ -251,6 +251,7 @@ The applications below can be uninstalled. | Application | GitLab version | Notes | | ----------- | -------------- | ----- | +| GitLab Runner | 12.2+ | Any running pipelines will be canceled. | | Ingress | 12.1+ | The associated load balancer and IP will be deleted and cannot be restored. Furthermore, it can only be uninstalled if JupyterHub is not installed. | | JupyterHub | 12.1+ | All data not committed to GitLab will be deleted and cannot be restored. | | Prometheus | 11.11+ | All data will be deleted and cannot be restored. | @@ -278,7 +279,7 @@ Error: remote error: tls: bad certificate To avoid installation errors: - Before starting the installation of applications, make sure that time is synchronized - between your GitLab server and your Kubernetes cluster. +between your GitLab server and your Kubernetes cluster. - Ensure certificates are not out of sync. When installing applications, GitLab expects a new cluster with no previous installation of Helm. You can confirm that the certificates match via `kubectl`: diff --git a/spec/models/clusters/applications/runner_spec.rb b/spec/models/clusters/applications/runner_spec.rb index 4f0cd0efe9c..b99f2e13675 100644 --- a/spec/models/clusters/applications/runner_spec.rb +++ b/spec/models/clusters/applications/runner_spec.rb @@ -18,7 +18,7 @@ describe Clusters::Applications::Runner do subject { gitlab_runner.can_uninstall? } - it { is_expected.to be_falsey } + it { is_expected.to be_truthy } end describe '#install_command' do |