Commit graph

19 commits

Author SHA1 Message Date
GitLab Bot
33813f993b Add latest changes from gitlab-org/gitlab@master 2019-10-24 12:06:03 +00:00
GitLab Bot
e464f195ff Add latest changes from gitlab-org/gitlab@master 2019-10-14 12:06:14 +00:00
Thong Kuah
90aafe78ae Removes clusters_cte feature flag
This has been enabled on production without issue

https://gitlab.com/gitlab-org/gitlab-ce/issues/64259
2019-07-17 20:01:08 +12:00
Thong Kuah
3bc76511a0 Create CTE query for clusters hierarchy
- This enables us to use a scope to query all clusters in group
hierarchy order in one query, and also enables us to union to instance
clusters later.

- Handle case where clusters not present at level. In which case the
query should go ahead and return the next level's clusters.

- Swap with new CTE query behind Feature flag. This FF is default
disabled.
2019-07-08 06:03:09 +00:00
Thong Kuah
8152efbe2f Remove instance_clusters feature_flag
Now we have terminals for instance and group clusters we can remove the
FF now. Deploying to instance clusters has been working without
complaints too.
2019-06-28 01:24:05 +12:00
Thong Kuah
3f759e1674 Remove group_clusters feature flag
Now we have terminals for instance and group clusters we can remove the
FF now. Deploying to group clusters has been working without complaints
too.
2019-06-28 00:28:03 +12:00
Tiger
da5c00d1c6 Remove Kubernetes service from deployment platform
This will no longer be used for deployments, as all
service templates have been migrated to clusters.
2019-06-21 11:35:13 +10:00
James Fargher
0aeef7335f Convert instance level clusters enabled to class method 2019-05-07 08:37:04 +12:00
James Fargher
8db382b055 Allow projects to use instance level clusters
There are two cluster hierarchies one for the deployment platform and
one for controllers. The main difference is that deployment platforms do
not check user permissions and only return the first match.
2019-05-07 08:37:03 +12:00
Thong Kuah
ebf87fd9c2 Unify into :group_clusters feature flag
With this MR, group clusters is now functional, so default to enabled.

Have a single setting on the root ancestor group to enabled or disable
group clusters feature as a whole
2018-12-05 10:16:44 +13:00
Thong Kuah
f85440e63c Various improvements to hierarchy sorting
- Rename ordered_group_clusters_for_project ->
ancestor_clusters_for_clusterable
- Improve name of order option. It makes much more sense to have `hierarchy_order: :asc`
and `hierarchy_order: :desc`
- Allow ancestor_clusters_for_clusterable for group
- Re-use code already present in Project
2018-12-05 10:16:44 +13:00
Thong Kuah
5bb2814ae6 Deploy to clusters for a project's groups
Look for matching clusters starting from the closest ancestor, then go
up the ancestor tree.

Then use Ruby to get clusters for each group in order. Not that
efficient, considering we will doing up to `NUMBER_OF_ANCESTORS_ALLOWED`
number of queries, but it's a finite number

Explicitly order query by depth

This allows us to control ordering explicitly and also to reverse the
order which is useful to allow us to be consistent with
Clusters::Cluster.on_environment (EE) which does reverse ordering.

Puts querying group clusters behind Feature Flag. Just in case we have
issues with performance, we can easily disable this
2018-12-05 10:16:44 +13:00
Thong Kuah
0e15eec86d Associate clusters model to groups
Even though we currently only should have one group for a cluster, we
allow the flexibility to associate to other groups in the future.

This also matches the runner <=> groups association.

- Adds Cluster#first_group, aliased to Cluster#group. For the
conceivable future, a cluster will have at most one group.

- Prevent mixing of group and project clusters. If project type
clusters, it should only have projects assigned.  Similarly with groups.

- Default cluster_type to :project_type. As it's very small table we can
set default and null: false in one release.
2018-10-29 16:21:31 +13:00
gfyoung
15b878e27e Enable more frozen string in app/models/**/*.rb
Partially addresses #47424.
2018-08-07 00:37:36 -07:00
Mayra Cabrera
1a79beff6e Re-arrange deployment_platform to avoid cop complainments 2018-03-26 16:59:27 -06:00
Mayra Cabrera
ca59bfdc66 Rearrange DeploymentPlatform methods
- Change find_cluster_platform_kubernetes to ignore environment argument
- Fix broken specs

CE Port of: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5047/
2018-03-22 14:52:33 -06:00
Lin Jen-Shin
0917e81783 Unify deployment_platform interface with EE 2018-03-07 18:14:25 +08:00
Lin Jen-Shin
8b3b28b8d8 Just try to detect and assign once 2018-01-05 15:32:31 +08:00
Mayra Cabrera
93e9793ce3 Create Kubernetes based on Application Templates 2018-01-04 22:35:41 +00:00