@@ -365,9 +365,9 @@ apiVersion: rbac.authorization.k8s.io/v1
365365metadata:
366366 name: codefresh-role
367367rules:
368- - apiGroups:[ “” ]
369- resources:[ “ * ” ]
370- verbs:[ “ list”, “ watch”, “ get” ]
368+ - apiGroups:[ "" ]
369+ resources:[ " * " ]
370+ verbs:[ " list", " watch", " get" ]
371371{% endraw %}
372372{% endhighlight %}
373373
@@ -383,16 +383,16 @@ apiVersion: rbac.authorization.k8s.io/v1
383383metadata:
384384 name: codefresh-role
385385rules:
386- - apiGroups:[ “ * ” ]
387- resources:[ “ * ” ]
388- verbs:[ “ get”, “ list”, “ watch”, “ create”, “ update”, “ patch”, “ delete” ]
389- —
386+ - apiGroups:[ " * " ]
387+ resources:[ " * " ]
388+ verbs:[ " get", " list", " watch", " create", " update", " patch", " delete" ]
389+ —--
390390apiVersion: v1
391391kind: ServiceAccount
392392metadata:
393393 name: codefresh-user
394394 namespace: kube-system
395- —
395+ —--
396396apiVersion: rbac.authorization.k8s.io/v1
397397kind: ClusterRoleBinding
398398metadata:
@@ -405,15 +405,15 @@ subjects:
405405- kind: ServiceAccount
406406 name: codefresh-user
407407 namespace: kube-system
408- —
408+ —--
409409apiVersion: v1
410410kind: Secret
411411type: kubernetes.io/service-account-token
412412metadata:
413413 name: codefresh-user-token
414414 namespace: kube-system
415415 annotations:
416- kubernetes.io/service-account.name:“ codefresh-user”
416+ kubernetes.io/service-account.name:" codefresh-user"
417417
418418{% endraw %}
419419{% endhighlight %}
@@ -428,35 +428,35 @@ kubectl config use-context <my-cluster-name>
428428{% endraw %}
429429{% endhighlight %}
430430
431+ {: start ="2"}
4314321 . Create the Codefresh user/role:
432-
433433` Apply Codefresh access rules `
434434{% highlight shell %}
435435{% raw %}
436436kubectl apply -f codefresh-role-sa-bind.yml
437437{% endraw %}
438438{% endhighlight %}
439439
440- 1 . Finally run the following commands, and copy-paste the results to the respective Codefresh field in the UI:
441-
440+ { : start ="3"}
441+ 1 . Finally run the following commands, and copy-paste the results to the respective Codefresh field in the UI:
442442` Host IP `
443443{% highlight shell %}
444444{% raw %}
445- export CURRENT_CONTEXT=$(kubectl config current-context) && export CURRENT_CLUSTER=$(kubectl config view -o go-template=“ {{\$ curr_context := \” $CURRENT_CONTEXT\” }}{{range .contexts}}{{if eq .name\$ curr_context}}{{.context.cluster}}{{end}}{{end}}” ) && echo $(kubectl config view -o go-template=“ {{\$ cluster_context := \” $CURRENT_CLUSTER\” }}{{range .clusters}}{{if eq .name\$ cluster_context}}{{.cluster.server}}{{end}}{{end}}” )
445+ export CURRENT_CONTEXT=$(kubectl config current-context) && export CURRENT_CLUSTER=$(kubectl config view -o go-template=" {{\$ curr_context :=\" $CURRENT_CONTEXT\" }}{{range .contexts}}{{if eq .name\$ curr_context}}{{.context.cluster}}{{end}}{{end}}" ) && echo $(kubectl config view -o go-template=" {{\$ cluster_context :=\" $CURRENT_CLUSTER\" }}{{range .clusters}}{{if eq .name\$ cluster_context}}{{.cluster.server}}{{end}}{{end}}" )
446446{% endraw %}
447447{% endhighlight %}
448448
449449` Certificate `
450450{% highlight shell %}
451451{% raw %}
452- echo $(kubectl get secret -n kube-system -o go-template=‘ {{index .data“ ca.crt” }}’ codefresh-user-token)
452+ echo $(kubectl get secret -n kube-system -o go-template=' {{index .data" ca.crt" }}' codefresh-user-token)
453453{% endraw %}
454454{% endhighlight %}
455455
456456` Token `
457457{% highlight shell %}
458458{% raw %}
459- echo $(kubectl get secret -n kube-system -o go-template=‘ {{index .data“ token” }}’ codefresh-user-token)
459+ echo $(kubectl get secret -n kube-system -o go-template=' {{index .data" token" }}' codefresh-user-token)
460460{% endraw %}
461461{% endhighlight %}
462462