Commit Graph

35 Commits

Author SHA1 Message Date
GitLab Bot 4d528bfd73 Add latest changes from gitlab-org/gitlab@master 2022-11-17 03:08:08 +00:00
GitLab Bot f5ef42977e Add latest changes from gitlab-org/gitlab@master 2022-06-22 21:08:26 +00:00
GitLab Bot 7ff36fc6e9 Add latest changes from gitlab-org/gitlab@master 2022-05-16 18:09:11 +00:00
GitLab Bot e5e0589e09 Add latest changes from gitlab-org/gitlab@master 2021-04-26 12:09:44 +00:00
GitLab Bot 5d066c532d Add latest changes from gitlab-org/gitlab@master 2020-11-09 03:09:03 +00:00
GitLab Bot eb004dc626 Add latest changes from gitlab-org/gitlab@master 2020-10-27 12:08:33 +00:00
GitLab Bot 6ae38bb3b5 Add latest changes from gitlab-org/gitlab@master 2020-10-15 12:09:06 +00:00
GitLab Bot 8d8b960cec Add latest changes from gitlab-org/gitlab@master 2020-09-10 06:08:37 +00:00
GitLab Bot ad9eb72915 Add latest changes from gitlab-org/gitlab@master 2020-08-05 21:09:40 +00:00
GitLab Bot 02b76fefbc Add latest changes from gitlab-org/gitlab@master 2020-07-24 00:09:34 +00:00
GitLab Bot 67cd2904c9 Add latest changes from gitlab-org/gitlab@master 2020-05-14 21:07:52 +00:00
GitLab Bot 4279f24a19 Add latest changes from gitlab-org/gitlab@master 2020-05-06 12:09:36 +00:00
GitLab Bot 37ae6b54ba Add latest changes from gitlab-org/gitlab@master 2020-04-28 15:09:29 +00:00
GitLab Bot 1804227b4f Add latest changes from gitlab-org/gitlab@master 2020-02-09 12:08:54 +00:00
GitLab Bot 5ad0cf2655 Add latest changes from gitlab-org/gitlab@master 2020-01-23 12:08:38 +00:00
GitLab Bot f6e985dba4 Add latest changes from gitlab-org/gitlab@master 2020-01-08 06:08:13 +00:00
GitLab Bot 3888bc4261 Add latest changes from gitlab-org/gitlab@master 2019-12-24 00:07:31 +00:00
GitLab Bot ab7cf450ba Add latest changes from gitlab-org/gitlab@master 2019-12-03 18:06:49 +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
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
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 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 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
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
Chris Baumbauer 327892b23e Add knative client to kubeclient library 2018-11-15 11:39:43 +00:00
Kamil Trzciński 9e6098a6db Merge branch 'refactor_gitlab_kube_client' into 'master'
Refactor Gitlab::KubeClient

Closes #52131

See merge request gitlab-org/gitlab-ce!22073
2018-10-25 12:02:11 +00:00
Thong Kuah a5419138fd Store version within SUPPORTED_API_GROUPS hash
This removes the ability to pass in a different version. We can instead
create a new entry in the SUPPORTED_API_GROUPS hash for a different
version if need be.
2018-10-23 23:52:34 +13:00
Thong Kuah 170071e365 DRY up *_clients methods
Build using `define_method` directly from the constant, saves us writing
api_groups strings twice.
2018-10-23 23:38:44 +13:00
Thong Kuah 27979aac0a Split hashed_clients into one per api_group
Essentially make #build_kubeclient do less.

Should be much clearer now
2018-10-23 23:36:44 +13:00
Thong Kuah 983c4a50d0 Remove api_groups from KubeClient constructor
We should have access to #core_client, #rbac_client,
and #extensions_client without having to pass in an awkward array.

Also change api_version to default_api_version, which allows us to use a
different version for an individual client. Special case for
apis/extensions which only go up to v1beta1

Makes #hashed_client private

Removes the #clients and #discover! methods which are un-used
2018-10-23 23:36:43 +13:00
Mayra Cabrera 1e4d615000 Add RoleBinding methods
Includes RoleBinding methods to Kubeclient and introduce a new lib class
to generate RoleBinding resources.

This MR is part of
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22011
2018-10-22 17:16:14 -05:00
Thong Kuah a02e35308b Always create `gitlab` service account and service account token regardless of ABAC/RBAC
This also solves the async nature of the automatic creation of default
service tokens for service accounts. It also makes explicit which
service account token we always use.

create cluster role binding only if the provider has legacy_abac
disabled.
2018-09-14 16:26:51 +12:00
Thong Kuah 8c8ccd3167 Teach GitLab how to create Secret of type ServiceAccountToken
Add create_secret to KubeClient
2018-09-14 16:26:51 +12:00
Thong Kuah 6f2ad2b604 Enable Kubernetes RBAC for GitLab Managed Apps for existing clusters 2018-09-06 10:03:38 +00:00