|
| 1 | +# Sample configuration for deploying Citrix API gateway with GitOps |
| 2 | + |
| 3 | +This topic provides a sample configuration for deploying Citrix API gateway with GitOps. |
| 4 | +GitOps is supported with the following CRDs for APIs and security information specified in the Swagger files on Git. |
| 5 | + |
| 6 | + - rewritepolicy |
| 7 | + |
| 8 | + - ratelimit |
| 9 | + |
| 10 | + - authpolicy |
| 11 | + |
| 12 | + - waf |
| 13 | + |
| 14 | + - bot |
| 15 | + |
| 16 | +1. Create a Kubernetes secret with the login information for your Citrix ADC. |
| 17 | + |
| 18 | + kubectl create secret generic nslogin --from-literal=username=<username> --from-literal=password=<password> |
| 19 | + |
| 20 | + >**Note:** |
| 21 | + >Replace `username` and `password` with the login credentials of your Citrix ADC VPX. |
| 22 | +
|
| 23 | +1. Deploy Citrix ingress controller and apply CRD definition files through the following Helm commands: |
| 24 | + |
| 25 | + helm repo add citrix https://citrix.github.io/citrix-helm-charts/ |
| 26 | + helm install cic citrix/citrix-ingress-controller --set nsIP=<NSIP>,license.accept=yes,adcCredentialSecret=nslogin,nodeWatch=true,crds.install=true |
| 27 | + |
| 28 | + >**Note:** |
| 29 | + >Replace `NSIP` with Citrix ADC VPX IP address. |
| 30 | +
|
| 31 | + To install a specific version of the Helm chart (for example: 1.18.15), use the following command: |
| 32 | + |
| 33 | + helm install cic citrix/citrix-ingress-controller --set nsIP=<NSIP>,license.accept=yes,adcCredentialSecret=nslogin,crds.install=true --version 1.18.5 |
| 34 | + |
| 35 | +1. Copy the Swagger files provided in the [SwaggerFiles](./SwaggerFiles) folder to the Git repository. |
| 36 | + |
| 37 | +1. Launch a sample application as a service. |
| 38 | + |
| 39 | + kubectl apply -f echoserver.yaml |
| 40 | + |
| 41 | + |
| 42 | + >**Note**: In this example, [echoserver](./echoserver.yaml) is used as the sample application. This command creates the `echoserver` application as a service. |
| 43 | +
|
| 44 | +1. Apply the `rewritepolicy` CRD template file `rewrite-crd-prefixurl-rewrite.yaml` in the [TemplateCRDFiles](./TemplateCRDFiles) folder. |
| 45 | + |
| 46 | + kubectl apply -f TemplateCRDFiles/rewrite-crd-prefixurl-rewrite.yaml |
| 47 | + |
| 48 | +1. Create Kubernetes secret for the Git credentials. |
| 49 | + |
| 50 | + kubectl apply -f secret.yaml |
| 51 | + >**Note:** |
| 52 | + >Replace the `username` and `password` with appropriate base64 encoded credentials in the s`ecret.yaml` file. |
| 53 | +
|
| 54 | +1. Create the API Gateway CRD instance. |
| 55 | + |
| 56 | + kubectl apply -f api-gateway-crd-instance.yaml |
| 57 | + |
| 58 | + Update the API gateway CRD instance file (api-gateway-crd-instance.yaml) with the following information: |
| 59 | + |
| 60 | + - `repository`: Provide the GIT Repository information |
| 61 | + - `branch`: The branch on the Git repository that needs to be referred. |
| 62 | + - `files`: The path of Swagger files to be monitored on Git. |
| 63 | + - `ipaddress`: Provide the Citrix ADC content switching virtual server VIP IP address (The listener IP address on Citrix ADC). |
| 64 | + - `port`: Provide the port information for the listener (For HTTP, port 80 and for HTTPS port 443). |
| 65 | + - `protocol`: HTTP or HTTPS (If the protocol is HTTPS, then there is a need of certificate information to be provided as a secret). |
| 66 | + |
| 67 | +1. Create a certificate for the Citrix ADC listener if the protocol is HTTPS. |
| 68 | + |
| 69 | + kubectl create secret tls cert1 --key="cert.key" --cert="cert.crt" |
| 70 | + |
| 71 | + >**Note:** |
| 72 | + Replace `cert.key` and `cert.crt` with the certificates to be used. If the protocol is HTTP, there is no need to create the secret. |
| 73 | + |
| 74 | +1. Based on the protocol selected in the API Gateway CRD, try accessing the application through `http://ipaddress/v2/play/play_api` or `https://ipaddress/v2/play/play_api` URLs . |
| 75 | + |
| 76 | + >**Note:** |
| 77 | + Replace `ipaddress` in the URL with the IP address of the Citrix ADC content switching virtual server VIP (the listener IP address on the Citrix ADC). Replace the `play_api` with the API that needs to be accessed (For example: `tennis)`. |
| 78 | + |
| 79 | +1. Try to modify the Swagger file APIs on Git or the template rewritepolicy CRD to evaluate the GitOps functionality. |
| 80 | + |
| 81 | +Similar to the way `rewritepolicy` is used for evaluation, you can validate `Ratelimit`, `Auth`, `WAF`, and `BOT` CRD functionalities by applying the corresponding template CRD shared in the `TemplateCRDFiles` directory. |
0 commit comments