Commit Graph

217 Commits

Author SHA1 Message Date
Chris Baumbauer 47cb5a2641 Require Knative to be installed only on an RBAC kubernetes cluster 2019-01-04 14:53:39 -08:00
Dylan Griffith 9275e1dfbf Make RBAC enabled default for new clusters
Many changes were also made to tests that expected this to default to
false.
2019-01-04 11:49:13 +01:00
Chris Baumbauer da873584af Add Knative metrics to Prometheus 2019-01-03 13:10:40 -08:00
Grzegorz Bizon 54f18f59a0 Merge branch 'use-after-transition' into 'master'
Prefer to use after_transition

Closes #55306

See merge request gitlab-org/gitlab-ce!24107
2019-01-03 08:55:53 +00:00
Kamil Trzciński 7ebd36e302 Prefer to use after_transition
Before_transition does not play nice when used with
OptimisticLocking and this can result in triggering
multiple events

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55306
2019-01-02 19:02:46 +01:00
Tomasz Maczukin 0a6cfd2c78
Update GitLab Runner Helm Chart to 0.1.43 2018-12-31 17:28:40 +01:00
Sean McGivern 1860117556 Merge branch '55716-update-cert-manager-chart-from-v0-5-0-to-v0-5-2' into 'master'
Update cert-manager chart from v0.5.0 to v0.5.2

Closes #55716

See merge request gitlab-org/gitlab-ce!24025
2018-12-31 08:49:20 +00:00
Kamil Trzciński 6b02f502c8 Merge branch '55551-nomethoderror-undefined-method-for-nil-nilclass' into 'master'
Handle nil terminals in Clusters::Platforms::Kubernetes

Closes #55551

See merge request gitlab-org/gitlab-ce!23925
2018-12-27 09:58:41 +00:00
Takuya Noguchi ce03841761 Update cert-manager chart from v0.5.0 to v0.5.2
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2018-12-25 18:53:06 +09:00
George Tsiolis ac5fe450ff Rename `ClusterPlatformConfigureWorker` 2018-12-21 13:17:13 +00:00
Rémy Coutable 6d4c2529f9
Handle nil terminals in Clusters::Platforms::Kubernetes
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-12-19 10:38:29 +01:00
Chris Baumbauer 1d241206b5 Upgrade Knative from 0.1.3 to 0.2.2 2018-12-11 15:03:31 -08:00
Dmitriy Zaporozhets f689b1612e Merge branch 'cert-manager-email' into 'master'
Ability to override Issuer Email for Cert Manager

See merge request gitlab-org/gitlab-ce!23503
2018-12-07 20:10:15 +00:00
Amit Rathi 1cdcf40265 Allows user to override default issuer email for cert manager 2018-12-07 21:40:03 +05:30
Tomasz Maczukin 541ff1fd80 Update gitlab runner helm chart to 0.1.39 2018-12-07 09:46:33 +00:00
Dylan Griffith 2c80a1c0de Introduce Knative Serverless Tab 2018-12-06 18:08:49 +00:00
Kamil Trzciński 13b1508c3e Merge branch '34758-deployment-cluster' into 'master'
Use group clusters when deploying (DeploymentPlatform)

See merge request gitlab-org/gitlab-ce!22308
2018-12-05 15:46:41 +00:00
Dmitriy Zaporozhets a4ff91f794 Merge branch 'set-kubeconfig-nil-when-token-nil' into 'master'
Make KUBECONFIG nil if KUBE_TOKEN is nil

See merge request gitlab-org/gitlab-ce!23414
2018-12-05 09:13:12 +00:00
Thong Kuah 6c642c087b Eager load clusters to prevent N+1
This also means we need to apply the `current_scope` otherwise this
method will return all clusters associated with the groups regardless of
any scopes applied to this method
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 d54791e094 Create k8s namespace for project in group clusters
AFAIK the only relevant place is Projects::CreateService, this gets
called when user creates a new project, forks a new project and does
those things via the api.

Also create k8s namespace for new group hierarchy
when transferring project between groups

Uses new Refresh service to create k8s namespaces

- Ensure we use Cluster#cluster_project

If a project has multiple clusters (EE), using Project#cluster_project
is not guaranteed to return the cluster_project for this cluster. So
switch to using Cluster#cluster_project - at this stage a cluster can
only have 1 cluster_project.

