-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring helm chart #5353
refactoring helm chart #5353
Changes from 12 commits
e607f79
5cab345
b3e1e35
06f6893
09edd80
2024e36
f979acf
1477602
9169687
0139b84
5a4635f
db3a3f7
5666524
f5975aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
de: | ||
image: radius.azurecr.io/deployment-engine | ||
tag: latest | ||
ucp: | ||
image: radius.azurecr.io/ucpd | ||
tag: latest | ||
# provider can be also set using rad env init --provider-aws | ||
# provider: | ||
# aws: | ||
# region:"us-east" | ||
kachawla marked this conversation as resolved.
Show resolved
Hide resolved
|
||
radius-rp: | ||
image: radius.azurecr.io/appcore-rp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we plan to change the image to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure.. @youngbupark , should I create a ticket for renaming image? |
||
tag: latest | ||
publicEndpointOverride: "" | ||
global: | ||
engine: | ||
image: radius.azurecr.io/deployment-engine | ||
tag: latest | ||
appcorerp: | ||
image: radius.azurecr.io/appcore-rp | ||
tag: latest # Tag for appcore-rp image. | ||
provider: | ||
azure: {} | ||
ucp: | ||
image: radius.azurecr.io/ucpd | ||
tag: latest # Tag for ucp image. | ||
radius: | ||
container: radius.azurecr.io/radius-controller | ||
tag: latest # Tag for radius-controller image. | ||
rp: | ||
provider: | ||
azure: {} | ||
publicEndpointOverride: "" | ||
prometheus: | ||
enabled: true | ||
path: "/metrics" | ||
port: 9090 | ||
# | ||
# Configure global.zipkin.url to enable distributed trace | ||
# zipkin: | ||
# url: "http://jaeger-collector.radius-monitoring.svc.cluster.local:9411/api/v2/spans" | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this also an example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Could you add "Example" in the comments? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,13 +80,6 @@ func ApplyRadiusHelmChart(options RadiusOptions, kubeContext string) (bool, erro | |
return false, fmt.Errorf("failed to add radius values, err: %w, helm output: %s", err, helmOutput.String()) | ||
} | ||
|
||
if options.AzureProvider != nil { | ||
err = addAzureProviderValues(helmChart, options.AzureProvider) | ||
if err != nil { | ||
return false, fmt.Errorf("failed to add azure provider values, err: %w, helm output: %s", err, helmOutput.String()) | ||
} | ||
} | ||
|
||
if options.AWSProvider != nil { | ||
err = addAWSProviderValues(helmChart, options.AWSProvider) | ||
if err != nil { | ||
|
@@ -301,76 +294,25 @@ func addAWSProviderValues(helmChart *chart.Chart, awsProvider *aws.Provider) err | |
} | ||
values := helmChart.Values | ||
|
||
_, ok := values["global"] | ||
_, ok := values["ucp"] | ||
if !ok { | ||
values["global"] = make(map[string]any) | ||
values["ucp"] = make(map[string]any) | ||
} | ||
global := values["global"].(map[string]any) | ||
ucp := values["ucp"].(map[string]any) | ||
|
||
_, ok = global["rp"] | ||
_, ok = ucp["provider"] | ||
if !ok { | ||
global["rp"] = make(map[string]any) | ||
ucp["provider"] = make(map[string]any) | ||
} | ||
rp := global["rp"].(map[string]any) | ||
provider := ucp["provider"].(map[string]any) | ||
|
||
_, ok = rp["provider"] | ||
_, ok = provider["aws"] | ||
if !ok { | ||
rp["provider"] = make(map[string]any) | ||
} | ||
provider := rp["provider"].(map[string]any) | ||
|
||
provider["aws"] = map[string]any{ | ||
"accessKeyId": awsProvider.AccessKeyId, | ||
"secretAccessKey": awsProvider.SecretAccessKey, | ||
"region": awsProvider.TargetRegion, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please remove |
||
|
||
return nil | ||
} | ||
|
||
func addAzureProviderValues(helmChart *chart.Chart, azureProvider *azure.Provider) error { | ||
if azureProvider == nil { | ||
return nil | ||
} | ||
values := helmChart.Values | ||
|
||
_, ok := values["global"] | ||
if !ok { | ||
values["global"] = make(map[string]any) | ||
} | ||
global := values["global"].(map[string]any) | ||
|
||
_, ok = global["rp"] | ||
if !ok { | ||
global["rp"] = make(map[string]any) | ||
} | ||
rp := global["rp"].(map[string]any) | ||
|
||
_, ok = rp["provider"] | ||
if !ok { | ||
rp["provider"] = make(map[string]any) | ||
} | ||
provider := rp["provider"].(map[string]any) | ||
|
||
_, ok = provider["azure"] | ||
if !ok { | ||
provider["azure"] = make(map[string]any) | ||
} | ||
|
||
azure := provider["azure"].(map[string]any) | ||
|
||
if azureProvider.ServicePrincipal != nil { | ||
_, ok = azure["servicePrincipal"] | ||
if !ok { | ||
azure["servicePrincipal"] = make(map[string]any) | ||
} | ||
azure["servicePrincipal"] = map[string]any{ | ||
"clientId": azureProvider.ServicePrincipal.ClientID, | ||
"clientSecret": azureProvider.ServicePrincipal.ClientSecret, | ||
"tenantId": azureProvider.ServicePrincipal.TenantID, | ||
} | ||
provider["aws"] = make(map[string]any) | ||
} | ||
aws := provider["aws"].(map[string]any) | ||
|
||
aws["region"] = awsProvider.TargetRegion | ||
kachawla marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.