├── version └── VERSION ├── .gitignore ├── images ├── worker-1.png ├── worker-2.png ├── bridge_table.jpg ├── ip_route_vxlan.jpg ├── kube_cnc_router.png ├── router-pod-log.png ├── router-cmap-data.png ├── CitrixControllerArchitecture.png ├── CitrixControllerArchitecture_v2.png └── CitrixControllerArchitecture_v3.png ├── deploy ├── config_map.yaml ├── citrix-k8s-node-controller.yaml ├── troubleshoot.md └── README.md ├── README.md └── license └── LICENSE /version/VERSION: -------------------------------------------------------------------------------- 1 | 2.1.0 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.test 3 | *.tar 4 | 5 | -------------------------------------------------------------------------------- /images/worker-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/worker-1.png -------------------------------------------------------------------------------- /images/worker-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/worker-2.png -------------------------------------------------------------------------------- /images/bridge_table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/bridge_table.jpg -------------------------------------------------------------------------------- /images/ip_route_vxlan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/ip_route_vxlan.jpg -------------------------------------------------------------------------------- /images/kube_cnc_router.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/kube_cnc_router.png -------------------------------------------------------------------------------- /images/router-pod-log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/router-pod-log.png -------------------------------------------------------------------------------- /images/router-cmap-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/router-cmap-data.png -------------------------------------------------------------------------------- /images/CitrixControllerArchitecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/CitrixControllerArchitecture.png -------------------------------------------------------------------------------- /deploy/config_map.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: citrix-node-controller 5 | data: 6 | tolerations.json: | 7 | [] -------------------------------------------------------------------------------- /images/CitrixControllerArchitecture_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/CitrixControllerArchitecture_v2.png -------------------------------------------------------------------------------- /images/CitrixControllerArchitecture_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netscaler/netscaler-k8s-node-controller/HEAD/images/CitrixControllerArchitecture_v3.png -------------------------------------------------------------------------------- /deploy/citrix-k8s-node-controller.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: ClusterRole 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: citrix-node-controller 6 | rules: 7 | - apiGroups: ["*"] 8 | resources: ["configmaps", "pods"] 9 | verbs: ["get", "list", "watch", "create", "patch", "delete", "update"] 10 | - apiGroups: ["*"] 11 | resources: ["configmaps", "pods"] 12 | verbs: ["get", "list", "watch", "create", "patch", "delete", "update"] 13 | - apiGroups: [""] 14 | resources: ["nodes"] 15 | verbs: ["get", "list", "watch", "patch"] 16 | - apiGroups: ["*"] 17 | resources: ["nodes"] 18 | verbs: ["get", "list", "watch", "patch"] 19 | - apiGroups: [""] 20 | resources: ["serviceaccounts", "clusterroles", "clusterrolebindings", "namespaces"] 21 | verbs: ["get", "list", "create", "delete"] 22 | - apiGroups: ["*"] 23 | resources: ["serviceaccounts", "clusterroles", "clusterrolebindings", "namespaces"] 24 | verbs: ["get", "list", "create", "delete"] 25 | - apiGroups: ["crd.projectcalico.org"] 26 | resources: ["ipamblocks"] 27 | verbs: ["get", "list"] 28 | --- 29 | kind: ClusterRoleBinding 30 | apiVersion: rbac.authorization.k8s.io/v1 31 | metadata: 32 | name: citrix-node-controller 33 | roleRef: 34 | apiGroup: rbac.authorization.k8s.io 35 | kind: ClusterRole 36 | name: citrix-node-controller 37 | subjects: 38 | - kind: ServiceAccount 39 | name: citrix-node-controller 40 | namespace: default 41 | --- 42 | apiVersion: v1 43 | kind: ServiceAccount 44 | metadata: 45 | name: citrix-node-controller 46 | namespace: default 47 | --- 48 | kind: ClusterRole 49 | apiVersion: rbac.authorization.k8s.io/v1 50 | metadata: 51 | name: kube-cnc-router 52 | rules: 53 | - apiGroups: ["*"] 54 | resources: ["configmaps"] 55 | verbs: ["get", "list", "watch", "create", "patch", "delete", "update"] 56 | - apiGroups: [""] 57 | resources: ["configmaps"] 58 | verbs: ["get", "list", "watch", "create", "patch", "delete", "update"] 59 | - apiGroups: ["crd.projectcalico.org"] 60 | resources: ["ipamblocks"] 61 | verbs: ["get", "list"] 62 | --- 63 | kind: ClusterRoleBinding 64 | apiVersion: rbac.authorization.k8s.io/v1 65 | metadata: 66 | name: kube-cnc-router 67 | roleRef: 68 | apiGroup: rbac.authorization.k8s.io 69 | kind: ClusterRole 70 | name: kube-cnc-router 71 | subjects: 72 | - kind: ServiceAccount 73 | name: kube-cnc-router 74 | namespace: default 75 | --- 76 | apiVersion: v1 77 | kind: ServiceAccount 78 | metadata: 79 | name: kube-cnc-router 80 | namespace: default 81 | --- 82 | apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 83 | kind: Deployment 84 | metadata: 85 | name: cnc-citrix-node-controller 86 | spec: 87 | selector: 88 | matchLabels: 89 | app.kubernetes.io/name: citrix-node-controller 90 | app.kubernetes.io/instance: cnc 91 | replicas: 1 92 | template: 93 | metadata: 94 | labels: 95 | app.kubernetes.io/name: citrix-node-controller 96 | app.kubernetes.io/instance: cnc 97 | spec: 98 | serviceAccountName: citrix-node-controller 99 | containers: 100 | - name: citrix-node-controller 101 | image: "quay.io/citrix/citrix-k8s-node-controller:2.2.12" 102 | imagePullPolicy: Always 103 | env: 104 | - name: EULA 105 | value: "yes" 106 | - name: NS_IP 107 | value: "xxxxxxx" 108 | - name: NS_USER 109 | valueFrom: 110 | secretKeyRef: 111 | name: nslogin 112 | key: username 113 | - name: NS_PASSWORD 114 | valueFrom: 115 | secretKeyRef: 116 | name: nslogin 117 | key: password 118 | - name: NETWORK 119 | value: "172.18.3.0/24" 120 | - name: REMOTE_VTEPIP 121 | value: "xx.xx.xx.yy" 122 | - name: VNID 123 | value: "175" 124 | - name: VXLAN_PORT 125 | value: "8472" 126 | - name: CNI_TYPE 127 | value: 128 | - name: "CNC_ROUTER_NAME" 129 | value: kube-cnc-router 130 | - name: "CNC_CONFIGMAP" 131 | value: citrix-node-controller 132 | -------------------------------------------------------------------------------- /deploy/troubleshoot.md: -------------------------------------------------------------------------------- 1 | # CNC troubleshooting 2 | 3 | This document explains how to troubleshoot issues that you may encounter while using the Citrix Kubernetes node controller (CNC). Using this document, you can collect logs to determine the causes and apply workarounds for some of the common issues related to the configuration of the CNC 4 | 5 | To validate Citrix ADC and the basic node configurations, refer to the image on the [deployment](README.md) page. 6 | 7 | ### Router pods not starting 8 | If kube-cnc-router pods are not starting, then, this could be due to certain cluster restrictions wherein privileged pods cannot be deployed by non-admin users/privileges. 9 | 10 | As a workaround, there are 2 options: 11 | 1) Use "kube-system" namespace to deploy CNC 12 | 13 | OR 14 | 15 | 2) Assign "cluster-admin" role to CNC clusterrolebinding. 16 | 17 | Note: If option 1) is chosen, then one cannot create multipe instances of CNC in a single cluster as we only have one kube-system namespace available per cluster. 18 | 19 | ### Service status DOWN 20 | 21 | To debug the issues when the service is in down state, 22 | 23 | 1. Verify the logs of the CNC pod using the following command:: 24 | 25 | ``` 26 | kubectl logs -n 27 | ``` 28 | 29 | Check for any 'permission' errors in the logs. CNC creates kube-cnc-router pods which require NET_ADMIN privilege to perform the configurations on nodes. So, the CNC service account must have the NET_ADMIN privilege and the ability to create host mode kube-cnc-routerpods. 30 | 31 | 2. Verify the logs of the kube-cnc-router pod using the following command: 32 | 33 | ``` 34 | kubectl logs -n 35 | ``` 36 | 37 | Check for any error in the node configuration. The following is a sample typical router pod log: 38 | 39 | 40 | 41 | 3. Verify the kube-cnc-router configmap output using the following command: 42 | 43 | ``` 44 | kubectl get configmaps -n kube-cnc-router -o yaml 45 | ``` 46 | Check for empty field in the data section of the configmap. The following is a sample typical two node data section: 47 | 48 | 49 | 50 | 4. Verify the node configuration and make sure the following: 51 | - CNC interface cncvxlan should be created. 52 | - Assigned VTEP IP address should be the same as the corresponding router gateway entry in Citrix ADC. 53 | - Status of interface should be functioning. 54 | - iptable rule port should be created. 55 | - Port should be the same that of VXLAN created on Citrix ADC. 56 | 57 | 58 | 59 | 60 | ### If the service status is up and operational, but the ping from Citrix ADC is not working 61 | 62 | If you are not able to ping the service IP address from Citrix ADC even though the services are in operational state. One reason may be the presence of a PBR entry which directs the packets from Citrix ADC with SRCIP as NSIP to the default gateway. 63 | 64 | It does not impact any functionality. You can use the VTEP of Citrix ADC as source IP address using the -S option of ping command in the Citrix ADC command line interface. For example: 65 | 66 | ``` 67 | ping -S 68 | ``` 69 | Note: If it is necessary to ping with NSIP itself, then, you must remove the PBR entry or add a new PBR entry for the endpoint with high priority. 70 | 71 | ### cURL to the pod endpoint or VIP is not working 72 | 73 | Though, services are in up state, still you cannot cURL to the pod endpoint, that means, the stateful TCP session to the endpoint is failing. One reason may be the ns mode 'MBF' is set to enable. This issue depends upon deployments and might occur only on certain versions of Citrix ADC. 74 | To resolve this issue, you should disable MBF ns mode or bind a netprofilewith the netprofile disabled to the servicegroup. 75 | Note: If disabling the MBF resolves the issue, then it should be kept disabled. 76 | 77 | ## Customer support 78 | 79 | For general support, when you raise issues, provide the following details which help for faster debugging. 80 | cURL or ping from Citrix ADC to the endpoint and get the details for the following: 81 | 82 | For the node, provide the details for the following commands: 83 | 84 | 1. tcpdump capture on CNC interface on nodes 85 | ``` 86 | tcpdump -i cncvxlan -w cncvxlan.pcap 87 | ``` 88 | 2. tcpdump capture on node Mgmt interface lets say "eth0" 89 | ``` 90 | tcpdump -i eth0 -w mgmt.pcap 91 | ``` 92 | 3. tcpdump capture on CNI interface lets say "vxlan.calico" 93 | ``` 94 | tcpdump -i vxlan.calico -w cni.pcap 95 | ``` 96 | 4. output of "ifconfig -a" on the node. 97 | 5. output of "iptables -L" on the node. 98 | 99 | 100 | For ADC, provide the details for the following show commands: 101 | 1. show ip 102 | 2. show vxlan 103 | 3. show route 104 | 4. show arp 105 | 5. show bridgetable 106 | 6. show ns pbrs 107 | 7. show ns bridgetable 108 | 8. show ns mode 109 | 9. Try and capture nstrace while ping/curl: 110 | ``` 111 | start nstrace -size 0 -mode rx new_rx txb tx -capsslkeys enABLED 112 | ``` 113 | ``` 114 | stop nstrace 115 | ``` 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.com/janraj/citrix-k8s-node-controller.svg?token=GfEuWKxn7TJJesWboygR&branch=master)](https://travis-ci.com/janraj/citrix-k8s-node-controller) 2 | [![codecov](https://codecov.io/gh/janraj/citrix-k8s-node-controller/branch/master/graph/badge.svg?token=9c5R8ukQGY)](https://codecov.io/gh/janraj/citrix-k8s-node-controller) 3 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./license/LICENSE) 4 | [![Go Report Card](https://goreportcard.com/badge/github.com/janraj/citrix-k8s-node-controller)](https://goreportcard.com/report/github.com/janraj/citrix-k8s-node-controller) 5 | [![Docker Repository on Quay](https://quay.io/repository/citrix/citrix-k8s-node-controller/status "Docker Repository on Quay")](https://quay.io/repository/citrix/citrix-k8s-node-controller) 6 | [![GitHub stars](https://img.shields.io/github/stars/janraj/citrix-k8s-node-controller.svg)](https://github.com/janraj/citrix-k8s-node-controller/stargazers) 7 | [![HitCount](http://hits.dwyl.com/janraj/citrix-k8s-node-controller.svg)](http://hits.dwyl.com/janraj/citrix-k8s-node-controller) 8 | 9 | --- 10 | 11 | # Citrix k8s node controller 12 | 13 | Citrix k8s node controller is a micro service provided by Citrix that creates network between the Kubernetes cluster and ingress device. 14 | 15 | ## Contents 16 | 17 | + [Overview](#overview) 18 | + [Architecture](#architecture) 19 | + [How it works](#how-it-works) 20 | + [Get started](#get-started) 21 | + [Using Citrix k8s node controller as a process](#using-citrix-k8s-node-controller-as-a-process) 22 | + [Using Citrix k8s node controller as a microservice](#using-citrix-k8s-node-controller-as-a-microservice) 23 | + [Questions](#questions) 24 | + [Issues](#issues) 25 | + [Code of conduct](#code-of-conduct) 26 | + [License](#license) 27 | 28 | ## Overview 29 | 30 | In Kubernetes environments, when you expose the services for external access through the Ingress device, to route the traffic into the cluster, you need to appropriately configure the network between the Kubernetes nodes and the Ingress device. Configuring the network is challenging as the pods use private IP addresses based on the CNI framework. Without proper network configuration, the Ingress device cannot access these private IP addresses. Also, manually configuring the network to ensure such reachability is cumbersome in Kubernetes environments. 31 | 32 | Citrix provides a microservice called as **Citrix k8s node controller** that you can use to create the network between the cluster and the Ingress device. 33 | 34 | ## Architecture 35 | 36 | The following diagram provides the high-level architecture of the Citrix k8s node controller: 37 | 38 | ![](./images/CitrixControllerArchitecture.png) 39 | 40 | The are the main components of the Citrix k8s node controller: 41 |
42 | **Ingress Interface** 43 | The **Ingress interface** component is responsible for the interaction with Citrix ADC through NITRO REST API. It maintains the NITRO sessions and invokes it when required. 44 |
45 |
46 | **K8s Interface** 47 | This **K8s Interface** component interacts with the Kube API server through K8s Go client. It ensures the availability of the client and maintains a healthy client session. 48 |
49 |
50 | **Input Feeder** 51 | The **Input Feeder** component provides inputs to the config decider. Some of the inputs are auto detected and the rest are taken from the Citrix k8s node controller deployment YAML file. 52 |
53 |
54 | **Core** 55 | The **Core** component interacts with the node watcher and updates the corresponding config engine. It is responsible for starting the best config engine for the corresponding cluster. 56 |
57 |
58 | **Config Maps** 59 | The **Config Maps** component controls the Citrix k8s node controller. It allows you to define Citrix k8s node controller to automatically create, apply, and delete routing configuration on Citrix ADC. 60 |
61 | 62 | ## How it works 63 | 64 | Citrix k8s node controller monitors the node events and establishes a route between the node to Citrix ADC using VXLAN. Citrix k8s node controller adds route on the Citrix ADC when a new node joins to the cluster. Similarly when a node leaves the cluster, Citrix k8s node controller removes the associated route from the Citrix ADC. Citrix k8s node controller uses VXLAN overlay between the Kubernetes cluster and Citrix ADC for service routing. 65 | 66 | ## Get started 67 | 68 | You can run Citrix k8s node controller as a **microservice** inside the Kubernetes cluser. 69 | Refer the [deployment](deploy/README.md) page for running Citrix k8s node controller as a microservice inside the Kubernetes cluster. 70 | 71 | ## Supported CNIs 72 | 73 | - flannel 74 | - calico (Vxlan/IPIP modes) 75 | - cilium 76 | - weave 77 | - canal 78 | 79 | ## TroubleShoot 80 | 81 | After deploying CNC, in case of any issue, refer the [troubleshooting](deploy/troubleshoot.md) page 82 | 83 | ## Questions 84 | 85 | For questions and support the following channels are available: 86 | 87 | - [Citrix Discussion Forum](https://discussions.citrix.com/forum/1657-netscaler-cpx/). 88 | 89 | - [Citrix ADC Slack Channel](https://citrixadccloudnative.slack.com/). 90 | 91 | ## Issues 92 | 93 | Describe the Issue in Details, Collects the logs and Use the [discussion](https://discussions.citrix.com/forum/1657-netscaler-cpx/) forum to raise the issue. 94 | 95 | ## Code of conduct 96 | 97 | This project adheres to the [Kubernetes Community Code of Conduct](https://github.com/kubernetes/community/blob/master/code-of-conduct.md). By participating in this project you agree to abide by its terms. 98 | 99 | ## License 100 | 101 | [Apache License 2.0](./license/LICENSE) 102 | -------------------------------------------------------------------------------- /deploy/README.md: -------------------------------------------------------------------------------- 1 | # Deploy the Citrix k8s node controller 2 | 3 | This topic provides information on how to deploy Citrix node controller on Kubernetes and establish the route between Citrix ADC and Kubernetes Nodes. 4 | 5 | Note: CNC creates "kube-cnc-router" in HOST mode on all the schedulable-nodes. These router pods create virtual network interface and program iptables accordingly on respective nodes where they are scheduled. These pods need to run with NET_ADMIN capability to achieve the same. Hence CNC serviceaccount must have NET_ADMIN privilege and ability to create HOST mode pods. 6 | 7 | Perform the following: 8 | 9 | 1. Download the `citrix-k8s-node-controller.yaml` deployment file using the following command: 10 | 11 | ``` 12 | wget https://raw.githubusercontent.com/citrix/citrix-k8s-node-controller/master/deploy/citrix-k8s-node-controller.yaml 13 | ``` 14 | 15 | The deployment file contains definitions for the following: 16 | 17 | - Cluster Role (`ClusterRole`) 18 | 19 | - Cluster Role Bindings (`ClusterRoleBinding`) 20 | 21 | - Service Account (`ServiceAccount`) 22 | 23 | - Citrix Node Controller service (`citrix-node-controller`) 24 | 25 | You don't have to modify the definitions for `ClusterRole`, `ClusterRoleBinding`, and `ServiceAccount` definitions. The definitions are used by Citrix node controller to monitor Kubernetes events. But, in the `citrix-node-controller` definition you have to provide the values for the environment variables that is required for Citrix k8s node controller to configure the Citrix ADC. 26 | 27 | You must provide values for the following environment variables in the Citrix k8s node controller service definition: 28 | 29 | | Environment Variable | Mandatory or Optional | Description | 30 | | -------------------- | --------------------- | ----------- | 31 | | NS_IP | Mandatory | Citrix kubernetes node controller uses this IP address to configure the Citrix ADC. The NS_IP can be anyone of the following:

