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

Commit1d7c67d

Browse files
author
Ted Spinks
authored
Add Rancher RKE section to Runner Installation doc (#245)
* Add Rancher instructions to runner install doc* Add mtu config to Runner install for Rancher* Fix formatting issues in new Rancher section* Fix formatting issues in new Rancher section
1 parent77332f9 commit1d7c67d

File tree

6 files changed

+128
-2
lines changed

6 files changed

+128
-2
lines changed

‎_docs/administration/codefresh-runner.md‎

Lines changed: 128 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ policy/dind-ebs:
671671
"Version": "2012-10-17",
672672
"Statement":[
673673
{
674-
### "Effect": "Allow",
674+
"Effect": "Allow",
675675
"Action":[
676676
"ec2:DescribeVolumes"
677677
],
@@ -1144,7 +1144,133 @@ kubectl edit cm codefresh-dind-config -ncodefresh-runtime
11441144
```
11451145

11461146
And add this after one of the commas:
1147-
`"mtu":1440,`
1147+
`\"mtu\":1440,`
1148+
1149+
###Installing on Rancher RKE 2.X
1150+
1151+
####Step 1 - Configure the kubelet to work with the runner's StorageClass
1152+
1153+
The runner's default StorageClass creates the persistent cache volume from local storage on each node. We need to edit the cluster config to allow this.
1154+
1155+
In the Rancher UI, drill into the target cluster and then click the Edit Cluster button at the top-right.
1156+
{% include image.html
1157+
lightbox="true"
1158+
file="/images/administration/runner/rancher-cluster.png"
1159+
url="/images/administration/runner/rancher-cluster.png"
1160+
alt="Drill into your cluster and click Edit Cluster on the right"
1161+
caption="Drill into your cluster and click Edit Cluster on the right"
1162+
max-width="100%"
1163+
%}
1164+
On the edit cluster page, scroll down to the Cluster Options section and click its**Edit as YAML** button
1165+
{% include image.html
1166+
lightbox="true"
1167+
file="/images/administration/runner/rancher-edit-as-yaml.png"
1168+
url="/images/administration/runner/rancher-edit-as-yaml.png"
1169+
alt="Cluster Options -> Edit as YAML"
1170+
caption="Cluster Options -> Edit as YAML"
1171+
max-width="100%"
1172+
%}
1173+
Edit the YAML to include an extra mount in the kubelet service:
1174+
```
1175+
rancher_kubernetes_engine_config:
1176+
...
1177+
services:
1178+
...
1179+
kubelet:
1180+
extra_binds:
1181+
- '/var/lib/codefresh:/var/lib/codefresh:rshared'
1182+
```
1183+
{% include image.html
1184+
lightbox="true"
1185+
file="/images/administration/runner/rancher-kublet.png"
1186+
url="/images/administration/runner/rancher-kublet.png"
1187+
alt="Add volume to rancher_kubernetes_engine_config.services.kublet.extra_binds"
1188+
caption="Add volume to rancher_kubernetes_engine_config.services.kublet.extra_binds"
1189+
max-width="100%"
1190+
%}
1191+
1192+
####Step 2 - Make sure your kubeconfig user is a ClusterAdmin
1193+
1194+
The user in your kubeconfig must be a cluster admin in order to install the runner. If you plan to have your pipelines connect to this cluster as a cluster admin, then you can go ahead and create a Codefresh user for this purpose in the Rancher UI with a**non-expiring** kubeconfig token. This is the easiest way to do the installation.
1195+
1196+
However, if you want your pipelines to connect to this cluster with less privileges, then you can use your personal user account with Cluster Admin privileges for the installation, and then we'll create a Codefresh account with lesser privileges later (in Step 5). In that case, you can now move on to Step 3.
1197+
1198+
Follow these steps to create a Codefresh user with Cluster Admin rights, from the Rancher UI:
1199+
- Click Security at the top, and then choose Users
1200+
{% include image.html lightbox="true" file="/images/administration/runner/rancher-security.png" url="/images/administration/runner/rancher-security.png" alt="Create a cluster admin user for Codefresh" caption="Create a cluster admin ser for Codefresh" max-width="100%" %}
1201+
- Click the Add User button, and under Global Permissions check the box for**Restricted Administrstor**
1202+
- Log out of the Rancher UI, and then log back in as the new user
1203+
- Click your user icon at the top-right, and then choose**API & Keys**
1204+
- Click the**Add Key** button and create a kubeconfig token with Expires set to Never
1205+
- Copy the Bearer Token field (combines Access Key and Secret Key)
1206+
- Edit your kubeconfig and put the Bearer Token you copied in the`token` field of your user
1207+
1208+
####Step 3 - Install the runner
1209+
1210+
If you've created your kubeconfig from the Rancher UI, then it will contain an API endpoint that is not reachable internally, from within the cluster. To work around this, we need to tell the runner to instead use Kubernetes' generic internal API endpoint. Also, if you didn't create a Codefresh user in step 2 and your kubeconfig contains your personal user account, then you should also add the`--skip-cluster-integration` option.
1211+
1212+
Install the runner with a Codefresh user (ClusterAdmin, non-expiring token):
1213+
```
1214+
codefresh runner init \
1215+
--set-value KubernetesHost=https://kubernetes.default.svc.cluster.local
1216+
```
1217+
Or install the runner with your personal user account:
1218+
```
1219+
codefresh runner init \
1220+
--set-value KubernetesHost=https://kubernetes.default.svc.cluster.local \
1221+
--skip-cluster-integration
1222+
```
1223+
1224+
The wizard will then ask you some basic questions.
1225+
1226+
####Step 4 - Update the runner's Docker MTU
1227+
1228+
By default, RKE nodes use the[Canal CNI](https://rancher.com/docs/rancher/v2.x/en/faq/networking/cni-providers/#canal), which combines elements of Flannel and Calico, and uses VXLAN encapsulation. This VXLAN encapsulation has a 50-byte overhead, thus reducing the MTU of its virtual interfaces from the standard 1500 to 1450. For example, when running`ifconfig` on an RKE 2.5.5 node, you might see several interfaces like this. Note the`MTU:1450`.
1229+
```
1230+
cali0f8ac592086 Link encap:Ethernet HWaddr ee:ee:ee:ee:ee:ee
1231+
inet6 addr: fe80::ecee:eeff:feee:eeee/64 Scope:Link
1232+
UP BROADCAST RUNNING MULTICAST MTU:1450 Metric:1
1233+
RX packets:11106 errors:0 dropped:0 overruns:0 frame:0
1234+
TX packets:10908 errors:0 dropped:0 overruns:0 carrier:0
1235+
collisions:0 txqueuelen:0
1236+
RX bytes:922373 (922.3 KB) TX bytes:9825590 (9.8 MB)
1237+
```
1238+
We must reduce the Docker MTU used by the runner's Docker in Docker (dind) pods to fit within this lower MTU. This is stored in a configmap in the namespace where the runner is installed. Assuming that you installed the runner into the`codefresh` namespace, you would edit the configmap like this:
1239+
```
1240+
kubectl edit cm codefresh-dind-config -n codefresh
1241+
```
1242+
In the editor, update the**daemon.json** field - add`,\"mtu\":1440` just before the last curley brace.
1243+
{% include image.html
1244+
lightbox="true"
1245+
file="/images/administration/runner/rancher-mtu.png"
1246+
url="/images/administration/runner/rancher-mtu.png"
1247+
alt="Update the runner's Docker MTU"
1248+
caption="Update the runner's Docker MTU"
1249+
max-width="100%"
1250+
%}
1251+
1252+
####Step 5 - Create the Cluster Integration
1253+
1254+
If you created a user in Step 2 and used it to install the runner in Step 3, then you can skip this step - your installation is complete!
1255+
1256+
However, if you installed the runner with the`--skip-cluster-integration` option then you should follow the documentaion to[Add a Rancher Cluster]({{site.baseurl}}/docs/deploy-to-kubernetes/add-kubernetes-cluster/#adding-a-rancher-cluster) to your Kubernetes Integrations.
1257+
1258+
Once complete, you can go to the Codefresh UI and run a pipeline on the new runtime, including steps that deploy to the Kubernetes Integration.
1259+
1260+
####Troubleshooting TLS Errors
1261+
1262+
Depending on your Rancher configuration, you may need to allow insecure HTTPS/TLS connections. You can do this by adding an environment variable to the runner deployment.
1263+
1264+
Assuming that you installed the runner into the`codefresh` namespace, you would edit the runner deployment like this:
1265+
```
1266+
kubectl edit deploy runner -n codefresh
1267+
```
1268+
In the editor, add this environment variable under spec.containers.env[]:
1269+
```
1270+
- name: NODE_TLS_REJECT_UNAUTHORIZED
1271+
value: "0"
1272+
```
1273+
11481274

11491275
###Installing on Google Kubernetes Engine
11501276

119 KB
Loading
97 KB
Loading
85.6 KB
Loading
106 KB
Loading
403 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp