Commit 2f448ee7 authored by Mark Chao's avatar Mark Chao

Merge branch 'master' into ce-to-ee-2018-06-06

parents d992832e f3c7ab45
Please view this file on the master branch, on stable branches it's out of date.
## 10.8.4 (2018-06-06)
### Fixed (4 changes)
- Render a 403 when showing an access denied message. !5964
- Validate classification label on create & update. !5976
- Fix breadcrumbs being covered by System Header message.
- Treat external authorization service response status 403 as failure.
## 10.8.3 (2018-05-30)
- No changes.
......
......@@ -2,6 +2,10 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
## 10.8.4 (2018-06-06)
- No changes.
## 10.8.3 (2018-05-30)
### Fixed (4 changes)
......
......@@ -806,6 +806,7 @@ $border-color-settings: #e1e1e1;
Modals
*/
$modal-body-height: 134px;
$modal-border-color: #e9ecef;
/*
Prometheus
......
......@@ -161,6 +161,35 @@ ul.related-merge-requests > li {
}
.issues-export-modal {
.modal-header {
justify-content: flex-start;
.export-svg-container {
flex-grow: 1;
> svg {
float: right;
}
}
}
.modal-body {
padding: 0;
.export-modal-subheader {
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid $modal-border-color;
padding: 14px;
}
.export-modal-text {
padding: 24px 16px;
line-height: 1.5;
min-height: $modal-body-height;
}
}
.export-svg-container {
height: 56px;
padding: 10px 10px 0;
......
......@@ -76,7 +76,7 @@
.related-issues-block
.card-slim
.card-header.panel-empty-heading.border-bottom-0
%h3.card-title.mb-0
%h3.card-title.mt-0.mb-0
Related issues
#merge-requests{ data: { url: referenced_merge_requests_project_issue_path(@project, @issue) } }
......
......@@ -19,10 +19,10 @@
- if can_admin_project_members && project_can_be_shared?
- if !membership_locked? && @project.allowed_to_share_with_group?
%ul.nav-links.nav.nav-tabs.gitlab-tabs{ role: 'tablist' }
%li.active{ role: 'presentation' }
%a{ href: '#add-member-pane', id: 'add-member-tab', data: { toggle: 'tab' }, role: 'tab' } Add member
%li{ role: 'presentation', class: ('active' if membership_locked?) }
%a{ href: '#share-with-group-pane', id: 'share-with-group-tab', data: { toggle: 'tab' }, role: 'tab' } Share with group
%li.nav-tab{ role: 'presentation' }
%a.nav-link.active{ href: '#add-member-pane', id: 'add-member-tab', data: { toggle: 'tab' }, role: 'tab' } Add member
%li.nav-tab{ role: 'presentation', class: ('active' if membership_locked?) }
%a.nav-link{ href: '#share-with-group-pane', id: 'share-with-group-tab', data: { toggle: 'tab' }, role: 'tab' } Share with group
.tab-content.gitlab-tab-content
.tab-pane.active{ id: 'add-member-pane', role: 'tabpanel' }
......
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180603190921) do
ActiveRecord::Schema.define(version: 20180605213516) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -2040,8 +2040,8 @@ ActiveRecord::Schema.define(version: 20180603190921) do
add_index "project_repository_states", ["last_repository_verification_failure"], name: "idx_repository_states_on_repository_failure_partial", where: "(last_repository_verification_failure IS NOT NULL)", using: :btree
add_index "project_repository_states", ["last_wiki_verification_failure"], name: "idx_repository_states_on_wiki_failure_partial", where: "(last_wiki_verification_failure IS NOT NULL)", using: :btree
add_index "project_repository_states", ["project_id"], name: "idx_repository_states_outdated_checksums", where: "(((repository_verification_checksum IS NULL) AND (last_repository_verification_failure IS NULL)) OR ((wiki_verification_checksum IS NULL) AND (last_wiki_verification_failure IS NULL)))", using: :btree
add_index "project_repository_states", ["project_id"], name: "index_project_repository_states_on_project_id", unique: true, using: :btree
add_index "project_repository_states", ["repository_verification_checksum", "wiki_verification_checksum"], name: "idx_repository_states_on_checksums_partial", where: "((repository_verification_checksum IS NULL) OR (wiki_verification_checksum IS NULL))", using: :btree
create_table "project_statistics", force: :cascade do |t|
t.integer "project_id", null: false
......
......@@ -22,7 +22,7 @@ license_management:
- export LICENSE_MANAGEMENT_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--volume "$PWD:/code"
"registry.gitlab.com/gitlab-org/security-products/license-management:$LICENSE_MANAGEMENT_VERSION" /run.sh /code
"registry.gitlab.com/gitlab-org/security-products/license-management:$LICENSE_MANAGEMENT_VERSION" analyze /code
artifacts:
paths: [gl-license-management-report.json]
```
......
---
redirect_from: 'https://docs.gitlab.com/ee/user/project/clusters/eks_and_gitlab/index.html'
---
# Connecting and deploying to an Amazon EKS cluster
> **[Article Type](../../../../development/writing_documentation.md#types-of-technical-articles):** tutorial ||
> **Level:** intermediate ||
> **Author:** [Joshua Lambert](https://gitlab.com/joshlambert) ||
> **Publication date:** 2018-06-05
## Introduction
In this tutorial, we will show how easy it is to integrate an [Amazon EKS](https://aws.amazon.com/eks/) cluster with GitLab, and begin deploying applications.
For an end-to-end walkthrough we will:
1. Start with a new project based on the sample Ruby on Rails template
1. Integrate an EKS cluster
1. Utilize [Auto DevOps](../../../../topics/autodevops/) to build, test, and deploy our application
You will need:
1. An account on GitLab, like [GitLab.com](https://gitlab.com)
1. An Amazon EKS cluster
1. `kubectl` [installed and configured for access to the EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl)
If you don't have an Amazon EKS cluster, one can be created by following [the EKS getting started guide](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html).
## Creating a new project
On GitLab, create a new project by clicking on the `+` icon in the top navigation bar, and selecting `New project`.
![New Project](img/new_project.png)
On the new project screen, click on the `Create from template` tab, and select `Use template` for the Ruby on Rails sample project.
Give the project a name, and then select `Create project`.
![Create Project](img/create_project.png)
## Connecting the EKS cluster
From the left side bar, hover over `CI/CD` and select `Kubernetes`, then click on `Add Kubernetes cluster`, and finally `Add an existing Kubernetes cluster`.
A few details from the EKS cluster will be required to connect it to GitLab.
1. A valid Kubernetes certificate and token are needed to authenticate to the EKS cluster. A pair is created by default, which can be used. Open a shell and use `kubectl` to retrieve them:
* List the secrets with `kubectl get secrets`, and one should named similar to `default-token-xxxxx`. Copy that token name for use below.
* Get the certificate with `kubectl get secret <secret name> -o jsonpath="{['data']['ca\.crt']}" | base64 -D`
* Retrieve the token with `kubectl get secret <secret name> -o jsonpath="{['data']['token']}" | base64 -D`.
1. The API server endpoint is also required, so GitLab can connect to the cluster. This is displayed on the AWS EKS console, when viewing the EKS cluster details.
You now have all the information needed to connect the EKS cluster:
* Kubernetes cluster name: Provide a name for the cluster to identify it within GitLab.
* Environment scope: Leave this as `*` for now, since we are only connecting a single cluster.
* API URL: Paste in the API server endpoint retrieved above.
* CA Certificate: Paste the certificate data from the earlier step, as-is.
* Paste the token value. Note on some versions of Kubernetes a trailing `%` is output, do not include it.
* Project namespace: This can be left blank to accept the default namespace, based on the project name.
![Add Cluster](img/add_cluster.png)
Click on `Add Kubernetes cluster`, the cluster is now connected to GitLab. At this point, [Kubernetes deployment variables](../#deployment-variables) will automatically be available during CI jobs, making it easy to interact with the cluster.
If you would like to utilize your own CI/CD scripts to deploy to the cluster, you can stop here.
## Disable Role Based-Access Control (RBAC)
Presently, Auto DevOps and one-click app installs do not support [Kubernetes role-based access control](https://kubernetes.io/docs/reference/access-authn-authz/rbac/). Support is [being worked on](https://gitlab.com/groups/gitlab-org/-/epics/136), but in the interim RBAC must be disabled to utilize for these features.
> **Note**: Disabling RBAC means that any application running in the cluster, or user who can authenticate to the cluster, has full API access. This is a [security concern](https://docs.gitlab.com/ee/user/project/clusters/#security-implications), and may not be desirable.
To effectively disable RBAC, global permissions can be applied granting full access:
```bash
kubectl create clusterrolebinding permissive-binding \
--clusterrole=cluster-admin \
--user=admin \
--user=kubelet \
--group=system:serviceaccounts
```
## Deploy services to the cluster
GitLab supports one-click deployment of helpful services to the cluster, many of which support Auto DevOps. Back on the Kubernetes cluster screen in GitLab, a list of applications is now available to deploy.
First install Helm Tiller, a package manager for Kubernetes. This enables deployment of the other applications.
![Deploy Apps](img/deploy_apps.png)
### Deploying NGINX Ingress (optional)
Next, if you would like the deployed app to be reachable on the internet, deploy the Ingress. Note that this will also cause an [Elastic Load Balancer](https://aws.amazon.com/documentation/elastic-load-balancing/) to be created, which will incur additional AWS costs.
Once installed, you may see a `?` for `Ingress IP Address`. This is because the created ELB is available at a DNS name, not an IP address. To get the DNS name, run: `kubectl get service ingress-nginx-ingress-controller -n gitlab-managed-apps -o jsonpath="{.status.loadBalancer.ingress[0].hostname}"`. Note, you may see a trailing `%` on some Kubernetes versions, do not include it.
The Ingress is now available at this address, and will route incoming requests to the proper service based on the DNS name in the request. To support this, a wildcard DNS CNAME record should be created for the desired domain name. For example `*.myekscluster.com` would point to the Ingress hostname obtained earlier.
![Create DNS](img/create_dns.png)
### Deploying the GitLab Runner (optional)
If the project is on GitLab.com, free shared runners are available and you do not have to deploy one. If a project specific runner is desired, or there are no shared runners, it is easy to deploy one.
Simply click on the `Install` button for the GitLab Runner. It is important to note that the runner deployed is set as **privileged**, which means it essentially has root access to the underlying machine. This is required to build docker images, and so is on by default.
### Deploying Prometheus (optional)
GitLab is able to monitor applications automatically, utilizing [Prometheus](../../integrations/prometheus.html). Kubernetes container CPU and memory metrics are automatically collected, and response metrics are retrieved from NGINX Ingress as well.
To enable monitoring, simply install Prometheus into the cluster with the `Install` button.
## Create a default Storage Class
Amazon EKS does not have a default Storage Class out of the box, which means requests for persistent volumes will not be automatically fulfilled. As part of Auto DevOps, the deployed Postgres instance requests persistent storage, and without a default storage class it will fail to start.
If a default Storage Class does not already exist and is desired, follow Amazon's [short guide](https://docs.aws.amazon.com/eks/latest/userguide/storage-classes.html) to create one.
Alternatively, disable Postgres by setting the project variable [`POSTGRES_ENABLED`](../../../../topics/autodevops/#environment-variables) to `false`.
## Deploy the app to EKS
With RBAC disabled and services deployed, [Auto DevOps](https://docs.gitlab.com/ee/topics/autodevops/) can now be leveraged to build, test, and deploy the app. To enable, click on `Settings` in the left sidebar, then `CI/CD`. You will see a section for `Auto DevOps`, expand it. Click on the radio button to `Enable Auto DevOps`.
If a wildcard DNS entry was created resolving to the Load Balancer, enter it in the `domain` field. Otherwise, the deployed app will not be externally available outside of the cluster. To save, click `Save changes`.
![Deploy Pipeline](img/pipeline.png)
A new pipeline will automatically be created, which will begin to build, test, and deploy the app.
After the pipeline has finished, your app will be running in EKS and available to users. Click on `CI/CD` tab in the left navigation bar, and choose `Environments`.
![Deployed Environment](img/environment.png)
You will see a list of the environments and their deploy status, as well as options to browse to the app, view monitoring metrics, and even access a shell on the running pod.
To learn more about Auto DevOps, review our [documentation](../../../../topics/autodevops/).
......@@ -201,6 +201,11 @@ Otherwise, you can list the IP addresses of all load balancers:
kubectl get svc --all-namespaces -o jsonpath='{range.items[?(@.status.loadBalancer.ingress)]}{.status.loadBalancer.ingress[*].ip} '
```
> **Note**: Some Kubernetes clusters return a hostname instead, like [Amazon EKS](https://aws.amazon.com/eks/). For these platforms, run:
> ```bash
> kubectl get service ingress-nginx-ingress-controller -n gitlab-managed-apps -o jsonpath="{.status.loadBalancer.ingress[0].hostname}"`.
> ```
The output is the external IP address of your cluster. This information can then
be used to set up DNS entries and forwarding rules that allow external access to
your deployed applications.
......
......@@ -147,7 +147,7 @@ export default {
class="card-header"
:class="{ 'panel-empty-heading border-bottom-0': !hasBody }"
>
<h3 class="card-title mb-0">
<h3 class="card-title mt-0 mb-0">
{{ title }}
<a
v-if="hasHelpPath"
......
......@@ -3,17 +3,17 @@
.modal-dialog
.modal-content
.modal-header
%a.close{ href: '#', 'data-dismiss' => 'modal' } ×
.export-svg-container.float-right
= render 'projects/issues/export_issues/export_issues_list.svg'
%h3
Export issues
.modal-header
.export-svg-container
= render 'projects/issues/export_issues/export_issues_list.svg'
%a.close{ href: '#', 'data-dismiss' => 'modal' } ×
.modal-body
.export-modal-subheader
= icon('check', { class: 'export-checkmark' })
%strong
%strong.prepend-left-10
#{pluralize(issuables_count_for_state(:issues, params[:state]), 'issue')} selected
.modal-body
%div
.export-modal-text
The CSV export will be created in the background. Once finished, it will be sent to
%strong= @current_user.notification_email
in an attachment.
......
---
title: Geo - Fix index for outdated projects on the project_repository_states table
merge_request: 5986
author:
type: performance
---
title: Fix breadcrumbs being covered by System Header message
merge_request:
author:
type: fixed
---
title: Render a 403 when showing an access denied message
merge_request: 5964
author:
type: fixed
---
title: Validate classification label on create & update
merge_request: 5976
author:
type: fixed
---
title: Treat external authorization service response status 403 as failure
merge_request:
author:
type: fixed
class FixPartialIndexToProjectRepositoryStatesChecksumColumns < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
OLD_INDEX_NAME = 'idx_repository_states_on_checksums_partial'
NEW_INDEX_NAME = 'idx_repository_states_outdated_checksums'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name(:project_repository_states, OLD_INDEX_NAME)
add_concurrent_index(:project_repository_states,
:project_id,
name: NEW_INDEX_NAME,
where: '(repository_verification_checksum IS NULL AND last_repository_verification_failure is NULL) OR (wiki_verification_checksum IS NULL AND last_wiki_verification_failure IS NULL)'
)
end
def down
remove_concurrent_index_by_name(:project_repository_states, NEW_INDEX_NAME)
add_concurrent_index(:project_repository_states,
[:repository_verification_checksum, :wiki_verification_checksum],
name: OLD_INDEX_NAME,
length: Gitlab::Database.mysql? ? 20 : nil,
where: 'repository_verification_checksum IS NULL OR wiki_verification_checksum IS NULL'
)
end
end
......@@ -170,7 +170,7 @@ module EESpecificCheck
ls_remote_output = run_git_command("ls-remote #{ce_repo_url} \"*#{minimal_ce_branch_name}*\"")
if ls_remote_output.include?(minimal_ce_branch_name)
branch_to_fetch = ls_remote_output.scan(%r{(?<=refs/heads|tags/).+}).sort_by(&:size).first
branch_to_fetch = ls_remote_output.scan(%r{(?<=refs/heads/|tags/).+}).sort_by(&:size).first
say "💪 We found the branch '#{branch_to_fetch}' in the #{ce_repo_url} repository. We will fetch it."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment