microservice
by dariobit
Simple microservice
About this chart
microservice
Generic helm chart to create a Kubernetes microservice.
Introduction
This chart creates a microservice with commonly used Kubernetes resources using the Helm package manager. The goal is to allow the consumers to toggle resources that are common in most deployment scenarios.
Essential resources
These resources will always be provisioned, as they are essential to define what we consider an "application".
deploymentservice
Togglable resources
These resources can be configured or totally skipped depending on your business needs.
configmap- The attributes defined in
configwill automatically be loaded as environment variables to the target pod.
- The attributes defined in
externalsecret->secret- An external secret can be defined with the
externalSecretsetting. Its generated secret's data values will be loaded as environment variables to the target pod.
- An external secret can be defined with the
hpa- Horizontal automatic scaling rules of pods. Can be defined with the
autoscalingsetting.
- Horizontal automatic scaling rules of pods. Can be defined with the
envoy- Envoy Gateway resources (HTTPRoute, GRPCRoute, ReferenceGrant, BackendTrafficPolicy). Defined under
envoy.*.
- Envoy Gateway resources (HTTPRoute, GRPCRoute, ReferenceGrant, BackendTrafficPolicy). Defined under
ingress- Rules to open external access to the workload. Can be defined with
ingress.
- Rules to open external access to the workload. Can be defined with
poddisruptionbudget- Limit the number of concurrent disruptions for the application. Defined with
podDisruptionBudget.
- Limit the number of concurrent disruptions for the application. Defined with
serviceaccount- Configure a service account for the pods. Defined with
serviceAccount.
- Configure a service account for the pods. Defined with
vpa- Set up vertical pod autoscaling. Defined with
vpa.
- Set up vertical pod autoscaling. Defined with
Installing the Chart
Add the parcellab charts repo:
helm repo add parcellab https://charts.parcellab.dev
Install the chart:
helm install --name my-microservice-name parcellab/microservice
Uninstalling the Chart
To delete the deployed chart:
helm uninstall my-microservice-name
The command removes all the Kubernetes components associated with the chart and deletes the release.
Updating the Chart
You can update the chart values and trigger a pod reload. If the configmap changes, it will automatically retrieve the new values.
helm upgrade -f values.yaml my-microservice-name parcellab/microservice
Deploy microservice with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has microservice on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmicroservice is pinned at v0.6.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply