Commit Graph

91 Commits

Author SHA1 Message Date
GitLab Bot ae78b85a25 Add latest changes from gitlab-org/gitlab@master 2020-02-24 12:09:00 +00:00
GitLab Bot 82a708b9f0 Add latest changes from gitlab-org/gitlab@master 2020-02-19 06:09:21 +00:00
GitLab Bot 1804227b4f Add latest changes from gitlab-org/gitlab@master 2020-02-09 12:08:54 +00:00
GitLab Bot 26384c9a61 Add latest changes from gitlab-org/gitlab@master 2020-02-05 09:08:43 +00:00
GitLab Bot 5ad0cf2655 Add latest changes from gitlab-org/gitlab@master 2020-01-23 12:08:38 +00:00
GitLab Bot ea20020f71 Add latest changes from gitlab-org/gitlab@master 2020-01-17 06:08:39 +00:00
GitLab Bot 3888bc4261 Add latest changes from gitlab-org/gitlab@master 2019-12-24 00:07:31 +00:00
GitLab Bot 69d6d3ca20 Add latest changes from gitlab-org/gitlab@master 2019-12-16 21:08:00 +00:00
GitLab Bot 47b8f79a08 Add latest changes from gitlab-org/gitlab@master 2019-12-13 00:08:05 +00:00
GitLab Bot 784fae4b9d Add latest changes from gitlab-org/gitlab@master 2019-12-12 12:07:33 +00:00
GitLab Bot d5b4360051 Add latest changes from gitlab-org/gitlab@master 2019-11-26 03:06:24 +00:00
GitLab Bot 0a6ffb540e Add latest changes from gitlab-org/gitlab@master 2019-11-21 12:06:40 +00:00
GitLab Bot 29c01c6c91 Add latest changes from gitlab-org/gitlab@master 2019-11-14 03:06:25 +00:00
GitLab Bot 56d96ad7fa Add latest changes from gitlab-org/gitlab@master 2019-11-01 03:06:26 +00:00
GitLab Bot 8078bd185f Add latest changes from gitlab-org/gitlab@master 2019-11-01 00:06:02 +00:00
GitLab Bot 6653aab95d Add latest changes from gitlab-org/gitlab@master 2019-10-22 15:06:06 +00:00
GitLab Bot 94be244a9f Add latest changes from gitlab-org/gitlab@master 2019-10-15 03:06:19 +00:00
GitLab Bot b4e072cbaf Add latest changes from gitlab-org/gitlab@master 2019-10-11 06:06:27 +00:00
GitLab Bot 012e59c2af Add latest changes from gitlab-org/gitlab@master 2019-10-06 12:05:58 +00:00
GitLab Bot 83ad9ec8cc Add latest changes from gitlab-org/gitlab@master 2019-09-24 00:06:02 +00:00
Grzegorz Bizon 1068ec2e92 Merge branch '66741-remove-spec-rails_helper-rb' into 'master'
Remove spec/rails_helper.rb

Closes #66741

See merge request gitlab-org/gitlab-ce!32380
2019-09-03 13:48:17 +00:00
Ash McKenzie 19ff9d9899
Replace rails_helper.rb with spec_helper.rb
rails_helper.rb's only logic was to require
spec_helper.rb.
2019-08-30 12:26:18 +10:00
Thong Kuah e0826b0cb5 Override hostname when connecting via Kubeclient
Kubeclient uses rest-client. We hack into to access the net/http object
so that we can patch to connect to the resolved IP + set
hostname_override.

Add specs for discord. The discord integration also uses rest-client, so
since we patched rest-client, spec that the DNS rebinding protection
works
2019-08-21 10:49:22 +12:00
João Cunha f8821f828e Make use of Gitlab::Kubernetes
- refactor Knative and Prometheus
2019-08-14 20:02:37 +00:00
Thong Kuah b577825e54 Bump Helm to 2.14.3 and kubectl to 1.11.10 2019-08-13 00:07:27 +12:00
Tiger Watson 36a01a88ce Use separate Kubernetes namespaces per environment
Kubernetes deployments on new clusters will now have
a separate namespace per project environment, instead
of sharing a single namespace for the project.

Behaviour of existing clusters is unchanged.

All new functionality is controlled by the
:kubernetes_namespace_per_environment feature flag,
which is safe to enable/disable at any time.
2019-08-07 04:40:29 +00:00
Rémy Coutable f74387d298 Merge branch 'georgekoltsov/55474-outbound-setting-system-hooks' into 'master'
Add outbound setting for system hooks

See merge request gitlab-org/gitlab-ce!31177
2019-08-05 08:55:16 +00:00
Dylan Griffith 5027979b9b Implement Helm ResetCommand for removing Tiller
Also creates specs

Only allow Helm to be uninstalled if it's the only app

- Remove Tiller leftovers after reser command
- Fixes specs and offenses

Adds changelog file

