Install API gateway for Kubernetes

The Consul API gateway ships with Consul and is automatically installed when you install Consul on Kubernetes. Before you begin the installation process, verify that the environment you are deploying Consul and the API gateway in meets the requirements listed in the Technical Specifications. Refer to the Release Notes for any additional information about the version you are deploying.

  1. Create a values.yaml file for configuring your Consul API gateway deployment and include the following settings:

    Installation - 图1

    values.yaml

    1. global:
    2. name: consul
    3. connectInject:
    4. enabled: true
    5. apiGateway:
    6. manageExternalCRDs: true

    The Consul Helm chart deploys the API gateway using the configuration specified in the values.yaml file. Refer to Helm Chart Configuration - connectInject.apiGateway for information about the Helm chart configuration options.

  2. Install Consul API Gateway using the standard Consul Helm chart or Consul K8s CLI specify the custom values file. Refer to the Consul Helm chart in GitHub releases for the available versions.

Refer to the official Consul K8S CLI documentation to find additional settings.

  1. $ brew tap hashicorp/tap
  1. $ brew install hashicorp/tap/consul-k8s
  1. $ consul-k8s install -config-file=values.yaml -set global.image=hashicorp/consul:1.16.0

Add the HashiCorp Helm repository.

  1. $ helm repo add hashicorp https://helm.releases.hashicorp.com

Install Consul with API Gateway on your Kubernetes cluster by specifying the values.yaml file.

  1. $ helm install consul hashicorp/consul --version 1.2.0 --values values.yaml --create-namespace --namespace consul