Install Ambassador API Gateway on GKE using Helm3

Deploy helm3 Ambassador chart to GKE

just use all default values for now, we’ll just check we can get things going

syntax is: helm3 install [release-name] [chart location] --namespace [namespace to deploy to]

$ helm3 install ambassador ambassador/ --namespace default

check it

ubuntudevbox:~/GCP/charts/ambassador$ kubectl get pods,svc
NAME                             READY   STATUS    RESTARTS   AGE
pod/ambassador-75f4d6c6f-8q9s4   1/1     Running   0          15m
pod/ambassador-75f4d6c6f-qj2n9   1/1     Running   0          15m
pod/ambassador-75f4d6c6f-r8jjb   1/1     Running   0          15m

NAME                       TYPE           CLUSTER-IP   EXTERNAL-IP      PORT(S)                      AGE
service/ambassador         LoadBalancer   10.4.12.56   104.154.108.90   80:31540/TCP,443:31719/TCP   15m
service/ambassador-admin   ClusterIP      10.4.10.51   <none>           8877/TCP                     15m
service/kubernetes         ClusterIP      10.4.0.1     <none>           443/TCP                      40m

Right, what do we have here?

  • 3 x replica pods (as set in our values.yaml)
  • 1 x LoadBalancer IP - this is the externally exposed IP to hit from the outside
  • 1 x ClusterIP - for the admin interface on port 8877

Deploy a test UI endpoint that uses Ambassador

We go to the LoadBalancer IP 104.154.108.90 and see nothing

LoadBalancer IP

On Ambassador’s ‘getting started’ page, there’s a sample app we can deploy to test this sucker out.

deploy the tour-ui web

Either deploy straight off the web:

$ kubectl apply -f https://getambassador.io/yaml/tour/tour.yaml

OR, grab the yaml here: https://getambassador.io/yaml/tour/tour.yaml

alternatively copy-paste this to a file called tour.yaml - and deploy it locally with $ kubectl apply -f ./tour.yaml

---
apiVersion: getambassador.io/v1
kind: Mapping
metadata:
  name: tour-ui
spec:
  prefix: /
  service: tour:5000
---
apiVersion: getambassador.io/v1
kind: Mapping
metadata:
  name: tour-backend
spec:
  prefix: /backend/
  service: tour:8080
  labels:
    ambassador:
      - request_label:
        - backend
---
apiVersion: v1
kind: Service
metadata:
  name: tour
spec:
  ports:
  - name: ui
    port: 5000
    targetPort: 5000
  - name: backend
    port: 8080
    targetPort: 8080
  selector:
    app: tour
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tour
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tour
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: tour
    spec:
      containers:
      - name: tour-ui
        image: quay.io/datawire/tour:ui-0.2.6
        ports:
        - name: http
          containerPort: 5000
      - name: backend
        image: quay.io/datawire/tour:backend-0.2.6
        ports:
        - name: http
          containerPort: 8080
        resources:
          limits:
            cpu: "0.1"
            memory: 100Mi

output deploying tour.yaml

ubuntudevbox:~/GCP/charts/ambassador$ kubectl apply -f https://getambassador.io/yaml/tour/tour.yaml
service/tour created
deployment.apps/tour created
unable to recognize "https://getambassador.io/yaml/tour/tour.yaml": no matches for kind "Mapping" in version "getambassador.io/v1"
unable to recognize "https://getambassador.io/yaml/tour/tour.yaml": no matches for kind "Mapping" in version "getambassador.io/v1"

check the mapping

ubuntudevbox:~/GCP/charts/ambassador$ kubectl get svc -o wide ambassador
NAME         TYPE           CLUSTER-IP   EXTERNAL-IP      PORT(S)                      AGE   SELECTOR
ambassador   LoadBalancer   10.4.12.56   104.154.108.90   80:31540/TCP,443:31719/TCP   30m   app.kubernetes.io/instance=ambassador,app.kubernetes.io/name=ambassador

Bug!

when installing, see this issue and found ‘Helm3 backwards compatibility’ bug, which is why we’re seeing this on install.

ubuntudevbox:~/GCP/charts$ helm3 upgrade ambassador ambassador/ --namespace default
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
Release "ambassador" has been upgraded. Happy Helming!
NAME: ambassador
LAST DEPLOYED: Thu Nov 28 00:15:23 2019
NAMESPACE: default
STATUS: deployed
REVISION: 2
NOTES:
Congratulations! You've successfully installed Ambassador.

Troubleshooting

error when trying to install a chart after setting up tiller

00:10 $ helm2 install ambassador/ -n ambassador --namespace frontend
Error: namespaces "frontend" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "frontend"

this is a tiller rbac issue and needs to be re-installed (properly). Solution here

References

Leave a comment