Skip to content

Commit

Permalink
remove observability (#2684)
Browse files Browse the repository at this point in the history
* removed observability

* bump deployment

---------

Co-authored-by: Mateusz Wisniewski <mwisnia97@gmail.com>
  • Loading branch information
chriskari and mrCherry97 authored Dec 15, 2023
1 parent 0f9c79e commit 0f335c4
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 92 deletions.
3 changes: 1 addition & 2 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ COPY --from=builder /app/backend/settings/* /app/settings/
RUN npm ci --only=production

# use sessionStorage as default
# enable OBSERVABILITY & SHOW_KYMA_VERSION for production
RUN yq eval -i '.config.features.OBSERVABILITY.isEnabled = true' core-ui/defaultConfig.yaml
# SHOW_KYMA_VERSION for production
RUN yq eval -i '.config.features.SHOW_KYMA_VERSION.isEnabled = true' core-ui/defaultConfig.yaml
RUN yq eval -i '.config.defaultStorage = "sessionStorage"' core-ui/defaultConfig.yaml

Expand Down
14 changes: 0 additions & 14 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,6 @@ HIDDEN_NAMESPACES:

The link under the given key is selected based on your language code (de, en, pl, etc.). If the code is not available, the default link is used.

* **OBSERVABILITY** – is used to render nodes in the navigation. The **label** parameter shows the name of the given service. The **path** parameter is used by Busola during the bootstrapping. Busola sends a request to the cluster address. The **path** value and the cluster must return the VirtualService object. If the object is found, you receive an address to which the node in the navigation leads.

Defualt settings:

```yaml
OBSERVABILITY:
isEnabled: true
config:
links:
- label: Grafana
path: >-
apis/networking.istio.io/v1beta1/namespaces/kyma-system/virtualservices/monitoring-grafana
```

* **PROTECTED_RESOURCES** – is used to block the edit and delete functions based on the determined rules. If the resource meets the rule requirements, the resource becomes protected and cannot be edited/deleted.

Each resource requires the **match** field, which includes a list of key-value pairs. The proper rule description is when the definition given in the key matches the value.
Expand Down
6 changes: 0 additions & 6 deletions public/defaultConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ config:
selectors: []
config:
dsn: ''
OBSERVABILITY:
isEnabled: false
config:
links:
- label: Grafana
path: apis/networking.istio.io/v1beta1/namespaces/kyma-system/virtualservices/monitoring-grafana
EXTERNAL_NODES:
isEnabled: false
stage: SECONDARY
Expand Down
2 changes: 0 additions & 2 deletions public/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,6 @@ nodes:
name_singular: Node
title: Nodes
title_details: Node {{nodeName}}
observability:
title: Observability
persistent-volume-claims:
description: <0>PersistentVolumeClaim (PVC)</0> is a request for the PersistentVolume resources.
headers:
Expand Down
12 changes: 0 additions & 12 deletions resources/web/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ data:
"dsn": ""
}
},
"OBSERVABILITY": {
"isEnabled": true,
"stage": "SECONDARY",
"config": {
"links": [
{
"label": "Grafana",
"path": "apis/networking.istio.io/v1beta1/namespaces/kyma-system/virtualservices/monitoring-grafana"
}
]
}
},
"KUBECONFIG_ID": {
"config": {
"kubeconfigUrl": "/kubeconfig"
Expand Down
2 changes: 1 addition & 1 deletion resources/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: busola
image: europe-docker.pkg.dev/kyma-project/dev/busola-web:PR-2691
image: europe-docker.pkg.dev/kyma-project/dev/busola-web:PR-2684
imagePullPolicy: Always
resources:
requests:
Expand Down
7 changes: 0 additions & 7 deletions src/state/navigation/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const predefinedCategories = {
apps: 'Apps',
configuration: 'Configuration',
integration: 'Integration',
observability: 'Observability',
} as const;

export type Category = {
Expand Down Expand Up @@ -71,10 +70,4 @@ export const CATEGORIES: Category[] = [
label: 'integration.title',
items: [],
},
{
key: predefinedCategories.observability,
icon: 'stethoscope',
label: 'observability.title',
items: [],
},
];
47 changes: 3 additions & 44 deletions src/state/navigation/externalNodesSelector.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { RecoilValueReadOnly, selector } from 'recoil';
import { configurationAtom } from '../configuration/configurationAtom';
import { predefinedCategories } from './categories';
import { ConfigFeature, configFeaturesNames, NavNode } from '../types';
import { getFetchFn } from '../utils/getFetchFn';
import { FetchFn } from '../../shared/hooks/BackendAPI/useFetch';

const createExternalNode = (
url: string,
label: string,
category?: string,
category: string,
icon?: string,
): NavNode => ({
resourceType: '',
category: category || predefinedCategories.observability,
category: category,
icon: icon,
namespaced: false,
label: label,
Expand All @@ -23,30 +21,6 @@ const createExternalNode = (
externalUrl: url.startsWith('http') ? url : `https://${url}`,
});

const getObservabilityNodes = async (
fetchFn: FetchFn,
observabilityFeature: ConfigFeature | undefined,
): Promise<NavNode[]> => {
if (!observabilityFeature?.isEnabled) {
return [];
}

const links = observabilityFeature!.config?.links || [];

return await Promise.all(
links.map(async ({ label, path }: { label: string; path: string }) => {
try {
const url = await fetchObservabilityHost(fetchFn, path);
return createExternalNode(url, label);
} catch (e) {
//this error is caught to not reach the ErrorBoundary component
console.error('Cannot fetch an observability link: ', e);
return null;
}
}),
);
};

const getExternalNodes = (
externalNodesFeature: ConfigFeature | undefined,
): NavNode[] => {
Expand Down Expand Up @@ -86,25 +60,10 @@ export const externalNodesSelector: RecoilValueReadOnly<
return [];
}

const observabilityNodes = await getObservabilityNodes(
fetchFn,
features[configFeaturesNames.OBSERVABILITY],
);
const externalNodes = getExternalNodes(
features[configFeaturesNames.EXTERNAL_NODES],
);

return [
...observabilityNodes.filter(n => n),
...externalNodes.filter(n => n),
];
return [...externalNodes.filter(n => n)];
},
});

async function fetchObservabilityHost(fetchFn: FetchFn, vsPath: string) {
const res = await fetchFn({
relativeUrl: '/' + vsPath,
init: {},
});
return (await res.json()).spec.hosts[0];
}
6 changes: 3 additions & 3 deletions src/state/navigation/sidebarNavigationNodesSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export const sidebarNavigationNodesSelector: RecoilValueReadOnly<Category[]> = s
get: ({ get }) => {
const navNodes: NavNode[] = get(clusterAndNsNodesSelector);
const activeNamespaceId = get(activeNamespaceIdState);
const observabilityNodes = get(externalNodesSelector);
const externalNodes = get(externalNodesSelector);
const configuration = get(configurationAtom);
const features = configuration?.features;

const scope: Scope = activeNamespaceId ? 'namespace' : 'cluster';
if (!navNodes || !observabilityNodes) {
if (!navNodes || !externalNodes) {
return [];
}
let allNodes = [...navNodes, ...observabilityNodes];
let allNodes = [...navNodes, ...externalNodes];

const extResources = get(extensionsState);
const isExtensibilityOn = features?.EXTENSIBILITY?.isEnabled;
Expand Down
1 change: 0 additions & 1 deletion src/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const configFeaturesNames = {
GET_HELP_LINKS: 'GET_HELP_LINKS',
SENTRY: 'SENTRY',
KUBECONFIG_ID: 'KUBECONFIG_ID',
OBSERVABILITY: 'OBSERVABILITY',
HIDDEN_NAMESPACES: 'HIDDEN_NAMESPACES',
VISUAL_RESOURCES: 'VISUAL_RESOURCES',
EXTENSIBILITY: 'EXTENSIBILITY',
Expand Down

0 comments on commit 0f335c4

Please sign in to comment.