You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
This topic explains the steps that you must complete before you install Edge Microgateway as a service in a Kubernetes cluster.
This topic discusses:
- The minimum requirements for your Kubernetes cluster.
- How to install and configure Edge Microgateway.
- How to install the base configuration of Edge Microgateway into your Kubernetes cluster.
Requirements for your Kubernetes cluster
Your Kubernetes cluster requires:
- Kubernetes version 1.9 or higher.
- Kubernetes CLI kubectl v1.9 or greater.
- A cluster with at least 3 nodes having 2 vCPUs each.
Example: Creating a Kubernetes cluster on Google Kubernetes Engine (GKE)
Set up your Kubernetes administration machine
The Kubernetes administration machine is your local machine that you use to run commands against your Kubernetes cluster. This machine is typically a desktop machine that has access to your Kubernetes VMs.
You must install the following utilities on the Kubernetes administration machine:
Install the kubectl command line interface 1.9 or later.
(GKE only) Install gcloud if you are running Kubernetes on GKE.
Create a Kubernetes cluster on GKE
- Log in to the Google Kubernetes Engine (GKE) dashboard on Google Cloud Platform (GCP).
- Click Create Cluster.
- Select Standard Cluster.
- Enter a name for your cluster.
- Select a Zone.
- Select
Cluster Version 1.9.7-gke-*
. For example1.9.7-gke.6
. - Select a size of 3 nodes.
- Select 2 vCPUs with 7.5 GB memory.
Click Create.
The following screenshot shows the GKE dashboard filled in as described in the previous steps:
Get your cluster credentials
Set your GKE project name:
gcloud config set project projectName
Set your GKE project zone:
gcloud config set compute/zone zoneName
Get your gcloud container credentials:
gcloud container clusters get-credentials cluster-name --zone zone --project project-name
where:
cluster-name
is the name of the Kubernetes cluster you created.zone
is the zone where your cluster is located.project-name
is your GCP project name.
For example:
gcloud container clusters get-credentials edgemicrogateway-cluster --zone us-central1-a --project edgemicro-project
Execute the following command exactly as shown. The command grants cluster admin permissions to the current user. Admin permissions are required to create the necessary RBAC rules for the Edge Microgateway service:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account)
Install Edge Microgateway for Kubernetes
Download Edge Microgateway for Kubernetes. If you are on a MacOS or Linux machine, you can download the latest version or a particular version by specifying the version name.
To get the latest version:
curl -L https://raw.githubusercontent.com/apigee-internal/microgateway/master/kubernetes/release/downloadEdgeMicrok8s.sh | sh -
To get a particular version by version number. Note the version number must be prefixed with the letter "v". For example: v3.0.2
curl -L https://raw.githubusercontent.com/apigee-internal/microgateway/master/kubernetes/release/downloadEdgeMicrok8s.sh | sh -s version
For example:
curl -L https://raw.githubusercontent.com/apigee-internal/microgateway/master/kubernetes/release/downloadEdgeMicrok8s.sh | sh -s v3.0.2
Change directory to the install directory
microgateway_Version_OS_ARCH
. For example:cd microgateway_2.5.26_Darwin_x86_64
Examine the install directory:
/install/kubernetes
- Configuration.yaml
files for deployment to Kubernetes./samples
- Sample applications for testing your installation./bin
- Theedgemicroctl
executable. Theedgemicroctl
command injects Edge Microgateway into Kubernetes
Add the
edgemicroctl
client to yourPATH
. For example, run the following command on a MacOS or Linux system:export PATH=$PWD/bin:$PATH
Apply the base Edge Microgateway setup to the Kubernetes cluster. The following command creates an
edgemicro-system
namespace and cluster roles.kubectl apply -f install/kubernetes/edgemicro.yaml
Install the NGINX Ingress controller into the cluster. Be sure that no other Nginix controller is running. You can check by running
kubectl get pods
.kubectl apply -f install/kubernetes/edgemicro-nginx-gke.yaml
Verify the installation
To check if the Ingress controller has started, run the following command:
kubectl get pods --all-namespaces -l app=edgemicro-ingress --watch
As the following sample output shows, it takes a minute or two for the processes to start. It is normal to see several Error and Restart cycles before the
STATUS
changes toRunning
.NAMESPACE NAME READY STATUS RESTARTS AGE edgemicro-system edgemicro-ingress-controller-64444469bf-wjhrn 0/1 CrashLoopBackOff 1 33s edgemicro-system edgemicro-ingress-controller-64444469bf-wjhrn 0/1 Error 2 33s edgemicro-system edgemicro-ingress-controller-64444469bf-wjhrn 0/1 CrashLoopBackOff 2 40s edgemicro-system edgemicro-ingress-controller-64444469bf-wjhrn 0/1 Running 3 1m edgemicro-system edgemicro-ingress-controller-64444469bf-wjhrn 1/1 Running 3 1m
Once the Ingress is running, you can cancel the above command by typing
Ctrl+C
.Run this command to check that the Kubernetes services are deployed. You should see output similar to the example output shown below:
kubectl get svc -n edgemicro-system
Example output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE default-http-backend ClusterIP 10.19.255.106 <none> 80/TCP 2h edgemicro-ingress LoadBalancer 10.19.247.156 35.224.24.13 80:30176/TCP,443:32325/TCP 2h
Verify all pods are running:
kubectl get pods -n edgemicro-system
Example output:
NAME READY STATUS RESTARTS AGE default-http-backend-55c6c69b88-2lvtw 1/1 Running 0 4m edgemicro-ingress-controller-64444469bf-wjhrn 1/1 Running 3 4m
Install Edge Microgateway
You must have Edge Microgateway 2.5.26 or a later version installed. You can check by entering:
edgemicro --version
If you have not have Edge Microgateway 2.5.26 or later installed, execute the install script:
npm install edgemicro -g
If you just installed Edge Microgateway for the first time or upgraded it, run this command:
edgemicro init
If you need additional help, see Installing Edge Microgateway.
Next step
Now you are ready to deploy Edge Microgateway to Kubernetes.