-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use API Server DNS Names by default when logging into VM Web Console
In certain environments, a load balancer, and therefore a virtual IP, may not be present. In these cases, rather than relying on the virtual IP to log into the VM web console, we need to instead rely on an FQDN / DNS name to login. This change plumbs the API Server DNS Names from the app platform CRD, and uses that by default to login to the VM Web Console. If no DNS Name is found, then we fall back to the previous method of using the virtual IP to login. Testing Done: Used an existing testbed - note that this setup has a load balancer already Setup steps: Deployed a VM named my-vm on test-namespace On control plane VM, changed /usr/lib/vmware-wcp/objects/PodVM-GuestCluster/30-vmop/vmop.yaml file to add rbac permissions for appplatform (since vmop tar won't load those changes) and re-applied yaml Loaded vmop tar image using make docker-build, docker save docker.io/library/vmoperator-controller:latest > vmopfqdn.tar, and deploy-wcp.sh Next, verified that web console returns API Server DNS name for login: root@localhost [ ~ ]# kubectl vsphere vm web-console my-vm -n test-namespace Successfully created a new WebConsoleRequest 'my-vm-b498r' in namespace 'test-namespace' Waiting for the above WebConsoleRequest to be processed... Web-Console URL: https://domain-1.test/vm/web-console?host=10.167.71.251&namespace=test-namespace&port=443&ticket=36fcf5b74000d104f4b3a5038381326f&uuid=77c1da1f-dbea-4bc2-af55-78303afc21d4 This URL is for one-time use and will expire at 2024-10-17T22:12:56Z (in about 2m0s)
- Loading branch information
1 parent
d107a82
commit 558b911
Showing
23 changed files
with
896 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
config/crd/external-crds/appplatform.vmware.com_supervisorproperties.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.16.1 | ||
name: supervisorproperties.appplatform.vmware.com | ||
spec: | ||
group: appplatform.vmware.com | ||
names: | ||
kind: SupervisorProperties | ||
listKind: SupervisorPropertiesList | ||
plural: supervisorproperties | ||
singular: supervisorproperty | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: SupervisorProperties is the Schema for the SupervisorProperties | ||
API | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: SupervisorPropertiesSpec defines the values of the properties | ||
requested by a Supervisor Service Package. | ||
properties: | ||
apiServerDNSNames: | ||
description: APIServerDNSNames indicates the API server DNS Names | ||
associated with the supervisor. | ||
items: | ||
type: string | ||
type: array | ||
capabilities: | ||
description: Capabilities defines the capabilities the Supervisor | ||
has. The common case of the capability is the feature supported | ||
of the vCenter. | ||
items: | ||
description: Capability defines the feature supported by the Supervisor. | ||
properties: | ||
name: | ||
description: The name of the capability. | ||
type: string | ||
value: | ||
default: false | ||
description: The value indicates if the capability is supported. | ||
type: boolean | ||
required: | ||
- name | ||
- value | ||
type: object | ||
type: array | ||
cloudVC: | ||
description: CloudVCenter indicates if the vCenter is deployed on | ||
cloud. | ||
type: boolean | ||
controlPlaneCount: | ||
description: ControlPlaneCount indicates the number of control planes | ||
enabled on the Supervisor. | ||
type: integer | ||
cpVMSize: | ||
description: ControlPlaneVMSize indicates the capacity of the Supervisor | ||
Control Plane. It's derived from Supervisor's tshirt size. | ||
enum: | ||
- TINY | ||
- SMALL | ||
- MEDIUM | ||
- LARGE | ||
type: string | ||
namespacesCLIPluginVersion: | ||
description: NamespacesCLIPluginVersion indicates the Supervisor recommended | ||
namespaces CLIPlugin CR version. | ||
type: string | ||
networkProvider: | ||
description: NetworkProvider indicates the Network Provider used on | ||
Supervisor. (e.g. NSX, nsx-vpc, or vsphere-network) | ||
type: string | ||
podVMSupported: | ||
description: PodVMSupported indicates if the Supervisor supports PodVMs. | ||
type: boolean | ||
ssoDomain: | ||
description: SSODomain indicates the name of the default SSO domain | ||
configured in vCenter. | ||
type: string | ||
stretchedSupervisor: | ||
description: StretchedSupervisor indicates if the Supervisor is enabled | ||
on a set of vSphere Zones. | ||
type: boolean | ||
tmcNamespace: | ||
description: TMCNamespace indicates the namespace used for TMC to | ||
be deployed. | ||
type: string | ||
vcPNID: | ||
description: VCenterPNID indicates the Primary Network Identifier | ||
of vCenter. | ||
type: string | ||
vcPort: | ||
description: VCenterPort indicates the port of vCenter. | ||
type: string | ||
vcPublicKeys: | ||
description: VCenterPublicKeys indicates the base64 encoded vCenter | ||
OIDC issuer, client audience and the public keys in JWKS format. | ||
type: string | ||
virtualIP: | ||
description: VirtualIP indicates the IP address of the Kubernetes | ||
LoadBalancer type service fronting the apiservers. | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: supervisor-properties-reader | ||
rules: | ||
- apiGroups: ["appplatform.vmware.com"] | ||
resources: ["supervisorproperties"] | ||
verbs: ["get", "list"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: supervisor-properties-reader-binding | ||
roleRef: | ||
name: supervisor-properties-reader | ||
kind: ClusterRole | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: vmware-system-vmop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.