Also, remove rescue so that sidekiq can retry
2018-12-05 10:16:44 +13:00
Thong Kuah 8419b7dd2b Teach Cluster about #all_projects
For project level, it's the project directly associated. For group
level, it's the projects under that group.
2018-12-05 10:16:44 +13:00
Thong Kuah 9c5977c821 Teach Project about #all_clusters
This returns a union of the project level clusters and group level
clusters associated with this 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 a97d876751 Fallback to admin token for project clusters only
We do not want group level clusters to fall back to what was old
behaviour for project level clusters. So instead we will not return any
KUBE_TOKEN if we cannot find a suitable kubernetes_namespace for the
project, in the group level cluster case.

Add test cases to assert above
2018-12-04 15:44:33 +13:00
Amit Rathi 9a034a8628 HTTPS for JupyterHub installation 2018-12-03 10:16:38 +00:00
Dylan Griffith e7f2be49d8 Make KUBECONFIG nil if KUBE_TOKEN is nil
Having an invalid KUBECONFIG without a token in it is not helpful. This
only became possible recently now that we are creating a separate
namespace and service account (and hence token) to send to the runners.
This led to somewhat surprising results when troubleshooting
https://gitlab.com/gitlab-org/gitlab-ce/issues/53879 as I found that the
KUBECONFIG was still being passed but KUBE_TOKEN was not. These things
really should have been linked.

Furthermore now that we are also using the [presence of KUBECONFIG to
decide whether or not to run build steps in Auto
DevOps](294d15be3e/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml (L164))
I think it makes even more sense to ensure that KUBECONFIG is a complete
config if passed to a job.
2018-11-30 11:03:42 +01:00
Chris Baumbauer 2937be7b0c Expose external_ip to knative cluster application 2018-11-26 12:46:00 -08:00
Kamil Trzciński 9c98e2a922 Merge branch 'certmanager-temp' into 'master'
Deploy cert-manager to managed cluster for SSL certificates

See merge request gitlab-org/gitlab-ce!23036
2018-11-23 15:24:32 +00:00
Amit Rathi c3041b7f7c Fix failign tests 2018-11-23 01:47:47 +05:30
Amit Rathi faa18a2c35 change load_file to safe_load 2018-11-23 01:44:48 +05:30
Amit Rathi 09c3c95d2d cert manager changes based on review comments 2018-11-23 01:41:37 +05:30
Amit Rathi 16248dc895 Addressing review comments 2018-11-23 01:22:52 +05:30
Tomasz Maczukin 2d2d6cb546
Update used version of Runner Helm Chart to 0.1.38 2018-11-22 16:40:47 +01:00
Amit Rathi 9c252758a9 Fix typo in cert_manager 2018-11-21 16:01:55 +05:30
Amit Rathi 9bb389a94d Cert manager model spec and email presence validation 2018-11-21 15:03:34 +05:30
Amit Rathi 6eced5ff74 Remove linter complaints from cert_manager.rb 2018-11-20 01:54:49 +05:30
Amit Rathi 1c7372ad56 Merge branch 'master' into certmanager-temp 2018-11-19 23:12:52 +05:30
Amit Rathi 9737cc8ab0 Cleaned up cert_manager 2018-11-19 23:06:18 +05:30
Sean McGivern 69f74582aa Merge branch 'improve-variables-support' into 'master'
Improve variables support

See merge request gitlab-org/gitlab-ce!23077
2018-11-19 15:57:53 +00:00
Kamil Trzciński c3bd3bfc6e Improve variables support
This ensures that variables accept only string,
alongside also improves kubernetes_namespace,
improving validation and default value being set.
2018-11-19 14:09:39 +01:00
Kamil Trzciński 5b75fcf6f2 Merge branch '49726-upgrade-helm-to-2-11' into 'master'
Resolve "Upgrade Helm Tiller Version Used By GitLab Managed Apps"

Closes #49726

See merge request gitlab-org/gitlab-ce!22693
2018-11-16 12:09:26 +00:00
Dylan Griffith a71b3f6a7c Extract Helm::ClientCommand for shared commands 2018-11-16 10:57:20 +00:00
Dylan Griffith fe1469e12f Upgrade helm to 2.11.0 and upgrade on every install 2018-11-16 10:22:40 +00:00
Amit Rathi f0bdf34f72 Move ingress shim config from --set to values.yaml 2018-11-16 01:09:02 +05:30
Amit Rathi 161e66890c Set appropriate RBAC flag for cluster applications 2018-11-15 17:52:41 +05:30
Chris Baumbauer 327892b23e Add knative client to kubeclient library 2018-11-15 11:39:43 +00:00
Amit Rathi 5c275490ec Merge branch 'master' into certmanager-temp 2018-11-14 10:14:50 +05:30
Amit Rathi 631ab89885 Use email on the account 2018-11-13 20:36:06 +05:30
Thong Kuah 14b3033a0d Show HTTP response code for Kubernetes errors 2018-11-13 12:46:01 +00:00