|
87 | 87 | "addons_config.0.config_connector_config",
|
88 | 88 | "addons_config.0.gcs_fuse_csi_driver_config",
|
89 | 89 | "addons_config.0.stateful_ha_config",
|
| 90 | + "addons_config.0.ray_operator_config", |
90 | 91 | "addons_config.0.istio_config",
|
91 | 92 | "addons_config.0.kalm_config",
|
92 | 93 | }
|
@@ -522,6 +523,52 @@ func ResourceContainerCluster() *schema.Resource {
|
522 | 523 | },
|
523 | 524 | },
|
524 | 525 | },
|
| 526 | + "ray_operator_config": { |
| 527 | + Type: schema.TypeList, |
| 528 | + Optional: true, |
| 529 | + Computed: true, |
| 530 | + AtLeastOneOf: addonsConfigKeys, |
| 531 | + MaxItems: 3, |
| 532 | + Description: `The status of the Ray Operator addon, which enabled management of Ray AI/ML jobs on GKE. Defaults to disabled; set enabled = true to enable.`, |
| 533 | + Elem: &schema.Resource{ |
| 534 | + Schema: map[string]*schema.Schema{ |
| 535 | + "enabled": { |
| 536 | + Type: schema.TypeBool, |
| 537 | + Required: true, |
| 538 | + }, |
| 539 | + "ray_cluster_logging_config": { |
| 540 | + Type: schema.TypeList, |
| 541 | + Optional: true, |
| 542 | + Computed: true, |
| 543 | + MaxItems: 1, |
| 544 | + Description: `The status of Ray Logging, which scrapes Ray cluster logs to Cloud Logging. Defaults to disabled; set enabled = true to enable.`, |
| 545 | + Elem: &schema.Resource{ |
| 546 | + Schema: map[string]*schema.Schema{ |
| 547 | + "enabled": { |
| 548 | + Type: schema.TypeBool, |
| 549 | + Required: true, |
| 550 | + }, |
| 551 | + }, |
| 552 | + }, |
| 553 | + }, |
| 554 | + "ray_cluster_monitoring_config": { |
| 555 | + Type: schema.TypeList, |
| 556 | + Optional: true, |
| 557 | + Computed: true, |
| 558 | + MaxItems: 1, |
| 559 | + Description: `The status of Ray Cluster monitoring, which shows Ray cluster metrics in Cloud Console. Defaults to disabled; set enabled = true to enable.`, |
| 560 | + Elem: &schema.Resource{ |
| 561 | + Schema: map[string]*schema.Schema{ |
| 562 | + "enabled": { |
| 563 | + Type: schema.TypeBool, |
| 564 | + Required: true, |
| 565 | + }, |
| 566 | + }, |
| 567 | + }, |
| 568 | + }, |
| 569 | + }, |
| 570 | + }, |
| 571 | + }, |
525 | 572 | },
|
526 | 573 | },
|
527 | 574 | },
|
@@ -4521,6 +4568,28 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
|
4521 | 4568 | }
|
4522 | 4569 | }
|
4523 | 4570 |
|
| 4571 | + if v, ok := config["ray_operator_config"]; ok && len(v.([]interface{})) > 0 { |
| 4572 | + addon := v.([]interface{})[0].(map[string]interface{}) |
| 4573 | + ac.RayOperatorConfig = &container.RayOperatorConfig{ |
| 4574 | + Enabled: addon["enabled"].(bool), |
| 4575 | + ForceSendFields: []string{"Enabled"}, |
| 4576 | + } |
| 4577 | + if v, ok := addon["ray_cluster_logging_config"]; ok && len(v.([]interface{})) > 0 { |
| 4578 | + loggingConfig := v.([]interface{})[0].(map[string]interface{}) |
| 4579 | + ac.RayOperatorConfig.RayClusterLoggingConfig = &container.RayClusterLoggingConfig{ |
| 4580 | + Enabled: loggingConfig["enabled"].(bool), |
| 4581 | + ForceSendFields: []string{"Enabled"}, |
| 4582 | + } |
| 4583 | + } |
| 4584 | + if v, ok := addon["ray_cluster_monitoring_config"]; ok && len(v.([]interface{})) > 0 { |
| 4585 | + loggingConfig := v.([]interface{})[0].(map[string]interface{}) |
| 4586 | + ac.RayOperatorConfig.RayClusterMonitoringConfig = &container.RayClusterMonitoringConfig{ |
| 4587 | + Enabled: loggingConfig["enabled"].(bool), |
| 4588 | + ForceSendFields: []string{"Enabled"}, |
| 4589 | + } |
| 4590 | + } |
| 4591 | + } |
| 4592 | + |
4524 | 4593 | if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
|
4525 | 4594 | addon := v.([]interface{})[0].(map[string]interface{})
|
4526 | 4595 | ac.IstioConfig = &container.IstioConfig{
|
@@ -5705,6 +5774,24 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
|
5705 | 5774 | },
|
5706 | 5775 | }
|
5707 | 5776 | }
|
| 5777 | + if c.RayOperatorConfig != nil { |
| 5778 | + rayConfig := c.RayOperatorConfig |
| 5779 | + result["ray_operator_config"] = []map[string]interface{}{ |
| 5780 | + { |
| 5781 | + "enabled": rayConfig.Enabled, |
| 5782 | + }, |
| 5783 | + } |
| 5784 | + if rayConfig.RayClusterLoggingConfig != nil { |
| 5785 | + result["ray_operator_config"].([]map[string]any)[0]["ray_cluster_logging_config"] = []map[string]interface{}{{ |
| 5786 | + "enabled": rayConfig.RayClusterLoggingConfig.Enabled, |
| 5787 | + }} |
| 5788 | + } |
| 5789 | + if rayConfig.RayClusterMonitoringConfig != nil { |
| 5790 | + result["ray_operator_config"].([]map[string]any)[0]["ray_cluster_monitoring_config"] = []map[string]interface{}{{ |
| 5791 | + "enabled": rayConfig.RayClusterMonitoringConfig.Enabled, |
| 5792 | + }} |
| 5793 | + } |
| 5794 | + } |
5708 | 5795 |
|
5709 | 5796 | if c.IstioConfig != nil {
|
5710 | 5797 | result["istio_config"] = []map[string]interface{}{
|
|
0 commit comments