Fix reset_command specs
2019-08-02 19:02:57 +00:00
George Koltsov e5e1c907c0 Add outbound requests setting for system hooks
This MR adds new application setting to network section
`allow_local_requests_from_system_hooks`. Prior to this change
system hooks were allowed to do local network requests by default
and we are adding an ability for admins to control it.
2019-08-02 15:39:18 +01:00
Dylan Griffith c9b0ac5fc4 GitLab Managed App ensure helm version uses tls opts
The TLS opts were missing from helm version command which meant that it
was just perpetually failing and hence wasting 30s of time waiting for a
command to be successful that was never going to be successful. This
never actually caused any errors because this loop will happily just
fail 30 times without breaking the overall script but it was just a
waste of installation time so now installing apps should be ~30s faster.
2019-07-15 11:38:40 +10:00
Hordur Freyr Yngvason 6971fd261d Give Knative serving permissions to service account
GitLab uses a kubernetes service account to perform deployments. For
serverless deployments to work as expected with externally created
clusters with their own knative installations (e.g. via Cloud Run), this
account requires additional permissions in the serving.knative.dev API
group.
2019-07-11 11:26:15 +00:00
Thong Kuah c7d50ddf55 Fix connection to Tiller error while uninstalling
Both the `install-<app>` and `uninstall-<app>` pods loads the
`values-content-configuration-<app>` configmap into the pod
(see `#volume_specification`). This configmap contains the cert
necessary to connect to Tiller. The cert though is only valid for 30
minutes.

So this fixes the bug where the configmap when uninstalling should be
updated as well.
2019-06-05 00:07:47 +12:00
Thong Kuah 33a765c17a Teach Helm::Api about #uninstall 2019-04-29 22:55:11 -07:00
Thong Kuah f8326af565 Implement commands to uninstall cluster applications
This is the backend part which just allows uninstalling Prometheus for
now.
2019-04-16 09:10:11 +10:00
Dylan Griffith c239bfcb17 Add more info logging to cluster apps
Log events so that it's easy to see
when different requests are starting.
2019-04-10 06:38:27 +00:00
Mayra Cabrera 135b78bb25 Revert "Merge branch 'bump_kubernetes_1_11_9' into 'master'"
This reverts merge request !26991
2019-04-05 20:22:50 +00:00
Douwe Maan a827092b65 Merge branch 'bump_kubernetes_1_11_9' into 'master'
Bump Helm to 2.13.1 and kubectl to 1.11.9

See merge request gitlab-org/gitlab-ce!26991
2019-04-05 09:43:46 +00:00
Thong Kuah 4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00
Thong Kuah 38b40f9164 Bump Helm to 2.13.1 and kubectl to 1.11.9 2019-04-05 00:08:11 +13:00
Yorick Peterse 03340f0987 Merge branch 'security-kubernetes-local-ssrf' into 'master'
Block local URLs for Kubernetes integration

See merge request gitlab/gitlabhq!2901
2019-03-04 18:36:50 +00:00
Thong Kuah af16fd687e Do not allow local urls in Kubernetes form
Use existing `public_url` validation to block various local urls. Note
that this validation will allow local urls if the "Allow requests to the
local network from hooks and services" admin setting is enabled.

Block KubeClient from using local addresses

It will also respect `allow_local_requests_from_hooks_and_services` so
if that is enabled KubeClinet will allow local addresses
2019-02-21 23:16:11 +13:00
Thong Kuah 8004508943 Bump helm and kubectl versions
Bump the helm and kubectl used in our Kubernetes integration, used e.g.
to install apps.

Note I have only bumped to the latest patch of the v1.11 series for
kubectl as GKE clusters are still on 1.10/1.11
2019-02-20 09:54:07 +13:00
Thong Kuah f67fc23727 Upgrade cluster applications, starting with runner 2019-02-07 21:40:55 +00:00
Thong Kuah f234aef994 Use http_max_redirects opt to replace monkeypatch
http_max_redirects was introduced in 4.2.2, so upgrade kubeclient.

The monkey-patch was global so we will have to check that all instances
of Kubeclient::Client are handled.

Spec all methods of KubeClient

This should provide better confidence that we are indeed disallowing
redirection in all cases
2019-01-25 16:48:37 +13:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Takuya Noguchi db237d8431 Update Helm to 2.12.2 to address Helm client vulnerability
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-18 09:21:47 +09:00
Thong Kuah dc18272091 Modify service so that it can be re-run
If the service fails mid-point, then we should be able to re-run this
service. So, detect presence of any previously created Kubernetes
resource and update or create accordingly.

Fix specs accordingly. In the case of finalize_creation_service_spec.rb,
I decided to stub out the async worker rather than maintaining
individual stubs for various kubeclient calls for that worker.

Also add test cases for group clusters
2018-12-04 15:46:46 +13:00
Dylan Griffith 6a66e4a1f1 Don't remove failed install pods
We want to keep failed install pods around so that it is easier to debug
why a failure occured. With this change we also need to ensure that we
remove a previous pod with the same name before installing so that
re-install does not fail.

Another change here is that we no longer need to catch errors from
delete_pod! in CheckInstallationProgressService as we now catch the
ResourceNotFoundError in Helm::Api. The catch statement in
CheckInstallationProgressService was also probably too broad before and
should have been narrowed down simply to ResourceNotFoundError.
2018-11-27 12:54:32 +01:00
Amit Rathi 2945ab47d6 Fix usage data and install command spec 2018-11-20 16:48:23 +05:30
Amit Rathi 5e59c40baa Fixing more tests 2018-11-20 12:33:45 +05:30