These are the instructor notes for giving a hands-on workshop specifically for .NET developers doing cloud native development on OpenShift. OpenShift tends to have lots of enablement material around Java, Go, Python, and Ruby but not so much for .Net; even though it is a first class citizen on the platform. Microsoft has done a great job around making .Net Core 5 and after being cross platform and Linux friendly. The development experience using .NET with its live reloading makes it wonderful to use and being able to get that same experience even though the application is running on OpenShift and not a developer's local laptop is a critical part of cloud native development. Being able to utilize the resources of the cloud for development and for cloud deployment, but not sacrificing on the development experience is essential.
These notes are for an instructor that wants to prepare and run this workshop. This workshop gives developers first hand experience using OpenShift to do cloud native development. There is a laser focus only on the developer's inner loop - their day to day sitting down implementing new features and bug fixes. Once they commit their code and open a pull request, that falls into the developer's outer loop and is outside the scope of this workshop.
It is assumed you have access to an OpenShift 4.10 cluster large enough to run DevSpaces for each workshop attendee. Sample cluster resource requirements are listed here. Your mileage may vary as you scale up, these are simply the default requirements.
Cluster wide, you will find the following in the openshift-operators
namespace.
- DevWorkspace Controller Manager: 1Gi
- DevWorkspace Operator Catalog: 50Mi
- DevWorkspace Webhook Server: 300Mi
For a total of 1.35Gi.
These are pods managed by the DevSpaces Operator. You can find these in the openshift-devspaces
namespace.
- OCP DevSpaces Server: 1Gi
- OCP DevSpaces Gateway: 4Gi
- OCP DevSpaces Dashboard: 256Mi
- PostgreSQL: 1Gi
- Devfile Registry: 256Mi
- Plug-in Registry: 256Mi
For a total of 6.768Gi.
Your workspace will most likely be different depending on how you configured it, for example, which UI you want to use for DevSpaces, as well as the size of your tooling for your language or application framework. But this is an example here:
- theia-ide: 512Mi
- machine-exec: 128Mi
- tooling: 4Gi
- che-gateway: 256Mi
This example is for a node app and requires ~5Gi of memory. My dotnet application I use for this will need about ~9Gi of memory due to the database and generally more resources required for .NET as compared to Node. Also 1Gi for storage for the SQLServer database.
I'm going to do some rounding here to make the math easier. These are all ballpark numbers anyways, and I tend to err on the side of overprovisioning.
- Operator: 2Gi
- Operands: 7Gi
- Workspaces, 10Gi per participant
More rounding, let's say:
# 10Gi overhead + (10Gi per attendee, represented here by x)
10Gi + (10Gi * x)
And 1Gi of storage per attendee.
So for example, a workshop of 30 people will require 310Gi of memory and 30 Gi of storage.
Once you have the cluster, there are some things you need to do in order to setup for the workshop.
- Install DevSpaces (takes 6 min)
dsc server:deploy --platform openshift
# uninstall
# dsc server:delete
- Destroy any
ResourceQuotas
for your users that get created automatically on RHPDS clusters. You might have to log in as each user to trigger the ResourceQuota creation. Or you can edit theTemplate
used for project creation:
oc edit templates/project-request -n openshift-config
- Change timeout for DevSpaces Workspaces
oc edit checluster/devspaces -n openshift-devspaces
and add the following:
spec:
server:
customCheProperties:
CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT: "7200000"
The default is normally 1800000 (30 min), so here we are changing it to 7200000 (2 hrs), or -1 for never sleep.
You can do this in one command:
oc patch checluster/devspaces --patch "{\"spec\":{\"server\":{\"customCheProperties\": {\"CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT\": \"-1\"}}}}" --type=merge -n openshift-devspaces
Day of the workshop, follow the flow as noted here.