- **NSIP** for standalone Citrix ADC
- **SNIP** for high availability deployments (Ensure that management access is enabled)
- **CLIP** for Cluster deployments | 32 | | NS_USER and NS_PASSWORD | Mandatory | The user name and password of Citrix ADC. Citrix k8s node controller uses these credentials to authenticate with Citrix ADC. You can either provide the user name and password or Kubernetes secrets. If you want to use a non-default Citrix ADC user name and password, you can [create a system user account in Citrix ADC](https://developer-docs.citrix.com/projects/citrix-k8s-ingress-controller/en/latest/deploy/deploy-cic-yaml/#create-system-user-account-for-citrix-ingress-controller-in-citrix-adc).

The deployment file uses Kubernetes secrets, create a secret for the user name and password using the following command:

`kubectl create secret generic nslogin --from-literal=username='nsroot' --from-literal=password='nsroot'`

**Note**: If you want to use a different secret name other than `nslogin`, ensure that you update the `name` field in the `citrix-node-controller` definition. | 33 | | NETWORK | Mandatory | The IP address range (for example, `192.128.1.0/24`) that Citrix node controller uses to configure the VTEP overlay end points on the Kubernetes nodes.

**Note:** Ensure that the subnet that you provide is different from your Kubernetes cluster.| 34 | | VNID | Mandatory | A unique VXLAN VNID to create a VXLAN overlay between Kubernetes cluster and the ingress devices.

**Note:** Ensure that the VXLAN VNID that you use does not conflict with the Kubernetes cluster or Citrix ADC VXLAN VNID. You can use the `show vxlan` command on your Citrix ADC to view the VXLAN VNID. For example:

`show vxlan`
`1) ID: 500 Port: 9090`
`Done`

In this case, ensure that you do not use `500` as the VXLAN VNID.| 35 | | VXLAN_PORT | Mandatory | The VXLAN port that you want to use for the overlay.

**Note:** Ensure that the VXLAN PORT that you use does not conflict with the Kubernetes cluster or Citrix ADC VXLAN PORT. You can use the `show vxlan` command on your Citrix ADC to view the VXLAN PORT. For example:

`show vxlan`
`1) ID: 500 Port: 9090`
`Done`

In this case, ensure that you do not use `9090` as the VXLAN PORT.| 36 | | REMOTE_VTEPIP | Mandatory | The Ingress Citrix ADC SNIP. This IP address is used to establish an overlay network between the Kubernetes clusters.| 37 | | CNI_TYPE | Mandatory | The CNI used in kubernetes cluster. Valid values: flannel,calico,canal,weave,cilium| 38 | | DSR_IP_RANGE | Optional | This IP address range is used for DSR Iptable configuration on nodes. Both IP and subnet must be specified in format : "xx.xx.xx.xx/xx" | 39 | | CLUSTER_NAME | Optional | Unique identifier for the kubernetes cluster on which CNC is deployed. If Provided CNC will configure PolicyBasedRoutes instead of static Routes. For details, see [CNC-PBR-SUPPORT](https://github.com/citrix/citrix-k8s-ingress-controller/tree/master/docs/how-to/pbr.md#configure-pbr-using-the-citrix-node-controller) | 40 | | CNC_CONFIGMAP | Optional | Specifies the ConfigMapName that Citrix-Node-Controller will watch for. The delete event of this ConfigMap will trigger deletion of `kube-cnc-router` helper pods and related config from the ADC. Defaults to `citrix-node-controller` if not provided. For more details, see [deleting-configurations](#delete-the-citrix-k8s-node-controller)| 41 | | CNC_ROUTER_IMAGE | Optional | Specifies the internal repository image to be used for `kube-cnc-router` helper pods when Internet access is disabled on cluster nodes. For more details, see [running-cnc-without-internet-access](#running-citrix-node-controller-without-internet-access) | 42 | | CNC_ROUTER_NAME | Optional | Specifies the RBAC, ServiceAccount, ConfigMap Name, and Pod Prefix used for `kube-cnc-router` helper pods. Defaults to `kube-cnc-router` if not provided. For more details, see [running-multiple-cnc-in-same-cluster](#running-multiple-citrix-node-controller-in-the-same-cluster) | 43 | 44 | 1. After you have updated the Citrix k8s node controller deployment YAML file, deploy it using the following command: 45 | 46 | kubectl create -f citrix-k8s-node-controller.yaml 47 | 48 | 1. Create the configmap using the following command: 49 | 50 | kubectl apply -f https://raw.githubusercontent.com/citrix/citrix-k8s-node-controller/git_cnc_v2/deploy/config_map.yaml 51 | 52 | 53 | # Verify the deployment 54 | 55 | After you have deployed the Citrix node controller, you can verify if Citrix node controller has configured a route on the Citrix ADC. 56 | 57 | To verify, log on to the Citrix ADC and use the following commands to verify the VXLAN VNID, VXLAN PORT, SNIP, route, and Bridgetable configured by Citrix node controller on the Citrix ADC: 58 | 59 | ![Verification](../images/ip_route_vxlan.jpg) 60 | 61 | ![Verification](../images/bridge_table.jpg) 62 | 63 | The highlights in the screenshot show the VXLAN VNID, VXLAN PORT, SNIP, route, and bridgetable configured by Citrix node controller on the Citrix ADC. 64 | 65 | ## Verify cluster deployments 66 | 67 | Apart from "citrix-node-controller" deployment, some other resources are also created. 68 | 69 | - In the namespace where CNC was deployed: 70 | - For each worker node, a "kube-cnc-router" pod. 71 | - A configmap "kube-cnc-router". 72 | 73 | 74 | 75 | On each of the worker nodes, a interface "cncvxlan" and iptables rule will get created. 76 | 77 | 78 | 79 | 80 | 81 | # Delete the Citrix K8s node controller 82 | 83 | 1. Delete the [config map](config_map.yaml) using the following command: 84 | 85 | When we delete the configmap, Citrix node controller cleans up the configuration created on Citrix ADC, the "kube-cnc-router" configmap and the "kube-cnc-router" pods created by citrix node controller 86 | 87 | kubectl delete -f https://raw.githubusercontent.com/citrix/citrix-k8s-node-controller/git_cnc_v2/deploy/config_map.yaml 88 | 89 | 90 | 1. Delete the Citrix node controller using the following command: 91 | 92 | kubectl delete -f citrix-k8s-node-controller.yaml 93 | 94 | ## Running Citrix Node Controller without Internet access 95 | 96 | Citrix node controller internally creates helper pods (`kube-cnc-router` pods) on each Kubernetes cluster node. The image used by default is `quay.io/citrix/cnc-router:1.1.0` which requires Internet access. If the Kubernetes nodes do not have internet access, creation of `kube-cnc-router` pods fails. 97 | 98 | However, Citrix provides a way to access the image from your internal repository so that you can run the Citrix node controller without internet access. Using the `CNC_ROUTER_IMAGE` environment variable, you can point to the internal repository image of `quay.io/citrix/cnc-router:1.1.0`. 99 | 100 | ### Configuring Citrix node controller to use an image from the internal repository 101 | 102 | When you deploy Citrix node controller specify the ` CNC_ROUTER_IMAGE` environment variable and set the value of the variable as your internal repository path for the image `quay.io/citrix/cnc-router:1.1.0`. 103 | 104 | When you specify this environment variable, Citrix node controller uses the internal repository image provided via the `CNC_ROUTER_IMAGE` environment variable to create the `kube-cnc-router` helper pods. If the environment variable is not provided, it uses the default image ` quay.io/citrix/cnc-router:1.1.0` which requires internet access. 105 | 106 | Following example shows how to specify the `CNC_ROUTER_IMAGE` environment variable while deploying Citrix node controller. 107 | 108 | - While deploying Citrix node controller using the YAML file, set the value of the environment variable in the YAML file as follows: 109 | 110 | - name: CNC_ROUTER_IMAGE 111 | value: "docker.xyz.com/adc/citrix/cnc-router:1.1.0" 112 | 113 | - While deploying Citrix node controller using Helm charts, provide the following in values.yaml: 114 | 115 | cncRouterImage: "docker.xyz.com/adc/citrix/cnc-router:1.1.0" 116 | 117 | ### Running Multiple Citrix Node Controller in the same cluster 118 | 119 | When you deploy citrix-k8s-node-controller.yaml, the RBAC and ServiceAccount for `kube-cnc-router` helper pods is created with default value of `kube-cnc-router`. 120 | If you want to deploy multiple Citrix-Node-Controller in the same cluster, use a different name for these entities in each YAML file and provide this name as environment variable to CNC using `CNC_ROUTER_NAME`. 121 | 122 | Following example shows how to specify the `CNC_ROUTER_NAME` environment variable while deploying Citrix node controller via YAML file. 123 | 124 | - First, replace the name of ClusterRole/ClusterRoleBinding/ServiceAccount that gets created for `kube-cnc-router` helper pods with a unique name like "someother-rbac-for-kube-cnc-router" 125 | 126 | - Set the value of the environment variable in the YAML file as follows: 127 | 128 | - name: CNC_ROUTER_NAME 129 | value: "someother-rbac-for-kube-cnc-router" 130 | -------------------------------------------------------------------------------- /license/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------