Configure Akka Microservices deployments

Customize AkkaMicroservices deployments

To apply customizations on top of a default deployment descriptor (CR) we recommend using Kustomize new tab, built into kubectl.

Prepare a folder called base containing the following files:

The default deployment descriptor (CR):

base/shopping-cart-service-cr.yml
apiVersion: akka.lightbend.com/v1
kind: AkkaMicroservice
metadata:
  name: shopping-cart-service
spec:
  image: <image>

A basic reference to it for Kustomize:

resources:
- shopping-cart-service-cr.yml

You can already deploy your default service by running:

kubectl apply -k base

Apply customizations

If you want to deploy, e.g., to an environment with limited resources you can tweak just a few parameters in the CR.

Create a separate folder along base and call it custom with this content:

The actual customization:

custom/custom.yml
apiVersion: akka.lightbend.com/v1
kind: AkkaMicroservice
metadata:
  name: shopping-cart-service
spec:
  replicas: 1
  resources:
    limits:
      memory: 512Mi
    requests:
      cpu: 500m
      memory: 512Mi

And a reference to the customization:

custom/kustomization.yml
bases:
- ../base
patchesStrategicMerge:
- custom.yaml

You can now deploy to a resource limited environment by running:

kubectl apply -k custom