Commit a5afe0c
committed
Add comprehensive Kerberos authentication support for Apache Spark applications
This commit implements complete Kerberos authentication support for Spark applications
running on Kubernetes, providing secure access to Hadoop ecosystem services including
HDFS, Hive, HBase, and other Kerberos-enabled components.
Key Features:
- Native Kerberos configuration in SparkApplication CRD
- Automatic keytab and krb5.conf secret mounting
- Spark 4.0+ compatibility with delegation token management
- Configurable credential renewal strategies (keytab/ccache)
- Service-specific Kerberos credential control
- Comprehensive documentation and examples
Implementation Details:
- New KerberosSpec API with principal, keytab, and config options
- SecretTypeKerberosKeytab for automatic environment variable setup
- Automatic secret mounting to driver and executor pods
- Spark configuration generation for Hadoop and Kerberos settings
- Environment variable configuration for KRB5_KEYTAB_FILE and KRB5_PRINCIPAL
- Support for custom keytab/config file names and mount paths
Configuration Options:
- principal: Kerberos principal name
- keytabSecret/configSecret: Secret names containing keytab and krb5.conf
- renewalCredentials: Credential renewal strategy (keytab/ccache)
- enabledServices: Configurable Hadoop services for delegation tokens
- keytabFile/configFile: Custom file names within secrets
Files Modified:
- API types and generated code for new Kerberos fields
- Spark submission logic with automatic Kerberos configuration
- Helm chart with new Kerberos values and updated CRDs
- Comprehensive documentation with setup guide and examples
- Unit tests covering all Kerberos configuration scenarios
The implementation automatically handles Spark 4.0's validation requirements
while using user-provided secrets for actual authentication, ensuring
compatibility with existing Kubernetes secret management practices.
Signed-off-by: josecsotomorales <josecsmorales@gmail.com>1 parent 3d78c3f commit a5afe0c
File tree
15 files changed
+1202
-5
lines changed- api/v1beta2
- charts/spark-operator-chart
- crds
- config/crd/bases
- docs
- examples
- internal/controller/sparkapplication
- pkg/common
15 files changed
+1202
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| |||
604 | 607 | | |
605 | 608 | | |
606 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
607 | 613 | | |
608 | 614 | | |
609 | 615 | | |
| |||
717 | 723 | | |
718 | 724 | | |
719 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10342 | 10342 | | |
10343 | 10343 | | |
10344 | 10344 | | |
| 10345 | + | |
| 10346 | + | |
| 10347 | + | |
| 10348 | + | |
| 10349 | + | |
| 10350 | + | |
| 10351 | + | |
| 10352 | + | |
| 10353 | + | |
| 10354 | + | |
| 10355 | + | |
| 10356 | + | |
| 10357 | + | |
| 10358 | + | |
| 10359 | + | |
| 10360 | + | |
| 10361 | + | |
| 10362 | + | |
| 10363 | + | |
| 10364 | + | |
| 10365 | + | |
| 10366 | + | |
| 10367 | + | |
| 10368 | + | |
| 10369 | + | |
| 10370 | + | |
| 10371 | + | |
| 10372 | + | |
| 10373 | + | |
| 10374 | + | |
| 10375 | + | |
| 10376 | + | |
| 10377 | + | |
| 10378 | + | |
| 10379 | + | |
| 10380 | + | |
| 10381 | + | |
| 10382 | + | |
| 10383 | + | |
| 10384 | + | |
| 10385 | + | |
| 10386 | + | |
| 10387 | + | |
| 10388 | + | |
| 10389 | + | |
| 10390 | + | |
| 10391 | + | |
| 10392 | + | |
| 10393 | + | |
| 10394 | + | |
| 10395 | + | |
10345 | 10396 | | |
10346 | 10397 | | |
10347 | 10398 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10260 | 10260 | | |
10261 | 10261 | | |
10262 | 10262 | | |
| 10263 | + | |
| 10264 | + | |
| 10265 | + | |
| 10266 | + | |
| 10267 | + | |
| 10268 | + | |
| 10269 | + | |
| 10270 | + | |
| 10271 | + | |
| 10272 | + | |
| 10273 | + | |
| 10274 | + | |
| 10275 | + | |
| 10276 | + | |
| 10277 | + | |
| 10278 | + | |
| 10279 | + | |
| 10280 | + | |
| 10281 | + | |
| 10282 | + | |
| 10283 | + | |
| 10284 | + | |
| 10285 | + | |
| 10286 | + | |
| 10287 | + | |
| 10288 | + | |
| 10289 | + | |
| 10290 | + | |
| 10291 | + | |
| 10292 | + | |
| 10293 | + | |
| 10294 | + | |
| 10295 | + | |
| 10296 | + | |
| 10297 | + | |
| 10298 | + | |
| 10299 | + | |
| 10300 | + | |
| 10301 | + | |
| 10302 | + | |
| 10303 | + | |
| 10304 | + | |
| 10305 | + | |
| 10306 | + | |
| 10307 | + | |
| 10308 | + | |
| 10309 | + | |
| 10310 | + | |
| 10311 | + | |
| 10312 | + | |
10263 | 10313 | | |
10264 | 10314 | | |
10265 | 10315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
412 | 437 | | |
413 | 438 | | |
414 | 439 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10342 | 10342 | | |
10343 | 10343 | | |
10344 | 10344 | | |
| 10345 | + | |
| 10346 | + | |
| 10347 | + | |
| 10348 | + | |
| 10349 | + | |
| 10350 | + | |
| 10351 | + | |
| 10352 | + | |
| 10353 | + | |
| 10354 | + | |
| 10355 | + | |
| 10356 | + | |
| 10357 | + | |
| 10358 | + | |
| 10359 | + | |
| 10360 | + | |
| 10361 | + | |
| 10362 | + | |
| 10363 | + | |
| 10364 | + | |
| 10365 | + | |
| 10366 | + | |
| 10367 | + | |
| 10368 | + | |
| 10369 | + | |
| 10370 | + | |
| 10371 | + | |
| 10372 | + | |
| 10373 | + | |
| 10374 | + | |
| 10375 | + | |
| 10376 | + | |
| 10377 | + | |
| 10378 | + | |
| 10379 | + | |
| 10380 | + | |
| 10381 | + | |
| 10382 | + | |
| 10383 | + | |
| 10384 | + | |
| 10385 | + | |
| 10386 | + | |
| 10387 | + | |
| 10388 | + | |
| 10389 | + | |
| 10390 | + | |
| 10391 | + | |
| 10392 | + | |
| 10393 | + | |
| 10394 | + | |
| 10395 | + | |
10345 | 10396 | | |
10346 | 10397 | | |
10347 | 10398 | | |
| |||
0 commit comments