Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
30d8dcc7
Commit
30d8dcc7
authored
Feb 22, 2019
by
danielgruesso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update adding existing cluster
parent
715b3fc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
doc/user/project/clusters/index.md
doc/user/project/clusters/index.md
+13
-13
No files found.
doc/user/project/clusters/index.md
View file @
30d8dcc7
...
@@ -107,70 +107,70 @@ To add an existing Kubernetes cluster to your project:
...
@@ -107,70 +107,70 @@ To add an existing Kubernetes cluster to your project:
[`cluster-admin`](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles)
[`cluster-admin`](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles)
privileges.** To create this service account:
privileges.** To create this service account:
1. Create a file called `
eks
-admin-service-account.yaml` with contents:
1. Create a file called `
gitlab
-admin-service-account.yaml` with contents:
```yaml
```yaml
apiVersion: v1
apiVersion: v1
kind: ServiceAccount
kind: ServiceAccount
metadata:
metadata:
name:
eks
-admin
name:
gitlab
-admin
namespace: kube-system
namespace: kube-system
```
```
2. Apply the service account to your cluster:
2. Apply the service account to your cluster:
```bash
```bash
kubectl apply -f
eks
-admin-service-account.yaml
kubectl apply -f
gitlab
-admin-service-account.yaml
```
```
Output:
Output:
```bash
```bash
serviceaccount "
eks
-admin" created
serviceaccount "
gitlab
-admin" created
```
```
3. Create a file called `
eks
-admin-cluster-role-binding.yaml` with contents:
3. Create a file called `
gitlab
-admin-cluster-role-binding.yaml` with contents:
```yaml
```yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
kind: ClusterRoleBinding
metadata:
metadata:
name:
eks
-admin
name:
gitlab
-admin
roleRef:
roleRef:
apiGroup: rbac.authorization.k8s.io
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
kind: ClusterRole
name: cluster-admin
name: cluster-admin
subjects:
subjects:
- kind: ServiceAccount
- kind: ServiceAccount
name:
eks
-admin
name:
gitlab
-admin
namespace: kube-system
namespace: kube-system
```
```
4. Apply the cluster role binding to your cluster:
4. Apply the cluster role binding to your cluster:
```bash
```bash
kubectl apply -f
eks
-admin-cluster-role-binding.yaml
kubectl apply -f
gitlab
-admin-cluster-role-binding.yaml
```
```
Output:
Output:
```bash
```bash
clusterrolebinding "
eks
-admin" created
clusterrolebinding "
gitlab
-admin" created
```
```
5. Retrieve the token for the `
eks
-admin` service account:
5. Retrieve the token for the `
gitlab
-admin` service account:
```bash
```bash
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep
eks
-admin | awk '{print $1}')
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep
gitlab
-admin | awk '{print $1}')
```
```
Copy the `<authentication_token>` value from the output:
Copy the `<authentication_token>` value from the output:
```yaml
```yaml
Name:
eks
-admin-token-b5zv4
Name:
gitlab
-admin-token-b5zv4
Namespace: kube-system
Namespace: kube-system
Labels: <none>
Labels: <none>
Annotations: kubernetes.io/service-account.name=
eks
-admin
Annotations: kubernetes.io/service-account.name=
gitlab
-admin
kubernetes.io/service-account.uid=bcfe66ac-39be-11e8-97e8-026dce96b6e8
kubernetes.io/service-account.uid=bcfe66ac-39be-11e8-97e8-026dce96b6e8
Type: kubernetes.io/service-account-token
Type: kubernetes.io/service-account-token
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment