Back to Charts

!!DEPRECATED!! Please use https://github.com/datawire/ambassador-chart.

stable/ambassador/README.md

latest24.3 KB
Original Source

!!DEPRECATED!! Please use https://github.com/datawire/ambassador-chart.

helm/charts has been deprecated and will be obsolete by Nov 13 2020. For this reason, the datawire team as retaken ownership of this chart.

The Ambassador Chart is now hosted at datawire/ambassador-chart.


Ambassador

Ambassador is an open source, Kubernetes-native microservices API gateway built on the Envoy Proxy.

TL;DR;

console
$ helm install stable/ambassador

Introduction

This chart bootstraps an Ambassador deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.7+

Installing the Chart

To install the chart with the release name my-release:

console
$ helm install --name my-release stable/ambassador

The command deploys Ambassador API gateway on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

console
$ helm delete --purge my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Changelog

Notable chart changes are listed in the CHANGELOG

Configuration

The following tables lists the configurable parameters of the Ambassador chart and their default values.

ParameterDescriptionDefault
adminService.createIf true, create a service for Ambassador's admin UItrue
adminService.nodePortIf explicit NodePort for admin service is requiredtrue
adminService.typeAmbassador's admin service type to be usedClusterIP
adminService.annotationsAnnotations to apply to Ambassador admin service{}
adminService.loadBalancerIPIP address to assign (if cloud provider supports it)""
adminService.loadBalancerSourceRangesPassed to cloud provider load balancer if created (e.g: AWS ELB)None
ambassadorConfigConfig thats mounted to /ambassador/ambassador-config""
crds.enabledIf true, enables CRD resources for the installation.true
crds.createIf true, Creates CRD resourcestrue
crds.keepIf true, if the ambassador CRDs should be kept when the chart is deletedtrue
daemonSetIf true, Create a DaemonSet. By default Deployment controller will be createdfalse
hostNetworkIf true, uses the host network, useful for on-premise setupsfalse
dnsPolicyDns policy, when hostNetwork set to ClusterFirstWithHostNetClusterFirst
envAny additional environment variables for ambassador pods{}
image.pullPolicyAmbassador image pull policyIfNotPresent
image.repositoryAmbassador imagequay.io/datawire/ambassador
image.tagAmbassador image tag0.86.1
imagePullSecretsImage pull secrets[]
namespace.nameSet the AMBASSADOR_NAMESPACE environment variablemetadata.namespace
scope.singleNamespaceSet the AMBASSADOR_SINGLE_NAMESPACE environment variable and create namespaced RBAC if rbac.enabled: truefalse
podAnnotationsAdditional annotations for ambassador pods{}
deploymentAnnotationsAdditional annotations for ambassador DaemonSet/Deployment{}
podLabelsAdditional labels for ambassador pods
extraLabelsAdditional labels for ambassador Kubernetes resources
affinityAffinity for ambassador pods{}
priorityClassNameThe name of the priorityClass for the ambassador DaemonSet/Deployment""
rbac.createIf true, create and use RBAC resourcestrue
rbac.podSecurityPoliciespod security polices to bind to
replicaCountNumber of Ambassador replicas3
resourcesCPU/memory resource requests/limits{}
securityContextSet security context for pod{ "runAsUser": "8888" }
initContainersContainers used to initialize context for pods[]
sidecarContainersContainers that share the pod context[]
livenessProbe.initialDelaySecondsInitial delay (s) for Ambassador pod's liveness probe30
livenessProbe.periodSecondsProbe period (s) for Ambassador pod's liveness probe3
livenessProbe.failureThresholdFailure threshold for Ambassador pod's liveness probe3
readinessProbe.initialDelaySecondsInitial delay (s) for Ambassador pod's readiness probe30
readinessProbe.periodSecondsProbe period (s) for Ambassador pod's readiness probe3
readinessProbe.failureThresholdFailure threshold for Ambassador pod's readiness probe3
service.annotationsAnnotations to apply to Ambassador service""
service.externalTrafficPolicySets the external traffic policy for the service""
service.portsList of ports Ambassador is listening on[{"name": "http","port": 80,"targetPort": 8080},{"name": "https","port": 443,"targetPort": 8443}]
service.loadBalancerIPIP address to assign (if cloud provider supports it)""
service.loadBalancerSourceRangesPassed to cloud provider load balancer if created (e.g: AWS ELB)None
service.typeService type to be usedLoadBalancer
serviceAccount.createIf true, create a new service accounttrue
serviceAccount.nameService account to be usedambassador
volumeMountsVolume mounts for the ambassador service[]
volumesVolumes for the ambassador service[]
pro.enabledInstalls the Ambassador Pro container as a sidecar to Ambassadorfalse
pro.image.repositoryAmbassador Pro imagequay.io/datawire/ambassador_pro
pro.image.tagAmbassador Pro image tag0.11.0
pro.image.customBuildTagImage for a custom build of Ambassador Pro using a Plugin``
pro.ports.authAmbassador Pro authentication port8500
pro.ports.ratelimitAmbassador Pro ratelimit port8500
pro.logLevelLog level for Ambassador Pro"info"
pro.licenseKey.valueLicense key for Ambassador Pro""
pro.licenseKey.secret.enabledReads the license key as a base64-encoded string in a Kubernetes secrettrue
pro.licenseKey.secret.createStores the license key as a base64-encoded string in a Kubernetes secrettrue
pro.envSet additional environment variables for Ambassador Pro. (See below){}
pro.resourcesSet resource requests and limits from Ambassador Pro{}
pro.authService.enabledEnables the Ambassador Pro authentication servicetrue
pro.authService.optional_configurationsExposes additional configuration options for the AuthService""
pro.rateLimit.enabledEnables the Ambassador Pro rate limit servicetrue
pro.rateLimit.redis.annotations.deploymentAnnotations for the redis deployment{}
pro.rateLimit.redis.annotations.serviceAnnotations for the redis service{}
pro.rateLimit.redis.resourcesSet resource requests and limits for the rate limit service's redis instance{}
pro.devPortal.enabledEnables the Ambassador Developer Portalfalse
autoscaling.enabledIf true, creates Horizontal Pod Autoscalerfalse
autoscaling.minReplicaIf autoscaling enabled, this field sets minimum replica count2
autoscaling.maxReplicaIf autoscaling enabled, this field sets maximum replica count5
autoscaling.metricsIf autoscaling enabled, configure hpa metrics
podDisruptionBudgetPod disruption budget rules{}
prometheusExporter.enabledDEPRECATED: Prometheus exporter side-car enabledfalse
prometheusExporter.pullPolicyDEPRECATED: Image pull policyIfNotPresent
prometheusExporter.repositoryDEPRECATED: Prometheus exporter imageprom/statsd-exporter
prometheusExporter.tagDEPRECATED: Prometheus exporter imagev0.8.1
prometheusExporter.resourcesDEPRECATED: CPU/memory resource requests/limits{}

