Changes between Version 5 and Version 6 of k8snetworking2023
- Timestamp:
- Dec 7, 2023, 7:51:19 AM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
k8snetworking2023
v5 v6 7 7 MetalLB can be installed via a manifest or using Helm. We'll use the manifest method here. 8 8 9 '' '1. Apply the MetalLB manifest:'''9 ''1. Apply the MetalLB manifest:'' 10 10 11 11 {{{ … … 17 17 Note: Ensure you're using the latest version of MetalLB. 18 18 19 '' '2. Verify the Installation.'''19 ''2. Verify the Installation.'' 20 20 21 21 `kubectl get pods -n metallb-system` … … 27 27 MetalLB can operate in either Layer 2 mode or BGP mode. We'll use Layer 2 mode for simplicity. 28 28 29 1. Create a ConfigMap for MetalLB: Define a range of IP addresses that MetalLB will manage. Create a file named `metallb-pool.yaml` with the following content: 29 ''1. Create a ConfigMap for MetalLB: Define a range of IP addresses that MetalLB will manage. Create a file named `metallb-pool.yaml` with the following content:'' 30 30 31 31 {{{ … … 47 47 `kubectl apply -f metallb-pool.yaml` 48 48 49 2. Create a L2 Advertisement: When additional IP ranges are defined in the config- map, they need to be advertised on to the network. Create a file named L2add.yaml with the following content: 49 ''2. Create a L2 Advertisement: When additional IP ranges are defined in the config- map, they need to be advertised on to the network. Create a file named L2add.yaml with the following content:'' 50 50 51 51 {{{ … … 92 92 kubectl get svc wordpress-service 93 93 94 3. MetalLB will assign an external IP from the defined range to your service. 94 ''3. MetalLB will assign an external IP from the defined range to your service.'' 95 95 96 96 '''Step 4: Access the Service''' … … 128 128 '''Step 1: Expose Your Service Using NodePort''' 129 129 130 1. Create a Service of Type NodePort for Your Web Application: Suppose you have a deployment named webapp. You'll need to create a service for it. Here's an example YAML for the service: 130 ''1. Create a Service of Type NodePort for Your Web Application: Suppose you have a deployment named webapp. You'll need to create a service for it. Here's an example YAML for the service:'' 131 131 132 132 {{{ … … 153 153 '''Step 2: Set Up Ingress to Route to the NodePort Service''' 154 154 155 1. Define an Ingress Resource: Create an Ingress resource that routes traffic to your NodePort service. Here's an example YAML for the Ingress: 155 ''1. Define an Ingress Resource: Create an Ingress resource that routes traffic to your NodePort service. Here's an example YAML for the Ingress:'' 156 156 157 157 {{{ … … 187 187 Ensuring that your Ingress Controller is properly set up and accessible from outside the Kubernetes cluster involves several key steps. This setup is crucial for allowing external traffic to reach your services through the Ingress rules you've defined. Here's a breakdown of what this entails: 188 188 189 1. Deploying the Ingress Controller 189 ''1. Deploying the Ingress Controller'' 190 190 191 191 • Choose an Ingress Controller: There are several Ingress Controllers available, such as NGINX, Traefik, HAProxy, etc. NGINIX is a popular choice due to its stability and feature set. … … 199 199 v1.8.2/deploy/static/provider/cloud/deploy.yaml 200 200 }}} 201 202 2. Exposing the Ingress Controller 201 '' 202 2. Exposing the Ingress Controller'' 203 203 204 204 … … 209 209 '''Step 4: DNS Configuration''' 210 210 211 1. Configure DNS: Map the DNS record to the external IP address of one of your cluster nodes (if using NodePort for the Ingress Controller) or to the external IP provided by the LoadBalancer (if using LoadBalancer for the Ingress Controller). 211 ''1. Configure DNS: Map the DNS record to the external IP address of one of your cluster nodes (if using NodePort for the Ingress Controller) or to the external IP provided by the LoadBalancer (if using LoadBalancer for the Ingress Controller).'' 212 212 213 213 Read More: