For the past few years, we at GleSYS have assisted customers in running their applications on production-ready Kubernetes clusters. These clusters are built according to industry best practices and fully supported by VMware, who provide the underlying technology for the service.
Our customers use the managed Kubernetes service to run various types of applications, for example:
In this article, we explore how we use our Kubernetes offering to unlock the potential of event-driven automation.
We leverage Kubernetes to trigger serverless functions in response to events from our VMware VPS platform. This enables us to automate manual tasks and streamline operations.
Here are some common use cases:
Our Kubernetes cluster consists of 3 worker nodes. The Kubernetes nodes are virtual machines (VMs) running on the VMware platform. As a result, we automatically benefit from vSphere's features, including High Availability, Distributed Resource Scheduler, and built-in security features such as instruction isolation and memory isolation.
To interact with the Kubernetes cluster, we are using kubectl (k as an alias):
$ k get nodes
NAME STATUS ROLES AGE VERSION
k8s-worker-01 Ready <none> 82d v1.27.10+vmware.1-fips.1
k8s-worker-02 Ready <none> 82d v1.27.10+vmware.1-fips.1
k8s-worker-03 Ready <none> 82d v1.27.10+vmware.1-fips.1
$ k get pods -n knative-eventing
NAME READY STATUS RESTARTS AGE
eventing-controller-5955fd4d-7cwqp 1/1 Running 0 81d
eventing-webhook-5546b48456-7txqt 1/1 Running 0 81d
rabbitmq-broker-controller-75d6487bf8-8jg69 1/1 Running 0 81d
rabbitmq-broker-webhook-764b6bc9f8-9lb2q 1/1 Running 0 81d
$ k get pods -n knative-serving
NAME READY STATUS RESTARTS AGE
activator-574844cbbf-gdbkr 1/1 Running 0 81d
autoscaler-9ddbcfcc5-lj4cr 1/1 Running 0 81d
controller-6997848b67-pc974 1/1 Running 0 81d
net-kourier-controller-76c68964f7-nhwts 1/1 Running 0 81d
webhook-6c59d8bf9b-h6kqc 1/1 Running 0 81d
$ k apply -f - <<EOF
apiVersion: sources.tanzu.vmware.com/v1alpha1
kind: VSphereSource
metadata:
name: vcenter-lab
namespace: vmware-events
spec:
address: https://<vcenter_address>
secretRef:
name: vcenter-credentials
sink:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: kn-glesys-demo
EOF
$ k apply -f - <<EOF
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: kn-glesys-demo
namespace: vmware-events
spec:
template:
spec:
containers:
- image: ghcr.io/vmware-samples/vcenter-event-broker-appliance/kn-go-echo:1.1
EOF
$ k get ksvc -n vmware-events
NAME URL LATESTCREATED LATESTREADY READY REASON
kn-glesys-demo http://kn-glesys-demo.vmware-events.svc.cluster.local kn-glesys-demo-00001 kn-glesys-demo-00001 True
$ k logs -l serving.knative.dev/service=kn-glesys-demo -c user-container -n vmware-events
Context Attributes,
specversion: 1.0
type: com.vmware.vsphere.VmPoweredOnEvent.v0.echo
source: https://<vcenter_address>
id: 9665046
time: 2024-09-03T08:59:00.438Z
datacontenttype: application/json
Extensions,
eventclass: event
vsphereapiversion: 8.0.3.0
Data,
{
"Key": 9665046,
"ChainId": 9665044,
"CreatedTime": "2024-09-03T08:59:00.438Z",
...
"FullFormattedMessage": "wps******* on esx01 in GleSYS Lab has powered on",
}
$ k apply -f - <<EOF
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: kn-glesys-demo
namespace: vmware-events
spec:
template:
spec:
containers:
- image: <private-registry>/events/kn-go-vm-restarted-by-ha:1.0
EOF
$ k get ksvc -n vmware-events
NAME URL LATESTCREATED LATESTREADY READY REASON
kn-glesys-demo http://kn-glesys-demo.vmware-events.svc.cluster.local kn-glesys-demo-00002 kn-glesys-demo-00002 True
[root@esx01:~] vsish -e set /reliability/crashMe/Panic 1
Subject: VMware HA has restarted your server (wps*******) on a new node
From: info@glesys.com
Hi,
The hardware node where your server (wps*******) is running has experienced a host failure. VMware HA (High Availability) has detected the failure and restarted your server on an alternative node in the cluster. Your workload should now be fully accessible and functional again.
We apologize for any problems this short outage may have caused you.
Best regards,
Your friends at GleSYS
$ k get pod -l serving.knative.dev/service=kn-glesys-demo -n vmware-events -w
NAME READY STATUS RESTARTS AGE
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 2/2 Running 0 63s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 2/2 Terminating 0 2m3s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 1/2 Terminating 0 2m31s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 0/2 Terminating 0 2m33s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 0/2 Pending 0 0s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 0/2 ContainerCreating 0 0s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 1/2 Running 0 1s
kn-glesys-demo-00002-deployment-56f9c87f9b-9qggw 2/2 Running 0 1s
This article provides an overview of how we utilize our Kubernetes offering to enable event-driven automation by triggering functions based on events from our VMware VPS platform.
Of course, we have demonstrated one of the many potential use cases for running applications on a Kubernetes cluster. If you're interested in learning more about our managed Kubernetes offering for hosting your applications, please contact our sales team, and we would be delighted to schedule a meeting.
Kontakta oss gärna för mer information. Vi hjälper dig att komma fram till den bästa lösningen för dina behov.