Skip to content
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

Changes to support Telco requirements #50

Merged
merged 29 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
261a873
Changes to support Telco requirements
abhis2112 Jul 20, 2023
19c7a48
Telco requirements:
burhan20 Jul 27, 2023
94c463f
Optimized and reordered queries, modified info on hover over node, ad…
burhan20 Jul 28, 2023
f1f7f67
Displayed primary iface on hovering over node in non baremetal case a…
burhan20 Jul 28, 2023
45e8d7a
Merge pull request #5 from noironetworks/burhan-telco
abhis2112 Jul 28, 2023
78e1546
Showing sec links only when pod is also present and removed extra ifa…
burhan20 Aug 3, 2023
b327e51
Merge pull request #8 from noironetworks/vkaci-comments
abhis2112 Aug 3, 2023
b640dca
fixed ut failure
burhan20 Aug 4, 2023
1c2b50c
Merge pull request #9 from noironetworks/ut-failure
abhis2112 Aug 4, 2023
93fb1a1
Added more testcases for sriov and macvlan
burhan20 Aug 7, 2023
733175c
Made changes to queries so that when pod is present then only node to…
burhan20 Aug 9, 2023
781c4b2
Fixed Pod and Node topology view so that node-leaf/vm links are visib…
burhan20 Aug 10, 2023
028e6a6
Merge pull request #11 from noironetworks/sriov-macvlan-pod
abhis2112 Aug 11, 2023
d1dee47
optimized testcases
burhan20 Aug 11, 2023
b4a2a30
fixed query crash if there is no pod with primary link running on a node
burhan20 Aug 16, 2023
06bd268
Merge pull request #10 from noironetworks/testcases
abhis2112 Aug 18, 2023
33ab194
Merge pull request #12 from noironetworks/node-with-only-sec-pods
abhis2112 Aug 18, 2023
8d8465d
added ut for sriov macvlan pod in diff ns
burhan20 Aug 22, 2023
ed697b5
Merge pull request #13 from noironetworks/ut_ns
abhis2112 Aug 25, 2023
69acd6b
differentiated sriov macvlan based on primarycni field
burhan20 Sep 5, 2023
d3aa45c
Merge pull request #14 from noironetworks/primary-cni
abhis2112 Sep 5, 2023
87c3dee
added primarycni in UTs as well
burhan20 Sep 5, 2023
9a89772
Merge pull request #15 from noironetworks/ut-changes-primarycni
abhis2112 Sep 5, 2023
0d2ea31
added sec pod iface name based on int value, added pod name to pod gr…
burhan20 Sep 6, 2023
885063e
added cno check for role and role binding
burhan20 Sep 6, 2023
03c9915
Merge pull request #16 from noironetworks/pod-iface-name
abhis2112 Sep 6, 2023
0c77fcb
reverted cno check for clusterrole
burhan20 Sep 7, 2023
d0fb484
Merge pull request #17 from noironetworks/cno
abhis2112 Sep 7, 2023
7fdecf6
Resolving commentds on latest PR
abhis2112 Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ENV PATH "$PATH:/app"
COPY requirements.txt requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing g++ gcc make && pip3 install -r requirements.txt
COPY . .
RUN chmod +x /app/*
RUN chmod +x /app/*
361 changes: 318 additions & 43 deletions app/graph.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions app/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# PyACI requires to have the MetaData present locally. Since the metada changes depending on the APIC version I use an init container to pull it.
# No you can't put it in the same container as the moment you try to import pyaci it crashed is the metadata is not there. Plus init containers are cool!
Expand All @@ -24,6 +25,7 @@

url = "https://" + os.environ.get("APIC_IPS").split(',')[0] + '/acimeta/aci-meta.json'
r = requests.get(url, verify=False, allow_redirects=True)

if os.environ.get("MODE") == "LOCAL":
open('/tmp/aci-meta-vkaci.json','wb').write(r.content)
else:
Expand Down
227 changes: 157 additions & 70 deletions app/template/assets/cui-2.0.0/js/vkaci.js

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions app/template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,22 @@
<button class="btn btn--white btn--dropdown selected view">Different Views</button>
abhis2112 marked this conversation as resolved.
Show resolved Hide resolved
<div id="selected_views" class="dropdown__menu dropdown__menu--openleft">
<a id="PodsAndNodes" onclick="draw_pods_and_nodes()">Pods & Nodes</a>
<a id="WithoutBgpPeers" onclick="draw_without_bgp_peers()">Without Bgp Peers</a>
{% if asnPresent %}
<a id="WithoutBgpPeers" onclick="draw_without_bgp_peers()">Without Bgp Peers</a>
{% endif %}
<a id="WithoutPods" onclick="draw_without_pods()">Without Pods</a>
<a id="OnlyBgpPeers" onclick="draw_only_bgp_peers()">BGP Peers</a>
{% if asnPresent %}
<a id="OnlyBgpPeers" onclick="draw_only_bgp_peers()">BGP Peers</a>
{% endif %}
{% if sriov or macvlan %}
<a id="OnlyPrimarylinks" onclick="draw_only_primary_links()">Primary Links</a>
{% if sriov %}
<a id="OnlySriovlinks" onclick="draw_only_sriov_links()">SRIOV Links</a>
{% endif %}
{% if macvlan %}
<a id="OnlyMacvlanlinks" onclick="draw_only_macvlan_links()">MacVlan Links</a>
{% endif %}
{% endif %}
<div class="dropdown__divider"></div>
<a id="All" onclick="draw_all()">View All</a>
</div>
Expand Down Expand Up @@ -271,7 +284,9 @@
<div id="selected_table" class="dropdown__menu dropdown__menu--openleft">
<a id="LeafsAndPods" onclick="table_leafs_pods()">Leafs & Pods</a>
<a id="LeafsAndNodes" onclick="table_leafs_nodes()">Leafs & Nodes</a>
<a id="BgpPeers" onclick="table_bgp_peers()">BGP Peers</a>
{% if asnPresent %}
<a id="BgpPeers" onclick="table_bgp_peers()">BGP Peers</a>
{% endif %}
<a id="Services" onclick="table_services()">Services</a>
<div class="dropdown__divider"></div>
<a id="All" onclick="table_all()">View All</a>
Expand Down
3 changes: 2 additions & 1 deletion app/visibility_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def index():
return render_template('index.html', version=__build__, env=env, pod_names=topology.get_pods(),
node_names=topology.get_nodes(), namespaces=topology.get_namespaces(),
leaf_names=topology.get_leafs(), label_names=topology.get_labels(),
asnPresent=topology.asnPresent)
asnPresent=topology.asnPresent, sriov=topology.sriov, macvlan=topology.macvlan)


@app.route('/pod_names')
def pod_names():
Expand Down
31 changes: 31 additions & 0 deletions helm/templates/nfna_clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Add permission to list the nodefabricnetworkattachments
{{- if .Values.cno }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: "{{ include "vkaci.fullname" . }}-nodefabricnetworkattachments-reader"
labels:
{{- include "vkaci.labels" . | nindent 4 }}
namespace: aci-containers-system
camrossi marked this conversation as resolved.
Show resolved Hide resolved
rules:
- apiGroups: ["aci.fabricattachment"]
resources: ["nodefabricnetworkattachments"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: "{{ include "vkaci.fullname" . }}-nodefabricnetworkattachments-binding"
labels:
{{- include "vkaci.labels" . | nindent 4 }}
namespace: aci-containers-system
subjects:
- kind: ServiceAccount
name: {{ include "vkaci.fullname" . }}
namespace: {{ .Release.Namespace }}
roleRef:
# "roleRef" specifies the binding to a Role / ClusterRole
kind: Role # this must be Role or ClusterRole
name: {{ include "vkaci.fullname" . }}-nodefabricnetworkattachments-reader # this must match the name of the Role or ClusterRole you wish to bind to
apiGroup: rbac.authorization.k8s.io
{{- end }}
4 changes: 3 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,6 @@ lldpd:
image:
repository: ghcr.io/lldpd/lldpd
tag: latest
pullPolicy: Always
pullPolicy: Always

cno: false
Loading