Hello World Example
This tutorial demonstrates how to deploy a simple application to a NeonKUBE cluster.
Clone demo repository
git clone https://github.com/nforgeio/neonKUBE-demos.git
Publish images
NeonKUBE Clusters include a built-in container registry to store images for deployment. In this step we'll publish the necessary container images to the Cluster Registry.
You can optionally build the containers yourself, rather than using the public
images. To do this, add the -build
flag to the following command. You'll need
to have Visual Studio and the .NET SDK
installed to do this.
powershell -f publish.ps1
Deploy hello-world-operator
neon apply -f hello-world-operator.yaml
Deploy hello-world
You can edit the hello-world.yaml
spec to change the deployment behaviour.
apiVersion: demo.neonkube.io/v1alpha1
kind: HelloWorldDemo
metadata:
name: hello-world
labels:
app: hello-world
spec:
logLevel: debug
helloWorldReplicas: 2
loadGeneratorReplicas: 3
storageType: ephemeral # ephemeral or nfs
ssoEnabled: false
neonDashboardEnabled: false
neon apply -f hello-world.yaml
View Hello, World!
Every NeonKUBE Cluster comes with an SSL certificate to make it easy to deploy new services. The Hello World demo is deployed using this certificate.
- NeonDESKTOP
- NeonKUBE
Use the following command to get the URL for Hello, World!, and open it in your browser.
powershell -c "Write-Host (('https://hello-world.', (neon cluster info | ConvertFrom-Json).Domain) -join '')"
HelloWorldDemo Options
The HelloWorldDemo
Custom Resource spec
allows for configuration of the
demo. These options can be changed at any time by modifying the
hello-world.yaml
manifest and applying the changes with
neon apply -f hello-world.yaml
.
logLevel
logLevel
can be set to the following:
- CRITICAL
- ERROR
- WARNING
- INFORMATION
- DEBUG
- TRACE
helloWorldReplicas
This is the number of replicas that will be deployed for the hello-world
web
app.
loadGeneratorReplicas
This is the number of replicas for the load generator app. Increase this to generate more load.
storageType
storageType can be set to ephemeral
or nfs
.
The hello-world
app has a /storage
page where users can update a text file.
This can be used to verify the behaviours described below. Try updating the text
file and killing some pods with the "Kill Pods" button to see what happens.
ephemeral
does not create any Kubernetes Persistent Volumes. Each pod has its own ephemeral volume, and any data stored on it will be lost when the pod is deleted.nfs
Creates a persistent volume that is shared between allhello-world
pods as described here. In this mode, any data stored on the Volume will be persisted.
ssoEnabled
If set to true, the Operator will configure the hello-world
demo to use Neon
Single Sign On. Users will need cluster credentials to access the demo.
neonDashboardEnabled
If set to true, the Operator will add a link to the hello-world
dashboard to
the NeonKUBE dashboard.