@@ -162,12 +162,12 @@ you can run the following command before performing the deletion operation.
162
162
kubectl label karmada karmada-demo -n test operator.karmada.io/disable-cascading-deletion=true
163
163
```
164
164
165
- ### Custom Karmada CR
165
+ ## Custom Karmada CR
166
166
167
167
This feature allows you to configure the Karmada CR to install Karmada instances flexibly.
168
168
For details, see [ karmada.yaml] ( ./config/samples/karmada.yaml ) .
169
169
170
- #### Set Karmada component replicas
170
+ ### Set Karmada component replicas
171
171
172
172
The ` replicas ` of all Karmada components can be modified.
173
173
For example, you can scale the etcd pod ` replicas ` to 3:
@@ -185,7 +185,7 @@ spec:
185
185
replicas : 3
186
186
` ` `
187
187
188
- #### Custom label and annotation
188
+ ### Custom label and annotation
189
189
190
190
All Karmada components allow for custom labels and annotations to be set.
191
191
These are merged into both pod and workload resources.
@@ -205,7 +205,7 @@ spec:
205
205
<custom-annotation-key> : <custom-annotation-value>
206
206
` ` `
207
207
208
- #### Change karmada-apiserver service type
208
+ ### Change karmada-apiserver service type
209
209
210
210
The service type of karmada-apiserver is ` ClusterIP` by default.
211
211
You can change it to `NodePort` :
@@ -221,7 +221,7 @@ karmadaAPIServer:
221
221
...
222
222
` ` `
223
223
224
- # ### Add karmada-apiserver SANs
224
+ # ## Add karmada-apiserver SANs
225
225
226
226
You can add more SANs to karmada-apiserver certificate :
227
227
@@ -238,7 +238,7 @@ karmadaAPIServer:
238
238
...
239
239
` ` `
240
240
241
- # ### Install karmada addon
241
+ # ## Install karmada addon
242
242
243
243
By default, the Karmada operator does not install the `descheduler` and `search` addons.
244
244
If you want to use them, you should add definitions to the Karmada CR.
@@ -257,6 +257,56 @@ spec:
257
257
258
258
If you want to install with the defaults, simply define an empty struct for `descheduler`.
259
259
260
+ # ## Expose Karmada API Server
261
+ By default, the Karmada API Server's Service type is set to `ClusterIP`, which means it can only be accessed within
262
+ the Kubernetes cluster. If you wish to access the Karmada API Server from outside the cluster, there are several
263
+ methods to expose it. The following will introduce these methods and provide the necessary configuration steps.
264
+
265
+ # ### Using a LoadBalancer Service Type
266
+ If your Kubernetes cluster runs on a cloud provider that supports LoadBalancer (such as AWS, GCP, Azure, etc.),
267
+ you can change the Karmada API Server's Service type to `LoadBalancer`. This will automatically allocate or use an
268
+ external IP address for the Karmada API Server, allowing you to access it from outside the cluster.
269
+
270
+ # ### Using a NodePort Service Type
271
+ You also can change the Karmada API Server's Service type to `NodePort`. This exposes the Karmada API Server on a
272
+ specific port on each node, allowing you to access it via any node's IP address and that port.
273
+
274
+ # ### Using an Ingress Controller
275
+ If you already have an [Ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/)
276
+ deployed in your cluster, you can create an `Ingress` resource to expose the Karmada API Server. The Ingress controller
277
+ will route external traffic to the Karmada API Server's Service, enabling external access.
278
+
279
+ For example, you can create a following Ingress resource to route external traffic to the Karmada API Server :
280
+ ` ` ` yaml
281
+ apiVersion: networking.k8s.io/v1
282
+ kind: Ingress
283
+ metadata:
284
+ name: karmada-apiserver-ingress
285
+ namespace: karmada-system
286
+ annotations:
287
+ nginx.ingress.kubernetes.io/ssl-passthrough: "true"
288
+ nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
289
+ spec:
290
+ ingressClassName: nginx
291
+ rules:
292
+ - host: karmada.example.com
293
+ http:
294
+ paths:
295
+ - path: /
296
+ pathType: Prefix
297
+ backend:
298
+ service:
299
+ name: karmada-apiserver
300
+ port:
301
+ number: 443
302
+ ` ` `
303
+
304
+ # ### Using Port Forwarding
305
+ If you only need temporary access to the Karmada API Server or prefer not to permanently expose it, you can use kubectl
306
+ [port-forward](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to
307
+ forward a local port to the Karmada API Server's Pod. This method is ideal for development and debugging but is not
308
+ recommended for production environments.
309
+
260
310
# # Contributing
261
311
262
312
The `karmada/operator` repo is part of Karmada from 1.5 onwards. If you're interested in
0 commit comments