consul/website/content/docs/api-gateway/consul-api-gateway-install.mdx

112 lines
4.5 KiB
Markdown

---
layout: docs
page_title: Consul API Gateway Install
description: >-
Installing Consul API Gateway
---
# Installing Consul API Gateway
This topic describes how to use the Consul API Gateway add-on module. It includes instructions for installation and configuration.
## Requirements
Verify that your environment meets the following requirements prior to using Consul API Gateway.
### Datacenter Requirements
Your datacenter must meet the following requirements prior to configuring the Consul API Gateway:
- Kubernetes 1.21+
- Kubernetes 1.24 is not supported at this time.
- `kubectl` 1.21+
- Consul 1.11.2+
- HashiCorp Consul Helm chart 0.45.0+
- Consul Service Mesh must be deployed on the Kubernetes cluster that API Gateway is deployed on.
- Envoy: Envoy proxy support is determined by the Consul version deployed. Refer to [Envoy Integration](/docs/connect/proxies/envoy) for details.
### TCP Port Requirements
The following table describes the TCP port requirements for each component of the API Gateway.
| Port | Description | Component |
| ---- | ----------- | --------- |
| 9090 | Secret discovery service (SDS) | Gateway controller pod <br/> Gateway instance pod |
| 20000 | Kubernetes readiness probe | Gateway instance pod |
| Configurable | Port for scraping Prometheus metrics. Disabled by default. | Gateway controller pod |
## Consul Server Deployments
- Consul Editions supported: OSS and Enterprise
- Supported Consul Server deployment types:
- Self-Managed
- HCP Consul
## Deployment Environments
Consul API Gateway can be deployed in the following Kubernetes-based environments:
- Generic Kubernetes
- AWS Elastic Kubernetes Service (EKS)
- Google Kubernetes Engine (GKE)
- Azure Kubernetes Service (AKS)
## Kubernetes Gateway API Specification - Supported Versions
See the Release Notes for the version of Consul API Gateway being used.
## Resource Allocations
The following resources are allocated for each component of the API Gateway.
### Gateway Controller Pod
- **CPU**: None. Either the namespace or cluster default is allocated, depending on the Kubernetes cluster configuration.
- **Memory**: None. Either the the namespace or cluster default is allocated, depending on the Kubernetes cluster configuration.
### Gateway Instance Pod
- **CPU**: None. Either the namespace or cluster default is allocated, depending on the Kubernetes cluster configuration.
- **Memory**: None. Either the namespace or cluster default is allocated, depending on the Kubernetes cluster configuration.
## Installation
-> **Version reference convention:** Replace `VERSION` in command and configuration examples with the Consul API Gateway version you are installing, such as `0.3.0`. In some instances, `VERSION` is prepended with a lowercase _v_. This indicates that you must include the `v` as is part of the version, for example `v0.3.0`.
1. Issue the following command to install the CRDs:
```shell-session
$ kubectl apply --kustomize="github.com/hashicorp/consul-api-gateway/config/crd?ref=vVERSION"
```
1. Create a `values.yaml` file for your Consul API Gateway deployment. Copy the content below into the `values.yaml` file. The `values.yaml` will be used by the Consul Helm chart. Available versions of the [Consul](https://hub.docker.com/r/hashicorp/consul/tags) and [Consul API Gateway](https://hub.docker.com/r/hashicorp/consul-api-gateway/tags) Docker images can be found on DockerHub, with additional context on version compatibility published in [GitHub releases](https://github.com/hashicorp/consul-api-gateway/releases). See [Helm Chart Configuration - apiGateway](https://www.consul.io/docs/k8s/helm#apigateway) for more available options on how to configure your Consul API Gateway deployment via the Helm chart.
<CodeBlockConfig hideClipboard filename="values.yaml">
```yaml
global:
name: consul
connectInject:
enabled: true
controller:
enabled: true
apiGateway:
enabled: true
image: hashicorp/consul-api-gateway:VERSION
```
</CodeBlockConfig>
1. Install Consul API Gateway using the standard Consul Helm chart and specify the custom values file. Available versions of the [Consul Helm chart](https://github.com/hashicorp/consul-k8s/releases) can be found in GitHub releases.
```shell-session
$ helm install consul hashicorp/consul --version 0.45.0 --values values.yaml --create-namespace --namespace consul
```
<!--
****** KEEP ALL PAGE CONTENT ABOVE THIS LINE *******
Only Reference style links should be added below this comment
--->
[rel-notes]: /docs/release-notes