@@ -40,6 +40,7 @@ use mz_cloud_resources::crd::{
4040 ManagedResource ,
4141 balancer:: v1alpha1:: { Balancer , BalancerSpec } ,
4242 console:: v1alpha1:: { BalancerdRef , Console , ConsoleSpec , HttpConnectionScheme } ,
43+ environment:: v1alpha1:: { Environment , EnvironmentSpec } ,
4344 materialize:: v1alpha1:: { Materialize , MaterializeRolloutStrategy , MaterializeStatus } ,
4445} ;
4546use mz_license_keys:: validate;
@@ -66,7 +67,6 @@ pub struct Config {
6667 pub console_image_tag_map : Vec < KeyValueArg < String , String > > ,
6768
6869 pub aws_account_id : Option < String > ,
69- pub environmentd_iam_role_arn : Option < String > ,
7070 pub environmentd_connection_role_arn : Option < String > ,
7171 pub aws_secrets_controller_tags : Vec < String > ,
7272 pub environmentd_availability_zones : Option < Vec < String > > ,
@@ -77,7 +77,6 @@ pub struct Config {
7777 pub enable_internal_statement_logging : bool ,
7878 pub disable_statement_logging : bool ,
7979
80- pub orchestratord_pod_selector_labels : Vec < KeyValueArg < String , String > > ,
8180 pub environmentd_node_selector : Vec < KeyValueArg < String , String > > ,
8281 pub environmentd_affinity : Option < Affinity > ,
8382 pub environmentd_tolerations : Option < Vec < Toleration > > ,
@@ -86,11 +85,6 @@ pub struct Config {
8685 pub clusterd_affinity : Option < Affinity > ,
8786 pub clusterd_tolerations : Option < Vec < Toleration > > ,
8887 pub image_pull_policy : KubernetesImagePullPolicy ,
89- pub network_policies_internal_enabled : bool ,
90- pub network_policies_ingress_enabled : bool ,
91- pub network_policies_ingress_cidrs : Vec < String > ,
92- pub network_policies_egress_enabled : bool ,
93- pub network_policies_egress_cidrs : Vec < String > ,
9488
9589 pub environmentd_cluster_replica_sizes : Option < String > ,
9690 pub bootstrap_default_cluster_replica_size : Option < String > ,
@@ -118,7 +112,6 @@ pub struct Config {
118112 pub disable_license_key_checks : bool ,
119113
120114 pub tracing : TracingCliArgs ,
121- pub orchestratord_namespace : String ,
122115}
123116
124117pub struct Context {
@@ -272,6 +265,7 @@ impl k8s_controller::Context for Context {
272265 mz : & Self :: Resource ,
273266 ) -> Result < Option < Action > , Self :: Error > {
274267 let mz_api: Api < Materialize > = Api :: namespaced ( client. clone ( ) , & mz. namespace ( ) ) ;
268+ let environment_api: Api < Environment > = Api :: namespaced ( client. clone ( ) , & mz. namespace ( ) ) ;
275269 let balancer_api: Api < Balancer > = Api :: namespaced ( client. clone ( ) , & mz. namespace ( ) ) ;
276270 let console_api: Api < Console > = Api :: namespaced ( client. clone ( ) , & mz. namespace ( ) ) ;
277271 let secret_api: Api < Secret > = Api :: namespaced ( client. clone ( ) , & mz. namespace ( ) ) ;
@@ -360,6 +354,20 @@ impl k8s_controller::Context for Context {
360354
361355 self . check_environment_id_conflicts ( mz) ?;
362356
357+ let environment = Environment {
358+ metadata : mz. managed_resource_meta ( mz. name_unchecked ( ) ) ,
359+ spec : EnvironmentSpec {
360+ environmentd_iam_role_arn : mz. spec . environmentd_iam_role_arn . clone ( ) ,
361+ service_account_name : mz. spec . service_account_name . clone ( ) ,
362+ service_account_annotations : mz. spec . service_account_annotations . clone ( ) ,
363+ service_account_labels : mz. spec . service_account_labels . clone ( ) ,
364+ internal_certificate_spec : mz. spec . internal_certificate_spec . clone ( ) ,
365+ resource_id : Some ( status. resource_id . clone ( ) ) ,
366+ } ,
367+ status : None ,
368+ } ;
369+ apply_resource ( & environment_api, & environment) . await ?;
370+
363371 // we compare the hash against the environment resources generated
364372 // for the current active generation, since that's what we expect to
365373 // have been applied earlier, but we don't want to use these
0 commit comments