NOTE: Make sure the configured service.http.targetPort and service.https.targetPort ports match your Ambassador Module's service_port and redirect_cleartext_from configurations.

CRDs

This helm chart includes the creation of the core CRDs Ambassador uses for configuration.

The crds flags let you configure how a release manages crds.

  • crds.create Can only be set on your first/master Ambassador release.
  • crds.enabled Should be set on all releases using Ambassador CRDs
  • crds.keep Configures if the CRDs are deleted when the master release is purged. This value is only checked for the master release and can be set to any value on secondary releases.

Annotations

Ambassador configuration is done through annotations on Kubernetes services or Custom Resource Definitions (CRDs). The service.annotations section of the values file contains commented out examples of Ambassador Module and a global TLSContext configurations which are typically created in the Ambassador service.

If you intend to use service.annotations, remember to include the getambassador.io/config annotation key as above.

Prometheus Metrics

Using the Prometheus Exporter has been deprecated and is no longer recommended.

Please see Ambassador's monitoring with Prometheus docs for more information on using the /metrics endpoint for metrics collection.

Ambassador Pro

Setting pro.enabled: true will install Ambassador Pro as a sidecar to Ambassador with the required CRDs and redis instance.

You must set the pro.licenseKey.value to the license key issued to you. Sign up for a free trial of Ambassador Pro or contact our sales team to obtain a license key.

pro.ports.auth and pro.ports.ratelimit must be the same value. If changing one, you must change the other.

For most use cases, pro.image and pro.ports can be left as default.

Ambassador Pro Environment

Click here for full information regarding the different environment variables for Ambassador Pro.

Some environment variables are set by default. Some of these are configurable in the Values file.

Environment VariableDefault ValueConfigurable
REDIS_SOCKET_TYPE"tcp"No
REDIS_URL{{release name}}-pro-redis:6379No
APRO_HTTP_PORT8500pro.ports.auth
APP_LOG_LEVEL"info"pro.logLevel
AMBASSADOR_NAMESPACEmetadata.namespacenamespace.name
AMBASSADOR_IDdefaultenv
AMBASSADOR_LICENSE_KEY""pro.licenseKey

Additional environment variables can be set with pro.env

Note: The Ambassador Pro container uses the same AMBASSADOR_ID as set in env for the Ambassador container. Setting AMBASSADOR_ID with pro.env will be ignored.

Specifying Values

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

console
$ helm upgrade --install --wait my-release \
    --set adminService.type=NodePort \
    stable/ambassador

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

console
$ helm upgrade --install --wait my-release -f values.yaml stable/ambassador

Upgrading

To 5.0.0

Breaking changes

Note If upgrading an existing helm 2 installation no action is needed, previously installed CRDs will not be modified.

  • Helm 3 support for CRDs was added. Specifically, the CRD templates were moved to non-templated files in the /crds directory, and to keep Helm 2 support they are globbed from there by /templates/crds.yaml. However, because Helm 3 CRDs are not templated, the labels for new installations have necessarily changed

