Commit 30d8dcc7 authored by danielgruesso's avatar danielgruesso

Update adding existing cluster

parent 715b3fc7
...@@ -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
......
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