Skip to main content
Version: 1.9

Google Kubernetes Engine (GKE)

This guide will show you how to install Okteto onto Google Kubernetes Engine (GKE). We'll be focusing exclusively on GKE in order to keep it as simple as possible.

Requirements

In order to fully install Okteto, you will need the following:

  • A subdomain to which you can add a wildcard DNS record
  • A Kubernetes cluster
  • A working installation of kubectl
  • A working installation of Helm v3 (v3.8 or higher)
  • An Okteto License (optional)

Subdomain

You'll need sufficient access to a subdomain to add a wildcard DNS record, such as dev.example.com. By default, all endpoints created by Okteto for your development environments will be exposed on the wildcard subdomain you choose.

This guide assumes your domain is registered in Google Cloud DNS service. You can use any DNS service you prefer, but this guide focuses specifically on Google Cloud DNS.

Deploy a Kubernetes cluster

We recommend that you follow Google's GKE cluster creation guide. Okteto supports Kubernetes versions 1.24 through 1.26.

We recommend the following specs:

  • v1.26
  • A pool with at least 3 n1-standard-4 nodes
  • 250 GB per disk

You'll be using the cluster's API server endpoint when configuring Okteto. Run the following command to obtain your cluster's API server endpoint:

kubectl config view --minify | grep server

Our installation guides assume Okteto will be running in a dedicated cluster. We recommend contacting our team if you plan on installing Okteto in a cluster with other workloads.

Installing kubectl

Follow the official documentation for installing kubectl. Once installed, configure kubectl to talk to your new cluster.

Installing Helm v3 (v3.8 or higher)

Follow the official documentation for installing the latest release of Helm v3 (v3.8 or higher).

Adding the Okteto Helm repository

You'll need to add the Okteto repository in order to be able to install Okteto:

helm repo add okteto https://charts.okteto.com
helm repo update

Getting your Okteto License

Okteto is free for up to 3 users without a license.

You can also sign up for our free trial, which supports up to 30 users for a month.

Installing Okteto

Configuring your Okteto instance

Download a copy of the Okteto GKE configuration file, open it, and set the following values:

  • Your license (optional)
  • A subdomain
  • Your cluster's API server endpoint

For example:

license: 1234567890ABCD==
subdomain: dev.example.com

cluster:
endpoint: https://35.205.100.149

buildkit:
ingress:
enabled: false
service:
type: LoadBalancer
sessionAffinity: ClientIP
persistence:
enabled: true

Installing your Okteto instance

Install the latest version of Okteto by running:

helm install okteto okteto/okteto -f config.yaml --namespace=okteto --create-namespace

You can also install a specific version by including the --version argument.

After a few seconds, all the resources will be created. The output will look something like this:

Release "okteto" has been installed. Happy Helming!
NAME: okteto
LAST DEPLOYED: Thu Mar 26 18:07:55 2020
NAMESPACE: okteto
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Create the following DNS record, pointing it to the NGINX controller service External-IP:
- "*.dev.example.com"

You can retrieve the External IP by running:
kubectl get service -l=app.kubernetes.io/name=ingress-nginx,app.kubernetes.io/component=controller --namespace=okteto

2. Create the following DNS record, pointing it to the Buildkit service External-IP:
- "buildkit.dev.example.com"

You can retrieve the External IP by running:
kubectl get service -l=app.kubernetes.io/instance=okteto,app.kubernetes.io/component=buildkit --namespace=okteto

3. Once you create both DNS entries you can access your Okteto instance at this URL:
https://okteto.dev.example.com

Retrieve the Ingress Controller IP address

You can use kubectl to fetch the address that has been dynamically allocated by GKE to the NGINX Ingress we've just installed and configured as a part of Okteto:

kubectl get service -l=app.kubernetes.io/name=ingress-nginx,app.kubernetes.io/component=controller --namespace=okteto

The output will look something like this:

NAME                              TYPE           CLUSTER-IP   EXTERNAL-IP     PORT(S)                                     AGE
okteto-ingress-nginx-controller LoadBalancer 10.0.7.73 34.68.230.234 80:30795/TCP,443:32481/TCP,1234:30885/TCP 5m

You'll need to take the EXTERNAL-IP address, and add it to your DNS for the domain you have chosen to use. In Google Cloud DNS, this is done by creating an A record with the name *. We also suggest you set the TTL to 1 minute.

Retrieve the Buildkit IP address

You can use kubectl to fetch the address that has been dynamically allocated by GKE to the Buildkit instance you've just installed and configured as a part of Okteto:

kubectl get service -l=app.kubernetes.io/instance=okteto,app.kubernetes.io/component=buildkit --namespace=okteto

The output will look something like this:

NAME                TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)          AGE
okteto-buildkit LoadBalancer 10.245.142.73 34.68.230.233 1234:32449/TCP 5m

You'll need to take the EXTERNAL-IP address, and add it to your DNS for the domain you have chosen to use. This is done by creating an A record with the name buildkit.

Sign in to your Okteto instance

After a successful installation, you can access your Okteto instance at https://okteto.SUBDOMAIN. Your account will be automatically created as part of the login process. The first user to successfully login into the instance will be automatically assigned the administrator role.

Important: The default installation is not recommended for production use. We highly advise following the steps outlined in the Admin Dashboard before giving your team access to your Okteto instance.

The default installation is all that's required to follow our getting started guide. Just remember to replace https://cloud.okteto.com by https://okteto.SUBDOMAIN and you will be good to go!