To 4.0.0

The 4.0.0 chart contains a number of changes to the way Ambassador Pro is installed.

  • Introduces the performance tuned and certified build of open source Ambassador, Ambassador core
  • The license key is now stored and read from a Kubernetes secret by default
  • Added .Values.pro.licenseKey.secret.enabled .Values.pro.licenseKey.secret.create fields to allow multiple releases in the same namespace to use the same license key secret.
  • Introduces the ability to configure resource limits for both Ambassador Pro and it's redis instance
  • Introduces the ability to configure additional AuthService options (see AuthService documentation)
  • The ambassador-pro-auth AuthService and ambassador-pro-ratelimit RateLimitService and now created as CRDs when .Values.crds.enabled: true
  • Fixed misnamed selector for redis instance that failed in an edge case
  • Exposes annotations for redis deployment and service

Breaking changes

The value of .Values.pro.image.tag has been shortened to assume amb-sidecar (and amb-core for Ambassador core) values.yaml

diff
<3.0.0>
  image:
    repository: quay.io/datawire/ambassador_pro
-    tag: amb-sidecar-0.6.0

<4.0.0+>
  image:
    repository: quay.io/datawire/ambassador_pro
+    tag: 0.7.0

Method for creating a Kubernetes secret to hold the license key has been changed

values.yaml

diff
<3.0.0>
-    secret: false
<4.0.0>
+    secret:
+      enabled: true
+      create: true

To 3.0.0

Service Ports

The way ports are assigned has been changed for a more dynamic method.

Now, instead of setting the port assignments for only the http and https, any port can be open on the load balancer using a list like you would in a standard Kubernetes YAML manifest.

pre-3.0.0

yaml
service:
  http:
    enabled: true
    port: 80
    targetPort: 8080
  https:
    enabled: true
    port: 443
    targetPort: 8443

3.0.0

yaml
service:
  ports:
  - name: http
    port: 80
    targetPort: 8080
  - name: https
    port: 443
    targetPort: 8443

This change has also replaced the .additionalTCPPorts configuration. Additional TCP ports can be created the same as the http and https ports above.

Annotations and service_port

The below Ambassador Module annotation is no longer being applied by default.

yaml
getambassador.io/config: |
  ---
  apiVersion: ambassador/v1
  kind: Module
  name: ambassador
  config:
    service_port: 8080

This was causing confusion with the service_port being hard-coded when enabling TLS termination in Ambassador.

Ambassador has been listening on port 8080 for HTTP and 8443 for HTTPS by default since version 0.60.0 (chart version 2.2.0).

RBAC and CRDs

A ClusterRole and ClusterRoleBinding named {{release name}}-crd will be created to watch for the Ambassador Custom Resource Definitions. This will be created regardless of the value of scope.singleNamespace since CRDs are created the cluster scope.

rbac.namespaced has been removed. For namespaced RBAC, set scope.singleNamespace: true and rbac.enabled: true.

crds.enabled will indicate that you are using CRDs and will create the rbac resources regardless of the value of crds.create. This allows for multiple deployments to use the CRDs.

To 2.0.0

Ambassador ID

ambassador.id has been removed in favor of setting it via an environment variable in env. AMBASSADOR_ID defaults to default if not set in the environment. This is mainly used for running multiple Ambassadors in the same cluster.

ParameterEnv variables
ambassador.idAMBASSADOR_ID

Migrating from datawire/ambassador chart (chart version 0.40.0 or 0.50.0)

Chart now runs ambassador as non-root by default, so you might need to update your ambassador module config to match this.

Timings

Timings values have been removed in favor of setting the env variables using `env´

ParameterEnv variables
timing.restartAMBASSADOR_RESTART_TIME
timing.drainAMBASSADOR_DRAIN_TIME
timing.shutdownAMBASSADOR_SHUTDOWN_TIME

Single namespace

ParameterEnv variables
namespace.singleAMBASSADOR_SINGLE_NAMESPACE

Renamed values

Service ports values have changed names and target ports have new defaults.

Previous parameterNew parameterNew default value
service.enableHttpservice.http.enabled
service.httpPortservice.http.port
service.httpNodePortservice.http.nodePort
service.targetPorts.httpservice.http.targetPort8080
service.enableHttpsservice.https.enabled
service.httpsPortservice.https.port
service.httpsNodePortservice.https.nodePort
service.targetPorts.httpsservice.https.targetPort8443

Exporter sidecar

Pre version 0.50.0 ambassador was using socat and required a sidecar to export statsd metrics. In 0.50.0 ambassador no longer uses socat and doesn't need a sidecar anymore to export its statsd metrics. Statsd metrics are disabled by default and can be enabled by setting environment STATSD_ENABLED, this will (in 0.50) send metrics to a service named statsd-sink, if you want to send it to another service or namespace it can be changed by setting STATSD_HOST

If you are using prometheus the chart allows you to enable a sidecar which can export to prometheus see the prometheusExporter values.