Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
30d8dcc7
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30d8dcc7
编写于
2月 22, 2019
作者:
D
danielgruesso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update adding existing cluster
上级
715b3fc7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
doc/user/project/clusters/index.md
doc/user/project/clusters/index.md
+13
-13
未找到文件。
doc/user/project/clusters/index.md
浏览文件 @
30d8dcc7
...
...
@@ -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)
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
apiVersion: v1
kind: ServiceAccount
metadata:
name:
eks
-admin
name:
gitlab
-admin
namespace: kube-system
```
2. Apply the service account to your cluster:
```bash
kubectl apply -f
eks
-admin-service-account.yaml
kubectl apply -f
gitlab
-admin-service-account.yaml
```
Output:
```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
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name:
eks
-admin
name:
gitlab
-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name:
eks
-admin
name:
gitlab
-admin
namespace: kube-system
```
4. Apply the cluster role binding to your cluster:
```bash
kubectl apply -f
eks
-admin-cluster-role-binding.yaml
kubectl apply -f
gitlab
-admin-cluster-role-binding.yaml
```
Output:
```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
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:
```yaml
Name:
eks
-admin-token-b5zv4
Name:
gitlab
-admin-token-b5zv4
Namespace: kube-system
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
Type: kubernetes.io/service-account-token
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录