Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb27bdbb

Browse files
authored
Merge pull request#548 from codefresh-io/cf-k8s-124-example-fix
Update add-kubernetes-cluster.md
2 parents8369574 +416f7a3 commitb27bdbb

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

‎_docs/deploy-to-kubernetes/add-kubernetes-cluster.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ apiVersion: rbac.authorization.k8s.io/v1
365365
metadata:
366366
name: codefresh-role
367367
rules:
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
383383
metadata:
384384
name: codefresh-role
385385
rules:
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+
--
390390
apiVersion: v1
391391
kind: ServiceAccount
392392
metadata:
393393
name: codefresh-user
394394
namespace: kube-system
395-
395+
--
396396
apiVersion: rbac.authorization.k8s.io/v1
397397
kind: ClusterRoleBinding
398398
metadata:
@@ -405,15 +405,15 @@ subjects:
405405
- kind: ServiceAccount
406406
name: codefresh-user
407407
namespace: kube-system
408-
408+
--
409409
apiVersion: v1
410410
kind: Secret
411411
type: kubernetes.io/service-account-token
412412
metadata:
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"}
431432
1. Create the Codefresh user/role:
432-
433433
`Apply Codefresh access rules`
434434
{% highlight shell %}
435435
{% raw %}
436436
kubectl 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 .dataca.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 .datatoken }} 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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp