Contact Us 1-800-596-4880

Update Pod Settings for a Flex Gateway Deployment Through a Helm Chart

Change requirements for a Pod that contains a Flex Gateway deployment. The example in this guide sets the following CPU and memory requirements in the Helm chart for a Flex Gateway deployment:

  • resources.limits.cpu=1500m

  • resources.limits.memory=2048Mi

  • resources.requests.cpu=260m

  • resources.requests.memory=384Mi

Use this example as a guide to updating values in the Helm chart for your Flex Gateway deployment.

Find the default Helm chart settings for Flex Gateway through one of the following methods:

  • Open the flex-gateway page in ArtifactHUB

  • Run helm show values <repository-name>/<chart-name> from a terminal window, for example, helm show values flex-gateway/flex-gateway.

For details about CPU and memory resource settings, see the Kubernetes documentation.

Before You Begin

Register and deploy Flex Gateway to a Kubernetes cluster. For guidance, see Setting Up Flex Gateway or Getting Started with Flex Gateway in a Kubernetes Cluster.

Check the Current Settings of Your Helm Chart

Before updating settings for a Pod that contains a Flex Gateway deployment, check the Pod’s settings for the current deployment.

  1. Ensure that your Helm repository is up and available by running the following command from a terminal window:

    helm repo up
  2. Find the REVISION number of the latest deployment.

    The following example requests the history of the ingress release in the gateway namespace:

    helm history ingress -n gateway

    The command returns a result similar to this one:

    REVISION  UPDATED                 	STATUS    	CHART             	APP VERSION	DESCRIPTION
    1         Mon Mar 27 09:36:20 2023	superseded	flex-gateway-1.4.2	1.4.2      	Upgrade complete
    2         Mon Mar 27 11:40:56 2023	deployed  	flex-gateway-1.4.2	1.4.2      	Upgrade complete
  3. Check for USER-SUPPLIED VALUES settings for resources in the currently deployed revision:

    Command Syntax:
    helm get values --revision=<version-number> <release-name> -n <namespace>
    Example:
    helm get values --revision=2 ingress -n gateway

    The following example shows the resources settings for the Pod’s CPU and memory below the Pod’s registration data:

    USER-SUPPLIED VALUES:
    registration:
      ...
    resources:
      limits:
        cpu: 1000m
        memory: 2024Mi
      requests:
        cpu: 250m
        memory: 256Mi

    This example displays settings from REVISION number 2. The output displays only revised settings. If your chart has never revised the default Helm chart values, no revisions appear in the output.

  4. Use one of the following procedures to change settings in the Helm chart for your Flex Gateway deployment:

Modify Settings for Your Helm Chart

After following the steps in Check the Current Settings of Your Helm Chart, use the --set option to pass new values individually to the Helm chart for your Flex Gateway deployment. Alternatively, follow the procedure in Provide a File with Modified Settings for Your Helm Chart.

  1. Change the cpu and memory values by using the helm upgrade command.

    Syntax:
    helm -n <namespace> upgrade <release-name> \
    --wait \
    --reuse-values \
    <repository-name>/<chart-name> \
    --set <key-to-update>=<new-value>
    --set <next-key-to-update>=<new-value>
    ...
    Example:
    helm -n gateway upgrade ingress \
    --wait \
    --reuse-values \
    flex-gateway/flex-gateway \
    --set resources.limits.cpu=1500m \
    --set resources.limits.memory=2048Mi \
    --set resources.requests.cpu=260m \
    --set resources.requests.memory=384Mi

    When successful, the command returns output similar to this:

    Release "ingress" has been upgraded. Happy Helming!
    NAME: ingress
    LAST DEPLOYED: Mon Mar 27 11:58:36 2023
    NAMESPACE: gateway
    STATUS: deployed
    REVISION: 3
    TEST SUITE: None
  2. Using the new REVISION value, check the resources settings, for example:

    helm get values --revision=3 ingress -n gateway

    The output displays the new resources settings for the Pod:

    USER-SUPPLIED VALUES:
    registration:
      ...
    resources:
      limits:
        cpu: 1500m
        memory: 2048Mi
      requests:
        cpu: 260m
        memory: 384Mi

Provide a File with Modified Settings for Your Helm Chart

After following the steps in Check the Current Settings of Your Helm Chart, use the -f option with helm upgrade to identify the file that contains new Helm chart settings for your Flex Gateway deployment. Alternatively, follow the procedure in Modify Settings for Your Helm Chart.

  1. Create a configuration file that contains your new settings.

    For example, create a YAML file named my-config-file.yaml that contains the new cpu and memory values:

    resources:
      limits:
        cpu: 1500m
        memory: 2048Mi
      requests:
        cpu: 260m
        memory: 384Mi
  2. Pass the new values from your configuration file to your Helm chart, for example:

    Syntax:
    helm -n <namespace> upgrade <release-name> \
    --wait \
    --reuse-values \
    <repository-name>/<chart-name> \
    -f <your-settings-config-file>
    Example:
    helm -n gateway upgrade ingress \
    --wait \
    --reuse-values \
    flex-gateway/flex-gateway \
    -f my-config-file.yaml

    When successful, the command returns output similar to this:

    Release "ingress" has been upgraded. Happy Helming!
    NAME: ingress
    LAST DEPLOYED: Mon Mar 27 16:38:07 2023
    NAMESPACE: gateway
    STATUS: deployed
    REVISION: 4
    TEST SUITE: None
  3. Using your Helm repository and chart names, verify the update to your chart, for example:

    helm get values --revision=4 ingress -n gateway

    The output displays the new resources settings for the Pod:

    USER-SUPPLIED VALUES:
    registration:
      ...
    resources:
      limits:
        cpu: 1500m
        memory: 2048Mi
      requests:
        cpu: 260m
        memory: 384Mi