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

WIP MGMT-9754 Static IPs #586

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
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
6904326
Share prod manifests in the UI dev-env deployment script
mareklibra Oct 5, 2022
61051bb
MGMT-12187 Hide iframe Logout error
mareklibra Oct 6, 2022
c2d1d61
MGMT-12187 Block progress on authentication reconciliation start
mareklibra Oct 6, 2022
f09f0b7
Fix kubeadmin logout redirect
mareklibra Oct 11, 2022
d8b4b93
Clean-up
mareklibra Oct 11, 2022
5753ece
Update UI dev dependencies
mareklibra Oct 17, 2022
c369d1a
Depracate existing UI components
mareklibra Oct 17, 2022
6734d26
Fix UI dev deployment scripts
mareklibra Oct 17, 2022
0f2fe00
MGMT-12274: Redesign UI - basic structure
mareklibra Oct 17, 2022
ca9126f
IngressPage
mareklibra Oct 17, 2022
f23ed1a
Save In Progress page
mareklibra Oct 18, 2022
6905681
Optimize for narrow screens
mareklibra Oct 18, 2022
4f5201f
Stub all pages
mareklibra Oct 18, 2022
db79f6c
Log out
mareklibra Oct 18, 2022
768239c
Add WorkingOnHybridCloud svg
mareklibra Oct 18, 2022
ac96741
Turn off eslint debugging
mareklibra Oct 19, 2022
d71a273
Add OCPConsolePage
mareklibra Oct 19, 2022
fba2ed3
Add API Page
mareklibra Oct 19, 2022
cb3dfc5
Add Settings title
mareklibra Oct 19, 2022
108ae8c
Add Credentials Page
mareklibra Oct 20, 2022
c59f1d8
Add SSH Key Page
mareklibra Oct 21, 2022
e86ac6e
Add Domain page
mareklibra Oct 21, 2022
f2a9713
Temporarily remove TCP/IP
mareklibra Oct 22, 2022
b5b43f1
Block Save on operator's reconciliation
mareklibra Oct 23, 2022
abddbdb
Add ip-address among dependencies
mareklibra Oct 24, 2022
5e0da7e
MGMT-9754 Static IPs
mareklibra Oct 24, 2022
a9cd382
wip
mareklibra Oct 24, 2022
8ebb8b7
wip
mareklibra Oct 30, 2022
2921dc6
wip
mareklibra Nov 2, 2022
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
1 change: 1 addition & 0 deletions deploy-ui/manifests/clusterrolbinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Enable creating tokenreviews
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
3 changes: 2 additions & 1 deletion ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ frontend/node_modules
frontend/coverage
frontend/src/copy-backend-common

scripts/certs
./certs
./deploy.yaml

node_modules
TODO
2 changes: 2 additions & 0 deletions ui/backend/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export const ZTPFW_DEPLOYMENT_NAME = 'ztpfw-ui';

export const ZTPFW_OAUTHCLIENT_NAME = 'ztpfwoauth';
export const ZTPFW_NAMESPACE = 'ztpfw-ui';

export const IDENTITY_PROVIDER_NAME = 'ztpfw-htpasswd-idp';
50 changes: 50 additions & 0 deletions ui/backend/src/common/resources/NodeNetworkConfigurationPolicy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { Metadata } from './metadata';
import { NNRouteConfig } from './NodeNetworkState';
import { IResource } from './resource';

export type NodeNetworkConfigurationPolicyType = 'nmstate.io/v1';
export const NodeNetworkConfigurationPolicyApiVersion: NodeNetworkConfigurationPolicyType =
'nmstate.io/v1';

export type NodeNetworkConfigurationPolicyKindType = 'NodeNetworkConfigurationPolicy';
export const NodeNetworkConfigurationPolicyKind: NodeNetworkConfigurationPolicyKindType =
'NodeNetworkConfigurationPolicy';

export type NNCPInterface = {
name: string;
state: 'up' | 'down';
type?: 'ethernet';
ipv4: {
address: {
ip: string;
'prefix-length': number;
}[];
enabled: boolean;
};
};
export interface NodeNetworkConfigurationPolicy extends IResource {
apiVersion: NodeNetworkConfigurationPolicyType;
kind: NodeNetworkConfigurationPolicyKindType;
metadata: Metadata;

spec: {
nodeSelector?: {
// kubernetes.io/hostname: ztpfw-edgecluster0-cluster-master-0
[key: string]: string;
};
desiredState: {
interfaces: NNCPInterface[];

'dns-resolver'?: {
// TODO: don't forget to set ipv4[auto-dns] to false
config: {
server: string[];
};
};

routes?: {
config?: NNRouteConfig[];
};
};
};
}
55 changes: 55 additions & 0 deletions ui/backend/src/common/resources/NodeNetworkState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Metadata } from './metadata';
import { IResource } from './resource';

