Skip to content

Conversation

@supershal
Copy link
Contributor

What problem does this PR solve?:

Which issue(s) this PR fixes:
Fixes #

How Has This Been Tested?:

  • unit test for cilium template rendering

Tested manually for now.

  • sample EKS cluster manifest
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  annotations:
    preflight.cluster.caren.nutanix.com/skip: all
  labels:
    cluster.x-k8s.io/provider: eks
  name: shalin-eks
spec:
  topology:
    class: eks-quick-start
    controlPlane:
      metadata:
        annotations:
          controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
    variables:
    - name: clusterConfig
      value:
        addons:
          clusterAutoscaler: {}
          cni:
            provider: Cilium
          csi:
            defaultStorage:
              provider: aws-ebs
              storageClassConfig: default
            providers:
              aws-ebs:
                storageClassConfigs:
                  default: {}
            snapshotController: {}
          nfd: {}
        eks:
          region: us-west-2
    version: v1.32.9
    workers:
      machineDeployments:
      - class: default-worker
        metadata:
          annotations:
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "2"
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "2"
        name: md-0
        variables:
          overrides:
          - name: workerConfig
            value:
              eks:
                instanceType: m5.2xlarge
  • Cilium HCP
apiVersion: addons.cluster.x-k8s.io/v1alpha1
kind: HelmChartProxy
...<redacted>
...
  valuesTemplate: |-
    cni:
      chainingMode: portmap
      exclusive: false
    hubble:
      enabled: true
      tls:
        auto:
          enabled: true               # enable automatic TLS certificate generation
          method: cronJob             # auto generate certificates using cronJob method
          certValidityDuration: 60    # certificates validity duration in days (default 2 months)
          schedule: "0 0 1 * *"       # schedule on the 1st day regeneration of each month
      relay:
        enabled: true
        tls:
          server:
            enabled: true
            mtls: true
        image:
          useDigest: false
        priorityClassName: system-cluster-critical
    ipam:
      mode: eni
    image:
      useDigest: false
    operator:
      image:
        useDigest: false
    certgen:
      image:
        useDigest: false
    socketLB:
      hostNamespaceOnly: true
    envoy:
      image:
        useDigest: false
    kubeProxyReplacement: true
    k8sServiceHost: "A535486E46D73CBF3C959CAE8F6831A4.gr7.us-west-2.eks.amazonaws.com"
    k8sServicePort: "443"
    enableIPv4Masquerade: false
    eni:
      enabled: true
      awsReleaseExcessIPs: true
    routingMode: native
    endpointRoutes:
      enabled: true
  version: 1.17.4
......<redacted>
...
  matchingClusters:
  - apiVersion: cluster.x-k8s.io/v1beta1
    kind: Cluster
    name: shalin-eks
    namespace: default
  observedGeneration: 3
  • CNI and all pods running on the cluster
❯ kubectl get pods -A --kubeconfig shalin-eks.conf
NAMESPACE                NAME                                                              READY   STATUS              RESTARTS   AGE
default                  cluster-autoscaler-01997478-76f0-799f-b9ed-ddbff8eab94f-5ffdxsm   0/1     ContainerCreating   0          154m
kube-system              cilium-envoy-2cxcb                                                1/1     Running             0          108m
kube-system              cilium-envoy-nfp4b                                                1/1     Running             0          92m
kube-system              cilium-operator-84796b9ccf-h4lgf                                  1/1     Running             0          108m
kube-system              cilium-operator-84796b9ccf-v5hq4                                  1/1     Running             0          96m
kube-system              cilium-t4grn                                                      1/1     Running             0          92m
kube-system              cilium-zf2zm                                                      1/1     Running             0          108m
kube-system              coredns-5449774944-4hjxt                                          1/1     Running             0          155m
kube-system              coredns-5449774944-78897                                          1/1     Running             0          155m
kube-system              ebs-csi-controller-cb84bcd9-7qtqz                                 6/6     Running             0          154m
kube-system              ebs-csi-controller-cb84bcd9-dn6fg                                 6/6     Running             0          154m
kube-system              ebs-csi-node-m57pl                                                3/3     Running             0          153m
kube-system              ebs-csi-node-nnpcn                                                3/3     Running             0          92m
kube-system              hubble-relay-6b586bc6d-wd7c7                                      1/1     Running             0          108m
kube-system              snapshot-controller-6b6bf6cb95-xrm8q                              1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-gc-6489bd687c-k2psp                        1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-master-6fc5c44fb9-2bddp                    1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-worker-tdv67                               1/1     Running             0          92m
node-feature-discovery   node-feature-discovery-worker-wwr2x                               1/1     Running             0          153m
  • cilium-config configmap on EKS cluster updated to reflect eni ipam.
    Special notes for your reviewer:

@supershal supershal force-pushed the shalin/eks-cilium branch 2 times, most recently from 09a01d2 to eb5aa28 Compare September 25, 2025 00:56
Base automatically changed from dkoshkin/fix-kube-proxy-replacement-wait to main September 25, 2025 13:33
@github-actions github-actions bot added feature and removed feature labels Sep 25, 2025
@supershal supershal enabled auto-merge (squash) September 26, 2025 00:22
@dlipovetsky
Copy link
Contributor

