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

88 lines
3.5 KiB
Plaintext
Raw Normal View History

---
layout: docs
page_title: Install Consul API Gateway
description: >-
Learn how to install custom resource definitions (CRDs) and configure the Helm chart so that you can run Consul API Gateway on your Kubernetes deployment.
---
# Install Consul API Gateway
This topic describes how to install and configure Consul API Gateway.
## Requirements
2022-08-02 16:10:49 +00:00
Ensure that the environment you are deploying Consul API Gateway in meets the requirements listed in the [Technical Specifications][tech-specs]. This includes validating that the requirements for minimum versions of software are met. Refer to the [Release Notes][rel-notes] for the version of API Gateway you are deploying.
## Installation
1. Set the version of Consul API Gateway you are installing as an environment variable. The following steps use this environment variable in commands and configurations.
2022-08-02 16:15:34 +00:00
```shell-session
Update docs for the release of Consul API Gateway v0.5 (#15015) * added usage folder to organize use case docs for CAPIgw * Add peer field to MeshService configuration page * Add first pass at guide for routing to peered services * Add exception to same-datacenter restriction for referenced Consul service * Add example HTTPRoute referencing the MeshService as backendRef * Add example ServiceResolver * Add note about current ServiceResolver requirement ServiceResolver may eventually be created implicitly by the API gateway controller, but that decision is pending. * tweaks to the usage page for routing to peered services * tweaks to the description in the configuration reference * resolved TO-DOs from previous iteration * Remove datacenter federation from limited support matrix * added tolerations doc * Remove note excluding k8s 1.24 since we now support it * Reorder sections to maintain alphabetical sort * Add example configuration for MeshService resource * Adjust wording + indentation of other docs * Use consistent "example-" prefix for resource names in example code * reframed the tolerations documentation; STILL A WIP * add helm chart documentation * removed tolerations from gwcconfig configuration model reference * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * update version to 0.5.0 * Update install.mdx * added release notes for v.0.5.x Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com> Co-authored-by: Sarah Alsmiller <sarah.alsmiller@hashicorp.com> Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> Co-authored-by: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com>
2022-11-17 23:42:25 +00:00
$ export VERSION=0.5.0
2022-08-02 16:15:34 +00:00
```
2022-04-29 16:52:00 +00:00
1. Issue the following command to install the CRDs:
2022-08-02 16:15:34 +00:00
```shell-session
$ kubectl apply --kustomize="github.com/hashicorp/consul-api-gateway/config/crd?ref=v$VERSION"
```
1. Create a `values.yaml` file for your Consul API Gateway deployment by copying the following content and running it in the environment where you set the `VERSION` environment variable. The Consul Helm chart uses this `values.yaml` file to deploy the API Gateway. 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). For more options to configure your Consul API Gateway deployment through the Helm chart, refer to [Helm Chart Configuration - apiGateway](https://www.consul.io/docs/k8s/helm#apigateway).
2022-08-08 15:16:24 +00:00
<CodeBlockConfig filename="values.yaml">
2022-08-02 16:07:29 +00:00
2022-08-08 14:32:28 +00:00
```shell
cat <<EOF > values.yaml
global:
name: consul
connectInject:
enabled: true
apiGateway:
enabled: true
image: hashicorp/consul-api-gateway:$VERSION
EOF
```
</CodeBlockConfig>
2022-07-21 20:12:49 +00:00
1. Install Consul API Gateway using the standard Consul Helm chart or Consul K8s CLI 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.
2022-08-02 16:07:29 +00:00
<Tabs>
<Tab heading="Consul K8s CLI (Mac Only)">
2022-07-21 20:12:49 +00:00
2022-08-08 15:16:24 +00:00
~> **Note:** Refer to the official [Consul K8S CLI documentation](https://www.consul.io/docs/k8s/k8s-cli) to find additional settings.
2022-08-08 15:16:24 +00:00
```shell-session
$ brew tap hashicorp/tap
```
2022-08-08 15:16:24 +00:00
```shell-session
$ brew install hashicorp/tap/consul-k8s
```
2022-08-08 15:16:24 +00:00
```shell-session
$ consul-k8s install -config-file=values.yaml -set global.image=hashicorp/consul:1.12.2
```
2022-07-21 20:12:49 +00:00
2022-08-02 16:07:29 +00:00
</Tab>
<Tab heading="Helm">
2022-07-21 20:12:49 +00:00
2022-08-08 15:16:24 +00:00
Add the HashiCorp Helm repository.
2022-07-21 20:12:49 +00:00
2022-08-08 15:16:24 +00:00
```shell-session
$ helm repo add hashicorp https://helm.releases.hashicorp.com
```
Install Consul with API Gateway on your Kubernetes cluster by specifying the `values.yaml` file.
2022-07-21 22:21:22 +00:00
2022-08-08 15:16:24 +00:00
```shell-session
Update docs for the release of Consul API Gateway v0.5 (#15015) * added usage folder to organize use case docs for CAPIgw * Add peer field to MeshService configuration page * Add first pass at guide for routing to peered services * Add exception to same-datacenter restriction for referenced Consul service * Add example HTTPRoute referencing the MeshService as backendRef * Add example ServiceResolver * Add note about current ServiceResolver requirement ServiceResolver may eventually be created implicitly by the API gateway controller, but that decision is pending. * tweaks to the usage page for routing to peered services * tweaks to the description in the configuration reference * resolved TO-DOs from previous iteration * Remove datacenter federation from limited support matrix * added tolerations doc * Remove note excluding k8s 1.24 since we now support it * Reorder sections to maintain alphabetical sort * Add example configuration for MeshService resource * Adjust wording + indentation of other docs * Use consistent "example-" prefix for resource names in example code * reframed the tolerations documentation; STILL A WIP * add helm chart documentation * removed tolerations from gwcconfig configuration model reference * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * update version to 0.5.0 * Update install.mdx * added release notes for v.0.5.x Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com> Co-authored-by: Sarah Alsmiller <sarah.alsmiller@hashicorp.com> Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> Co-authored-by: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com>
2022-11-17 23:42:25 +00:00
$ helm install consul hashicorp/consul --version 1.0.0 --values values.yaml --create-namespace --namespace consul
2022-08-08 15:16:24 +00:00
```
2022-08-02 16:07:29 +00:00
</Tab>
</Tabs>
2022-07-21 22:21:22 +00:00
2022-04-29 16:52:00 +00:00
<!--
2022-07-21 22:38:57 +00:00
****** KEEP ALL PAGE CONTENT ABOVE THIS LINE *******
Only Reference style links should be added below this comment
2022-04-29 16:52:00 +00:00
--->
2022-07-21 22:38:57 +00:00
[tech-specs]: /docs/api-gateway/tech-specs
2022-04-29 16:52:00 +00:00
[rel-notes]: /docs/release-notes