export type NodeNetworkStateType = 'nmstate.io/v1beta1';
export const NodeNetworkStateApiVersion: NodeNetworkStateType = 'nmstate.io/v1beta1';

export type NodeNetworkStateKindType = 'NodeNetworkState';
export const NodeNetworkStateKind: NodeNetworkStateKindType = 'NodeNetworkState';

interface NodeNetworkStateInterface {
ipv4: {
address: {
ip: string;
'prefix-length': number;
}[];
enabled: false;
};
// ipv6: {}
type: 'ethernet' | 'anything-else-is-not-important-now';
name: string;
state: 'down' | 'up';
mtu: number;
'mac-address': string;
dhcp: boolean;
enabled: boolean;
'auto-dns': boolean;
'auto-gateway': boolean;
}

export interface NNRouteConfig {
destination: string; // subnet mask
metric: number;
'next-hop-address': string; // gateway
'next-hop-interface': string; // interface name
}

export interface NodeNetworkState extends IResource {
apiVersion: NodeNetworkStateType;
kind: NodeNetworkStateKindType;
metadata: Metadata;

status?: {
currentState?: {
'dns-resolver'?: {
running?: {
server?: string[];
};
};
interfaces?: NodeNetworkStateInterface[];
routes?: {
running?: NNRouteConfig[];
};
};
};
}
3 changes: 3 additions & 0 deletions ui/backend/src/common/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ export * from './deployment';
export * from './pod';
export * from './clusteroperator';
export * from './utils';
export * from './NodeNetworkState';
export * from './NodeNetworkConfigurationPolicy';
export * from './node';
7 changes: 7 additions & 0 deletions ui/backend/src/common/resources/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export interface OwnerReference {
apiVersion: string;
kind: string;
name: string;
uid: string;
}
export interface Metadata {
name?: string;
namespace?: string;
Expand All @@ -10,4 +16,5 @@ export interface Metadata {
deletionTimestamp?: string;
selfLink?: string;
finalizers?: string[];
ownerReferences?: OwnerReference[];
}
25 changes: 25 additions & 0 deletions ui/backend/src/common/resources/node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Metadata } from './metadata';
import { IResource } from './resource';

export type NodeType = 'v1';
export const NodeApiVersion: NodeType = 'v1';

export type NodeKindType = 'Node';
export const NodeKind: NodeKindType = 'Node';

export interface Node extends IResource {
apiVersion: NodeType;
kind: NodeKindType;
metadata: Metadata;
/*
node-role.kubernetes.io/master: ""
node-role.kubernetes.io/worker: ""
*/

status?: {
addresses?: {
address: string;
type: 'Hostname' | 'InternalIP';
}[];
};
}
8 changes: 7 additions & 1 deletion ui/backend/src/common/resources/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ export interface Service extends IResource {
selector?: Record<string, string>;
type?: string;
};
status?: unknown;
status?: {
loadBalancer?: {
ingress: {
ip?: string;
}[];
};
};
}
53 changes: 50 additions & 3 deletions ui/backend/src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,59 @@ export type TlsCertificate = {
'tls.key.filename'?: string;
};

export type CustomCertsType = {
[key: /* ~ domain */ string]: TlsCertificate;
};

export type ChangeDomainInputType = {
clusterDomain?: string;
customCerts?: {
[key: /* ~ domain */ string]: TlsCertificate;
};
customCerts?: CustomCertsType;
};

export type ValidateDomainAPIResult = { result: boolean };
export type ValidateDomainAPIInput = { domain?: string };

export type HostInterfaceType = {
name: string; // i.e. "eth0"
// type: 'ethernet' | 'bond' | 'linux-bridge';
// state: 'up' | 'down';
ipv4: {
dhcp: boolean; // "false" for static IPs
enabled: boolean; // always true otherwise not found

address?: {
// We support only one static IP per interface
ip?: string; // regular (dotted) IP form
prefixLength?: number;
validation?: string;

gateway?: string;
gatewayValidation?: string; // undefined if valid
};
};
};

export type HostType = {
nodeName: string; // metadata.name of the Node resource
hostname?: string; // kubernetes.io/hostname label in Node or nmstate spec.nodeSelector (optional)
nncpName?: string; // metadata.name of the NodeNetworkConfigurationPolicy (if exists)

role?: 'control' | 'worker'; // node-role.kubernetes.io/worker , node-role.kubernetes.io/master

interfaces: HostInterfaceType[];
dns?: string[];

dnsValidation?: string; // undefined if valid
};

/*
export type Network4Type = {
prefixLength: number;
dns?: string;
gw?: string;
};
*/

export type ChangeStaticIpsInputType = {
hosts?: HostType[];
};
Loading