There are many difference between the EKS and non-EKS configuration. At what point will we prefer separate templated values (or even separate static values!) for EKS, non-EKS, and possibly some other flavor.

@supershal supershal merged commit dc233f2 into main Sep 29, 2025
22 checks passed
@supershal supershal deleted the shalin/eks-cilium branch September 29, 2025 19:14
vijayaraghavanr31 pushed a commit that referenced this pull request Oct 8, 2025
**What problem does this PR solve?**:
- Stacked on
#1307
to reuse some functions and reduce merge conflicts.
- Sets Cilium default configuration for EKS to enable `eni` mode. 

**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->
- unit test for cilium template rendering

Tested manually for now.
- sample EKS cluster manifest
```
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  annotations:
    preflight.cluster.caren.nutanix.com/skip: all
  labels:
    cluster.x-k8s.io/provider: eks
  name: shalin-eks
spec:
  topology:
    class: eks-quick-start
    controlPlane:
      metadata:
        annotations:
          controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
    variables:
    - name: clusterConfig
      value:
        addons:
          clusterAutoscaler: {}
          cni:
            provider: Cilium
          csi:
            defaultStorage:
              provider: aws-ebs
              storageClassConfig: default
            providers:
              aws-ebs:
                storageClassConfigs:
                  default: {}
            snapshotController: {}
          nfd: {}
        eks:
          region: us-west-2
    version: v1.32.9
    workers:
      machineDeployments:
      - class: default-worker
        metadata:
          annotations:
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "2"
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "2"
        name: md-0
        variables:
          overrides:
          - name: workerConfig
            value:
              eks:
                instanceType: m5.2xlarge
```

- Cilium HCP
```
apiVersion: addons.cluster.x-k8s.io/v1alpha1
kind: HelmChartProxy
...<redacted>
...
  valuesTemplate: |-
    cni:
      chainingMode: portmap
      exclusive: false
    hubble:
      enabled: true
      tls:
        auto:
          enabled: true               # enable automatic TLS certificate generation
          method: cronJob             # auto generate certificates using cronJob method
          certValidityDuration: 60    # certificates validity duration in days (default 2 months)
          schedule: "0 0 1 * *"       # schedule on the 1st day regeneration of each month
      relay:
        enabled: true
        tls:
          server:
            enabled: true
            mtls: true
        image:
          useDigest: false
        priorityClassName: system-cluster-critical
    ipam:
      mode: eni
    image:
      useDigest: false
    operator:
      image:
        useDigest: false
    certgen:
      image:
        useDigest: false
    socketLB:
      hostNamespaceOnly: true
    envoy:
      image:
        useDigest: false
    kubeProxyReplacement: true
    k8sServiceHost: "A535486E46D73CBF3C959CAE8F6831A4.gr7.us-west-2.eks.amazonaws.com"
    k8sServicePort: "443"
    enableIPv4Masquerade: false
    eni:
      enabled: true
      awsReleaseExcessIPs: true
    routingMode: native
    endpointRoutes:
      enabled: true
  version: 1.17.4
......<redacted>
...
  matchingClusters:
  - apiVersion: cluster.x-k8s.io/v1beta1
    kind: Cluster
    name: shalin-eks
    namespace: default
  observedGeneration: 3
```
- CNI and all pods running on the cluster
```
❯ kubectl get pods -A --kubeconfig shalin-eks.conf
NAMESPACE                NAME                                                              READY   STATUS              RESTARTS   AGE
default                  cluster-autoscaler-01997478-76f0-799f-b9ed-ddbff8eab94f-5ffdxsm   0/1     ContainerCreating   0          154m
kube-system              cilium-envoy-2cxcb                                                1/1     Running             0          108m
kube-system              cilium-envoy-nfp4b                                                1/1     Running             0          92m
kube-system              cilium-operator-84796b9ccf-h4lgf                                  1/1     Running             0          108m
kube-system              cilium-operator-84796b9ccf-v5hq4                                  1/1     Running             0          96m
kube-system              cilium-t4grn                                                      1/1     Running             0          92m
kube-system              cilium-zf2zm                                                      1/1     Running             0          108m
kube-system              coredns-5449774944-4hjxt                                          1/1     Running             0          155m
kube-system              coredns-5449774944-78897                                          1/1     Running             0          155m
kube-system              ebs-csi-controller-cb84bcd9-7qtqz                                 6/6     Running             0          154m
kube-system              ebs-csi-controller-cb84bcd9-dn6fg                                 6/6     Running             0          154m
kube-system              ebs-csi-node-m57pl                                                3/3     Running             0          153m
kube-system              ebs-csi-node-nnpcn                                                3/3     Running             0          92m
kube-system              hubble-relay-6b586bc6d-wd7c7                                      1/1     Running             0          108m
kube-system              snapshot-controller-6b6bf6cb95-xrm8q                              1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-gc-6489bd687c-k2psp                        1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-master-6fc5c44fb9-2bddp                    1/1     Running             0          154m
node-feature-discovery   node-feature-discovery-worker-tdv67                               1/1     Running             0          92m
node-feature-discovery   node-feature-discovery-worker-wwr2x                               1/1     Running             0          153m
```

- `cilium-config` configmap on EKS cluster updated to reflect eni ipam. 
**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->

---------

Co-authored-by: Dimitri Koshkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants