Skip to content

Commit

Permalink
Merge branch 'main' of github.com:keyval-dev/odigos into gen-2294-odi…
Browse files Browse the repository at this point in the history
…gos-set-config-command
  • Loading branch information
alonbraymok committed Jan 29, 2025
2 parents 610293f + 7af8d56 commit 28e1837
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var (
userInputIgnoredContainers []string
userInputInstallProfiles []string
uiMode string
centralBackendURL string

instrumentorImage string
odigletImage string
Expand Down Expand Up @@ -236,6 +237,7 @@ func createOdigosConfig(odigosTier common.OdigosTier) common.OdigosConfiguration
AutoscalerImage: autoScalerImage,
Profiles: selectedProfiles,
UiMode: common.UiMode(uiMode),
CentralBackendURL: centralBackendURL,
}
}

Expand Down Expand Up @@ -267,6 +269,7 @@ func init() {
installCmd.Flags().StringSliceVar(&userInputIgnoredContainers, "ignore-container", k8sconsts.DefaultIgnoredContainers, "container names to exclude from instrumentation (useful for sidecar container)")
installCmd.Flags().StringSliceVar(&userInputInstallProfiles, "profile", []string{}, "install preset profiles with a specific configuration")
installCmd.Flags().StringVarP(&uiMode, "ui-mode", "", string(common.NormalUiMode), "set the UI mode (one-of: normal, readonly)")
installCmd.Flags().StringVar(&centralBackendURL, "central-backend-url", "", "URL for centralized Odigos backend")

if OdigosVersion != "" {
versionFlag = OdigosVersion
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In this doc, we'll keep track of the permissions requested across different reso
| UI | apps | deployments, statefulsets, daemonsets | \* | get, list | Needed to get workloads. |
| UI | apps | replicasets | \* | get, list | Needed for describing application and resource relationships. |
| UI | odigos.io | instrumentationconfigs, instrumentationinstances | \* | get, list, watch | Monitors and retrieves configurations for instrumentation. |
| UI | odigos.io | sources | \* | get, list, create, delete | Manages sources for instrumentation and monitoring. |
| UI | odigos.io | sources | \* | get, list, create, patch, delete | Manages sources for instrumentation. Patch is needed to update service name. |
| UI | actions.odigos.io | \* | \* | get, list, create, patch, update, delete | Handles pipeline actions for custom logic. |

---
Expand Down
5 changes: 3 additions & 2 deletions cli/cmd/resources/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,11 @@ func NewUIClusterRole(readonly bool) *rbacv1.ClusterRole {
Resources: []string{"instrumentationconfigs", "instrumentationinstances"},
Verbs: []string{"get", "list", "watch"},
},
{ // Needed to instrument / uninstrument sources
{ // Needed to instrument / uninstrument sources.
// Patch is needed to update service name.
APIGroups: []string{"odigos.io"},
Resources: []string{"sources"},
Verbs: []string{"get", "list", "create", "delete"},
Verbs: []string{"get", "list", "create", "patch", "delete"},
},
}
}
Expand Down
1 change: 1 addition & 0 deletions common/odigos_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ type OdigosConfiguration struct {
Profiles []ProfileName `json:"profiles,omitempty"`
AllowConcurrentAgents *bool `json:"allowConcurrentAgents,omitempty"`
UiMode UiMode `json:"uiMode,omitempty"`
CentralBackendURL string `json:"centralBackendURL,omitempty"`
}
1 change: 1 addition & 0 deletions docs/cli/odigos_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ odigos install --onprem-token ${ODIGOS_TOKEN} --profile ${YOUR_ENTERPRISE_PROFIL
```
-k, --api-key string api key for odigos cloud
--autoscaler-image string autoscaler container image name (default "keyval/odigos-autoscaler")
--central-backend-url string URL for centralized Odigos backend
-h, --help help for install
--ignore-container strings container names to exclude from instrumentation (useful for sidecar container) (default [istio-proxy,vault-agent,filebeat,linkerd-proxy,fluentd,akeyless-init])
--ignore-namespace strings namespaces not to show in odigos ui (default [kube-system,local-path-storage,istio-system,linkerd,kube-node-lease])
Expand Down
6 changes: 3 additions & 3 deletions frontend/webapp/cypress/e2e/03-sources.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ describe('Sources CRUD', () => {
getCrdIds({ namespace, crdName, expectedError: '', expectedLength: 5 }, (crdIds) => {
const crdId = CRD_IDS.SOURCE;
expect(crdIds).includes(crdId);
// awaitToast({ withSSE: false, message: TEXTS.NOTIF_SOURCES_UPDATED(1) }, () => {
// getCrdById({ namespace, crdName, crdId, expectedError: '', expectedKey: 'serviceName', expectedValue: TEXTS.UPDATED_NAME });
// });
awaitToast({ withSSE: false, message: TEXTS.NOTIF_SOURCES_UPDATED(1) }, () => {
getCrdById({ namespace, crdName, crdId, expectedError: '', expectedKey: 'serviceName', expectedValue: TEXTS.UPDATED_NAME });
});
});
});
},
Expand Down
3 changes: 3 additions & 0 deletions helm/odigos/templates/odigos-config-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ data:
{{- if .Values.ui.uiMode }}
uiMode: {{ .Values.ui.uiMode }}
{{- end }}
{{- if .Values.ui.centralBackendURL }}
centralBackendURL: {{ .Values.ui.centralBackendURL }}
{{- end }}
{{- if .Values.collectorGateway }}
collectorGateway:
{{- with .Values.collectorGateway.minReplicas }}
Expand Down
1 change: 1 addition & 0 deletions helm/odigos/templates/ui/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ rules:
- get
- list
{{- if ne .Values.ui.uiMode "readonly" }}
- patch
- create
- delete
{{- end }}
2 changes: 1 addition & 1 deletion helm/odigos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ ui:
# - Setting this to "readonly" will disable the ability to create, update, or delete objects in the UI.
# - If not set, the UI will be in normal mode.
uiMode: 'normal'
centralBackendURL: ''

instrumentor:
deleteLangDetectionPods: true
Expand Down Expand Up @@ -176,4 +177,3 @@ gke:
enabled: false

profiles: []

0 comments on commit 28e1837

Please sign in to comment.