Skip to content

Commit

Permalink
Cleanup portable resource API routes (#6687)
Browse files Browse the repository at this point in the history
# Description

This removes references to the old portable resource API route
registration

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
#6269

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #6269

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 07ad71e</samp>

### Summary
🗑️📦🛠️

<!--
1. 🗑️ - This emoji represents the removal of unused or unnecessary code
or files, such as the flag and the configmap.
2. 📦 - This emoji represents the packaging or embedding of the portable
resource configuration in the host options, making it easier to deploy
and manage the service.
3. 🛠️ - This emoji represents the improvement or simplification of the
service by using the new configuration mechanism.
-->
This pull request embeds the portable resource configuration in the host
options of the applications-rp service. It removes the
`--portableresource-config` flag and the `portableresource-*.yaml` files
from the code, the launch configuration, and the Helm chart templates.
This simplifies the service configuration and deployment.

> _No more flags of doom, no more files of despair_
> _We embed the power in the host, we unleash the portable resource_
> _We simplify the service, we remove the obsolete code_
> _We are the applications-rp, we are the masters of the helm_

### Walkthrough
* Remove `--portableresource-config` flag and related variables from
applications-rp service
([link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-bd5430ee7c51dc892a67b3f2829d1f5b6d223f0fd48b82322cfd45baf9f5e945L17-L18),
[link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL58-L62),
[link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-92bd08c7c2302e12d2ceb2f7bf0a5bdd0016bb8e2eb2639588e994366e9ee841L35))
* Remove loading and assignment of portable resource configuration from
environment and ETCD client in `main.go`
([link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL92-L97),
[link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL108-L111))
* Remove portableresource-self-host.yaml file from configmaps template
in Helm chart
([link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-58d6d96c3a9a74e33fc72e9a458a3e9f4c463287d906985725fddb0398081126L59-L108))
* Delete unused portable resource configuration files
([link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-5b57e9314a18299dc316a8cfec855ae859078a6b3baaf8a9d9205f4d1e26e665),
[link](https://github.com/radius-project/radius/pull/6687/files?diff=unified&w=0#diff-a9312f9d13becb76eeb2cba6b9a0f78cc182ae1c203e3f3db5899f3aec534940))

---------

Signed-off-by: sk593 <[email protected]>
  • Loading branch information
sk593 authored Nov 14, 2023
1 parent 1acbd9e commit c6423fa
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 166 deletions.
2 changes: 0 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"args": [
"--config-file",
"${workspaceFolder}/cmd/applications-rp/radius-self-hosted.yaml",
"--portableresource-config",
"${workspaceFolder}/cmd/applications-rp/portableresource-self-hosted.yaml",
],
"env": {
"RADIUS_ENV": "self-hosted"
Expand Down
15 changes: 0 additions & 15 deletions cmd/applications-rp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ func main() {
if configFile == "" {
log.Fatal("config-file is empty.") //nolint:forbidigo // this is OK inside the main function.
}

var portableResourceConfigFile string
defaultPortableRsConfig := fmt.Sprintf("portableresource-%s.yaml", hostoptions.Environment())
pflag.StringVar(&portableResourceConfigFile, "portableresource-config", defaultPortableRsConfig, "The service configuration file for portable resource providers.")

pflag.Parse()

options, err := hostoptions.NewHostOptionsFromEnvironment(configFile)
Expand Down Expand Up @@ -89,12 +84,6 @@ func main() {
// Must set the logger before using controller-runtime.
runtimelog.SetLogger(logger)

// Load portable resource config.
prOptions, err := hostoptions.NewHostOptionsFromEnvironment(portableResourceConfigFile)
if err != nil {
log.Fatal(err) //nolint:forbidigo // this is OK inside the main function.
}

if options.Config.StorageProvider.Provider == dataprovider.TypeETCD &&
options.Config.StorageProvider.ETCD.InMemory {
// For in-memory etcd we need to register another service to manage its lifecycle.
Expand All @@ -105,10 +94,6 @@ func main() {
options.Config.StorageProvider.ETCD.Client = client
options.Config.SecretProvider.ETCD.Client = client

// Portable resource options
prOptions.Config.StorageProvider.ETCD.Client = client
prOptions.Config.SecretProvider.ETCD.Client = client

hostingSvc = append(hostingSvc, data.NewEmbeddedETCDService(data.EmbeddedETCDServiceOptions{ClientConfigSink: client}))
}

Expand Down
42 changes: 0 additions & 42 deletions cmd/applications-rp/portableresource-dev.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions cmd/applications-rp/portableresource-self-hosted.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions deploy/Chart/templates/rp/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,53 +56,3 @@ data:
deleteRetryDelaySeconds: 60
terraform:
path: "/terraform"
portableresource-self-host.yaml: |-
# Radius configuration file.
# See https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information.
environment:
name: self-hosted
roleLocation: "global"
storageProvider:
provider: "apiserver"
apiserver:
context: ""
namespace: "radius-system"
queueProvider:
provider: "apiserver"
name: "radiusportable"
apiserver:
context: ""
namespace: "radius-system"
secretProvider:
provider: kubernetes
metricsProvider:
prometheus:
enabled: true
path: "/metrics"
port: 9090
profilerProvider:
enabled: true
port: 6060
server:
host: "0.0.0.0"
port: 5444
workerServer:
maxOperationConcurrency: 10
maxOperationRetryCount: 2
ucp:
kind: kubernetes
logging:
level: "info"
json: true
{{- if and .Values.global.zipkin .Values.global.zipkin.url }}
tracerProvider:
serviceName: "applications.datastores"
zipkin:
url: {{ .Values.global.zipkin.url }}
{{- end }}
bicep:
deleteRetryCount: 20
deleteRetryDelaySeconds: 60
terraform:
path: "/terraform"
1 change: 0 additions & 1 deletion deploy/Chart/templates/rp/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ spec:
image: "{{ .Values.rp.image }}:{{ .Values.rp.tag | default $appversion }}"
args:
- --config-file=/etc/config/radius-self-host.yaml
- --portableresource-config=/etc/config/portableresource-self-host.yaml
env:
- name: SKIP_ARM
value: 'false'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ The easiest way to get started is to launch Radius using VS Code. This will give
If you need to manually test APIs you can reach them at the following endpoints after following these instructions:

- UCP: port 9000
- AppCore Namespace: port 8080
- AppPortableResource Namespace: port 8081 (Applications.Datastores, Applications.Dapr and Applications.Messaging are hosted)
- Applications.Core RP / Portable Resources' Providers (applications-rp): port 8080
- Deployment Engine: port 5017

## Prerequisites
Expand Down

0 comments on commit c6423fa

Please sign in to comment.