Applying No_Proxy CIDR Block to VKS Supervisor
search cancel

Applying No_Proxy CIDR Block to VKS Supervisor

book

Article ID: 428237

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service VMware vSphere ESXi

Issue/Introduction

When applying No_Proxy settings to the Supervisor cluster a customer with a large environment may want to add a CIDR block to the No_Proxy settings. 


Environment

VKS with vSphere 8.0+
VKS with VCF 9.0+

Cause

The vSphere UI will only accept individual IP addresses or FQDN seperated by commas, a CIDR block will not be accepted therefore if the customer must use CIDR block notation the setting must be applied manually.

Resolution

Recommended Values to add to NO_Proxy:
 
Load Balancer IP range from AVI IPAM, Management CIDR, Services CIDR.

CIDR block can be applied at three different scopes.

Inherited settings from vCenter: 

  1. SSH to vCenter server.
  2. Edit /etc/sysconfig/proxy and add CIDR block under "NO_PROXY"
    # Example: NO_PROXY="www.example.domain, domain.main, localhost"
    NO_PROXY="localhost, 127.0.0.1, 172.16.0.0/16"
    

    Process also described on KB 370265 https://knowledge.broadcom.com/external/article/370265/how-to-configure-proxy-settings-for-vcen.html

  3. Reboot vCenter server to apply the setting
  4. Verify setting on VC and Supervisor. 
    1. On vCenter check network traffic and confirm contents of /etc/sysconfig/proxy
    2. On supervisor node confirm proxy setting is applied.
      cat /etc/containerd/containerd-environment

      Output should show newly set CIDR block after NO_PROXY=

      cat /etc/containerd/containerd-environment
      HTTP_PROXY=
      HTTPS_PROXY=
      NO_PROXY=" 127.0.0.1, 172.16.0.0/16, <supervisor_node_IP_Addresses>,docker-registry.kube-system.svc,localhost"

       

Apply Directly to Supervisor:

  • SSH to each supervisor control plane nodes and update the file "/etc/containerd/containerd-environment" with the desired no_proxy setting. 

Apply to Guest Clusters:

  • Add to custom cluster class
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: tanzu-workload-cluster
  namespace: tanzu-clusters
spec:
  topology:
    class: tanzu-standard-cluster-class # The ClusterClass name
    version: v1.25.7+vmware.1
    variables:
      - name: proxy
        value:
          httpProxy: "http://proxy.internal:8080"
          httpsProxy: "http://proxy.internal:8080"
          noProxy: "localhost,127.0.0.1,.svc,.svc.cluster.local,10.96.0.0/12,192.168.0.0/16"
  •    Add to Daemonset:
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentbit-logging
  namespace: kube-system
spec:
  selector:
    matchLabels:
      name: fluentbit
  template:
    metadata:
      labels:
        name: fluentbit
    spec:
      containers:
      - name: fluentbit
        image: fluent/fluent-bit:latest
        env:
        - name: HTTP_PROXY
          value: "http://squid.proxy.corp:3128"
        - name: HTTPS_PROXY
          value: "http://squid.proxy.corp:3128"
        - name: NO_PROXY
          value: "localhost,127.0.0.1,kubernetes.default.svc,logging-svc.internal"
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 100Mi