Addon: Ambassador

:warning:Ambassador is available in MicroK8s versions 1.19, 1.20, 1.21, 1.22 and 1.23. It has been removed in MicroK8s versions 1.24 and newer.

Ambassador API Gateway enables you to easily expose, secure, and manage traffic to your Kubernetes microservices of any type. Enable this add on with:

microk8s enable ambassador

You can now expose a Service by creating an Ingress . Note that Ambassador will only serve Ingress resources that include the annotation kubernetes.io/ingress.class: ambassador (otherwise they are just ignored).

For example:

cat<<EOF | microk8s.kubectl apply -f -
---
kind: Pod
apiVersion: v1
metadata:
  name: foo-app
  labels:
    app: foo
spec:
  containers:
  - name: foo-app
    image: hashicorp/http-echo:0.2.3
    args:
    - "-text=foo"
---
kind: Service
apiVersion: v1
metadata:
  name: foo-service
spec:
  selector:
    app: foo
  ports:
  # Default port used by the image
  - port: 5678
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: ambassador
spec:
  rules:
  - http:
      paths:
      - path: /foo
        backend:
          serviceName: foo-service
          servicePort: 5678
EOF

Now verify that the ingress works:

# should output "foo"
curl localhost/foo
2 Likes

(Suggested documentation for the Ambassador API Gateway)

Ambassador API Gateway enables you to easily expose, secure, and manage traffic
to your Kubernetes microservices of any type. Enable this add on with:

microk8s enable ambassador

Ambassador is now ready for use. Now you can try to expose a Service by creating an Ingress. Note well that Ambassador will only serve Ingress resources that include the annotation kubernetes.io/ingress.class: ambassador (otherwise they are just ignored).

cat<<EOF | microk8s.kubectl apply -f -
---
kind: Pod
apiVersion: v1
metadata:
  name: foo-app
  labels:
    app: foo
spec:
  containers:
  - name: foo-app
    image: hashicorp/http-echo:0.2.3
    args:
    - "-text=foo"
---
kind: Service
apiVersion: v1
metadata:
  name: foo-service
spec:
  selector:
    app: foo
  ports:
  # Default port used by the image
  - port: 5678
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: ambassador
spec:
  rules:
  - http:
      paths:
      - path: /foo
        backend:
          serviceName: foo-service
          servicePort: 5678
EOF

Now verify that the ingress works:

# should output "foo"
curl localhost/foo
1 Like

@inercia thanks for the example! I will get this added to the docs.

When i click on the ambassador docs link here (https://microk8s.io/docs/addon-ambassador) i get error 500.

I’ve poked around the posts here, but I can’t see anything wrong with the way it was added. I guess we’ll file an issue on the docs site

@balchua1 just FYI, this will be fixed soon - https://github.com/canonical-web-and-design/canonicalwebteam.discourse-docs/pull/42

2 Likes

Hi @stevek,

MicroK8s will deploy the latest Ambassador, see [1]. As soon as this is addressed by the Ambassador project we will pick them up. You may want to bring this point to [2].

Thank you

[1] https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/enable.ambassador.sh
[2] https://github.com/datawire/ambassador-operator

Hello there,

I think it’d be nice to mention that Ambassador is not supported on ARM/ Raspi deployments.

Is it just me or anyone else facing the same issue?

Installed fresh MicroK8S 1.23

microk8s enable ambassador

Enabling Ambassador
Addon dns is already enabled.
error: unable to recognize “https://github.com/datawire/ambassador-operator/releases/latest/download/ambassador-operator-crds.yaml”: no matches for kind “CustomResourceDefinition” in version “apiextensions.k8s.io/v1beta1

I see, it’s Kubernetes 1.23 and the API version

Running on 1.21 gives,

microk8s enable ambassador

Enabling Ambassador
Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition

Hi @amitoj ,
The current maintainer of the addon has created a issue in the github web page of ambassador.

Currently it seems that the maintainer of ambassador don’t do nothing, so the bug isn’t fixed.

For more info check this issue: WIP: fix ambassador yaml by spowelljr · Pull Request #12450 · kubernetes/minikube · GitHub