You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: _docs/administration/codefresh-runner.md
+128-2Lines changed: 128 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -671,7 +671,7 @@ policy/dind-ebs:
671
671
"Version": "2012-10-17",
672
672
"Statement":[
673
673
{
674
-
### "Effect": "Allow",
674
+
"Effect": "Allow",
675
675
"Action":[
676
676
"ec2:DescribeVolumes"
677
677
],
@@ -1144,7 +1144,133 @@ kubectl edit cm codefresh-dind-config -ncodefresh-runtime
1144
1144
```
1145
1145
1146
1146
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.
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):
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
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.
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[]: