As we covered in our Citrix ADC for Kubernetes blog series, we’re strengthening our portfolio for application and platform owners to develop cloud-native applications. In this blog, we’ll detail the deployment of Citrix Ingress Controller using Kubernetes Operations (Kops) and cover two ways you can deploy Citrix Ingress Controller on Google Cloud using Kops.
Citrix Ingress Controller is built around the Kubernetes ingress and automatically configures a Citrix ADC based on the ingress resource configuration. You can use it in cloud deployments and in on-prem deployments, and it offers a wide range of features, including ingress class support, rewrite and responder support, automatic cert management, and more.
You can check out our GitHub page for detailed information on all of Citrix Ingress Controller’s features.
Citrix offers a Kops add-on for deploying Citrix Ingress Controller. Kops is a set of tools for creating and maintaining Kubernetes clusters in the cloud; you can also deploy and manage cluster add-ons, which extend the functionality of Kubernetes.
During the Kubernetes cluster creation, enabling the Citrix Ingress Controller add-on for Kops will automatically spin up a Citrix Ingress Controller on Google Cloud. In this blog post, we’ll cover two ways you can deploy Citrix Ingress Controller on Google Cloud using Kops.
Deploy Citrix Ingress Controller in Google Cloud Using Kops
Prerequisites
- KOPS: Install KOPS using the steps at https://github.com/kubernetes/kops/blob/master/docs/install.md.
- KUBECTL: Install kubectl using the steps at https://kubernetes.io/docs/tasks/tools/install-kubectl/.
- Make sure you have a Google Cloud account and the gcloud SDK installed.
Create a simple Kubernetes cluster in Google Cloud using Kops
Perform the following steps:
export KOPS_STATE_STORE=gs://citrixingressdemo/
PROJECT=`gcloud config get-value project`
export KOPS_FEATURE_FLAGS=AlphaAllowGCE # to unlock the GCE features
kops create cluster citrixk8s.k8s.local --zones us-central1-a --state ${KOPS_STATE_STORE}/ --project=${PROJECT}
These steps create the Kops cluster objects and other necessary configurations but not the actual Kubernetes cluster.
If you don’t have a Google storage bucket to use as a Kops state store, you can create one using the following command:
gsutil mb gs://citrixingressdemo/
Enable Citrix ingress controller Kops addon
Edit the cluster configuration using the following command:
kops edit cluster citrixk8s.k8s.local
Now add the Citrix Ingress Controller add-on specification for Kops to the cluster manifest in the spec.addons section:
addons:
- manifest: ingress-citrix
After you have added the addon specification to the cluster manifest, save and exit.
Start the Kubernetes cluster creation
Start the Kubernetes cluster creation by using the following command.
kops update cluster citrixk8s.k8s.local --yes
Kops will start the Kubernetes cluster creation.
Validate the Citrix Ingress Controller
After the new Kubernetes cluster is created and ready, you will see the Citrix Ingress Controller deployed inside the cluster.
Verify that the Kubernetes nodes are in Ready status using the following command:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-us-central1-a-62z0 Ready master 78s v1.12.8
nodes-g60x Ready node 26s v1.12.8
nodes-j0s3 Ready node 25s v1.12.8
After the nodes are Ready, use the following command to see the Citrix Ingress Controller deployment. A Google Cloud LoadBalancer service is deployed for the Citrix Ingress Controller.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
cpx-ingress-79ddb94bcb-6f644 1/2 Running 0 2m22s
$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
cpx-service LoadBalancer 100.66.154.33 X.X.X.X 80:31355/TCP,443:31291/TCP 4m46s
kubernetes ClusterIP 100.64.0.1 443/TCP 5m15s
Citrix Ingress Controller in Action
Now let’s deploy a sample application and verify that the Citrix Ingress Controller is working. Perform the following steps:
$ kubectl run apache --image=httpd --replicas=2 --port 80
$ kubectl expose deployment apache --port=80 --target-port=80
Create an Ingress for the sample application:
cat <
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: citrix-ingress
spec:
rules:
- host: citrix-ingress.com
http:
paths:
- path: /
backend:
serviceName: apache
servicePort: 80
EOF
Let’s validate by sending some traffic to the Citrix Ingress Controller using the following command:
$ curl --resolve citrix-ingress.com:80: http://citrix-ingress.com/
It works!
Everything should be working fine! The response “It works!” is from the sample application, and Citrix Ingress Controller has load balanced the client traffic correctly.
KUBECTL Way of Deploying Citrix Ingress Controller
In case you didn’t enable the Citrix Ingress Controller add-on while creating the Kops Kubernetes cluster, you can use a kubectl command to deploy it as shown below:
kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-citrix/v1.1.1.yaml
Learn More
Click here for more information on Citrix Ingress Controller, and here to learn about Citrix Ingress Controller as an add-on to Kops.