Skip to content

Private Cluster Setup

Key Features/Components

  • Private Cluster: Ensures that the nodes in the cluster are not directly accessible from the internet.
  • Network Policies: Enables fine-grained control over inbound and outbound traffic within the cluster.
  • Isolation: Provides enhanced security by isolating the cluster from external access.

Step-by-step Instructions or Configuration Details

  1. Creating a Private Cluster:

    • Use the following command to create a private cluster in HKE:
      Terminal window
      hke cluster create --private true
  2. Configuring Network Policies:

    • Define network policies using YAML files and apply them to the cluster.
      # Example Network Policy
      apiVersion: networking.k8s.io/v1
      kind: NetworkPolicy
      metadata:
      name: my-network-policy
      spec:
      podSelector:
      matchLabels:
      role: db
      ingress:
      - from:
      - podSelector:
      matchLabels:
      role: frontend
      ports:
      - protocol: TCP
      port: 3306

Best Practices and Recommendations

  • Regularly review and update network policies to maintain a secure environment.
  • Implement strong authentication mechanisms for cluster access.
  • hke cluster create: Command to create a new cluster in HKE.
  • Kubernetes Network Policies: Official Documentation

Common Pitfalls and Solutions

End of Documentation