Documentation
¶
Index ¶
- Constants
- func CreateSession(cmd string, args ...string) *executor.SessionConfig
- type Certificate
- type Connection
- type Contacts
- type Container
- type CustomerExperienceImprovementProgram
- type Network
- type PatternToken
- type RawCertificate
- type Registry
- type Resources
- type Storage
- type VirtualContainerHostConfigSpec
- func (t *VirtualContainerHostConfigSpec) AddComponent(name string, component *executor.SessionConfig)
- func (t *VirtualContainerHostConfigSpec) AddComputeResource(pool *types.ManagedObjectReference)
- func (t *VirtualContainerHostConfigSpec) AddContainerNetwork(net *executor.ContainerNetwork)
- func (t *VirtualContainerHostConfigSpec) AddImageStore(url *url.URL)
- func (t *VirtualContainerHostConfigSpec) AddNetwork(net *executor.NetworkEndpoint)
- func (t *VirtualContainerHostConfigSpec) AddVolumeLocation(name string, u *url.URL)
- func (t *VirtualContainerHostConfigSpec) ClearGrantPerms()
- func (t *VirtualContainerHostConfigSpec) IsCreating() bool
- func (t *VirtualContainerHostConfigSpec) SetDebug(level int)
- func (t *VirtualContainerHostConfigSpec) SetGrantPerms()
- func (t *VirtualContainerHostConfigSpec) SetHostCertificate(key *[]byte)
- func (t *VirtualContainerHostConfigSpec) SetIsCreating(creating bool)
- func (t *VirtualContainerHostConfigSpec) SetMoref(moref *types.ManagedObjectReference)
- func (t *VirtualContainerHostConfigSpec) SetName(name string)
- func (t *VirtualContainerHostConfigSpec) ShouldGrantPerms() bool
Constants ¶
const ( // VM is the VM name - i.e. [ds] {vm}/{vm}.vmx VMToken PatternToken = "{vm}" // ID is the container ID for the VM IDToken PatternToken = "{id}" // Name is the container name of the VM NameToken PatternToken = "{name}" // The default naming pattern that gets applied if no convention is supplied DefaultNamePattern = "{name}-{id}" // ID represents the VCH in creating status, which helps to identify VCH VM which still does not have a valid VM moref set CreatingVCH = "CreatingVCH" PublicNetworkName = "public" ClientNetworkName = "client" ManagementNetworkName = "management" PersonaService = "docker-personality" PortLayerService = "port-layer" VicAdminService = "vicadmin" GeneralHTTPProxy = "HTTP_PROXY" GeneralHTTPSProxy = "HTTPS_PROXY" VICAdminHTTPProxy = "VICADMIN_HTTP_PROXY" VICAdminHTTPSProxy = "VICADMIN_HTTPS_PROXY" AddPerms = "ADD" )
Variables ¶
This section is empty.
Functions ¶
func CreateSession ¶
func CreateSession(cmd string, args ...string) *executor.SessionConfig
Types ¶
type Certificate ¶
type Certificate struct {
// Certificates for user authentication - this needs to be expanded to allow for directory server auth
UserCertificates []*RawCertificate
// Certificates for general outgoing network access, keyed by CIDR (IPNet.String())
NetworkCertificates map[string]*RawCertificate
// The certificate used to validate the appliance to clients
HostCertificate *RawCertificate `vic:"0.1" scope:"read-only"`
// The CAs to validate client connections
CertificateAuthorities []byte `vic:"0.1" scope:"read-only"`
// The CAs to validate docker registry connections
RegistryCertificateAuthorities []byte `vic:"0.1" scope:"read-only"`
// Certificates for specific system access, keyed by FQDN
HostCertificates map[string]*RawCertificate
}
type Connection ¶
type Connection struct {
// The sdk URL
Target string `vic:"0.1" scope:"read-only" key:"target"`
// Username for target login
Username string `vic:"0.1" scope:"read-only" key:"username"`
// Token is an SSO token or password
Token string `vic:"0.1" scope:"secret" key:"token"`
// TargetThumbprint is the SHA-1 digest of the Target's public certificate
TargetThumbprint string `vic:"0.1" scope:"read-only" key:"target_thumbprint"`
// The session timeout
Keepalive time.Duration `vic:"0.1" scope:"read-only" key:"keepalive"`
}
Connection holds the vSphere connection configuration
type Contacts ¶
type Container ¶
type Container struct {
// Default containerVM capacity
ContainerVMSize Resources `vic:"0.1" scope:"read-only" recurse:"depth=0"`
// Resource pools under which all containers will be created
ComputeResources []types.ManagedObjectReference `vic:"0.1" scope:"read-only"`
// Path of the ISO to use for bootstrapping containers
BootstrapImagePath string `vic:"0.1" scope:"read-only" key:"bootstrap_image_path"`
// Allow custom naming convention for containerVMs
ContainerNameConvention string
// Whether to create and manage a DRS VM Group for the VCH and its containerVMs
UseVMGroup bool
// Name to use for the DRS VM Group
VMGroupName string
// Permitted datastore URLs for container storage for this virtual container host
ContainerStores []url.URL `vic:"0.1" scope:"read-only" recurse:"depth=0"`
}
ContainerConfig holds the container configuration for a virtual container host
type CustomerExperienceImprovementProgram ¶
type CustomerExperienceImprovementProgram struct {
// The server target is as follows, where the uuid is the raw number, no dashes
// "https://vcsa.vmware.com/ph-stg/api/hyper/send?_v=1.0&_c=vic.1_0&_i="+vc.uuid
// If this is non-nil then it's enabled
CEIPGateway url.URL
}
CustomerExperienceImprovementProgram provides configuration for the phone home mechanism This is broken out so that we can have more granular configuration in here in the future and so that it is insulated from changes to Virtual Container Host structure
type Network ¶
type Network struct {
// The network to use by default to provide access to the world
BridgeNetwork string `vic:"0.1" scope:"read-only" key:"bridge_network"`
// Published networks available for containers to join, keyed by consumption name
ContainerNetworks map[string]*executor.ContainerNetwork `vic:"0.1" scope:"read-only" key:"container_networks"`
// The IP range for the bridge networks
BridgeIPRange *net.IPNet `vic:"0.1" scope:"read-only" key:"bridge-ip-range"`
// The width of each new bridge network
BridgeNetworkWidth *net.IPMask `vic:"0.1" scope:"read-only" key:"bridge-net-width"`
}
NetworkConfig defines the network configuration of virtual container host
type PatternToken ¶
type PatternToken string
PatternToken is a set of tokens that can be placed into string constants for containerVMs that will be replaced with the specific values
func (PatternToken) String ¶
func (p PatternToken) String() string
type RawCertificate ¶
RawCertificate is present until we add extraconfig support for [][]byte slices that are present in tls.Certificate
func (*RawCertificate) Certificate ¶
func (t *RawCertificate) Certificate() (*tls.Certificate, error)
func (*RawCertificate) IsNil ¶
func (t *RawCertificate) IsNil() bool
func (*RawCertificate) X509Certificate ¶
func (t *RawCertificate) X509Certificate() (*x509.Certificate, error)
type Registry ¶
type Registry struct {
// Whitelist of registries
RegistryWhitelist []string `vic:"0.1" scope:"read-only" key:"whitelist_registries"`
// Blacklist of registries
RegistryBlacklist []string `vic:"0.1" scope:"read-only" recurse:"depth=0"`
// Insecure registries
InsecureRegistries []string `vic:"0.1" scope:"read-only" key:"insecure_registries"`
}
RegistryConfig defines the registries virtual container host can talk to
type Resources ¶
type Resources struct {
CPU types.ResourceAllocationInfo
Memory types.ResourceAllocationInfo
IO types.ResourceAllocationInfo
Storage types.ResourceAllocationInfo
}
Resources is used instead of the ResourceAllocation structs in govmomi as those don't currently hold IO or storage related data.
type Storage ¶
type Storage struct {
// Datastore URLs for image stores - the top layer is [0], the bottom layer is [len-1]
ImageStores []url.URL `vic:"0.1" scope:"read-only" key:"image_stores"`
// Permitted datastore URL roots for volumes
// Keyed by the volume store name (which is used by the docker user to
// refer to the datstore + path), valued by the datastores and the path.
VolumeLocations map[string]*url.URL `vic:"0.1" scope:"read-only"`
// default size for root image
ScratchSize int64 `vic:"0.1" scope:"read-only" key:"scratch_size"`
}
StorageConfig defines the storage configuration including images and volumes
type VirtualContainerHostConfigSpec ¶
type VirtualContainerHostConfigSpec struct {
// The base config for the appliance. This includes the networks that are to be attached
// and disks to be mounted.
// Networks are keyed by interface name
executor.ExecutorConfig `vic:"0.1" scope:"read-only" key:"init"`
// vSphere connection configuration
Connection `vic:"0.1" scope:"read-only" key:"connect"`
// basic contact information
Contacts `vic:"0.1" scope:"read-only" key:"contact"`
// certificate configuration, for both inbound and outbound access
Certificate `vic:"0.1" scope:"read-only" key:"cert"`
// Port Layer - storage
Storage `vic:"0.1" scope:"read-only" key:"storage"`
// Port Layer - network
Network `vic:"0.1" scope:"read-only" key:"network"`
// Port Layer - exec
Container `vic:"0.1" scope:"read-only" key:"container"`
// Registry configuration for Imagec
Registry `vic:"0.1" scope:"read-only" key:"registry"`
// configuration for vic-machine
CreateBridgeNetwork bool `vic:"0.1" scope:"read-only" key:"create_bridge_network"`
// grant ops-user permissions, string instead of bool for future enhancements
GrantPermsLevel string `vic:"0.1" scope:"read-only" key:"grant_permissions"`
// vic-machine create options used to create or reconfigure the VCH
VicMachineCreateOptions []string `vic:"0.1" scope:"read-only" key:"vic_machine_create_options"`
}
VirtualContainerHostConfigSpec holds the metadata for a Virtual Container Host that should be visible inside the appliance VM.
func (*VirtualContainerHostConfigSpec) AddComponent ¶
func (t *VirtualContainerHostConfigSpec) AddComponent(name string, component *executor.SessionConfig)
func (*VirtualContainerHostConfigSpec) AddComputeResource ¶
func (t *VirtualContainerHostConfigSpec) AddComputeResource(pool *types.ManagedObjectReference)
AddComputeResource adds a moref to the set of permitted root pools. It takes a ResourcePool rather than an inventory path to encourage validation.
func (*VirtualContainerHostConfigSpec) AddContainerNetwork ¶
func (t *VirtualContainerHostConfigSpec) AddContainerNetwork(net *executor.ContainerNetwork)
AddContainerNetwork adds a network that will be configured on the appliance VM
func (*VirtualContainerHostConfigSpec) AddImageStore ¶
func (t *VirtualContainerHostConfigSpec) AddImageStore(url *url.URL)
func (*VirtualContainerHostConfigSpec) AddNetwork ¶
func (t *VirtualContainerHostConfigSpec) AddNetwork(net *executor.NetworkEndpoint)
AddNetwork adds a network that will be configured on the appliance VM
func (*VirtualContainerHostConfigSpec) AddVolumeLocation ¶
func (t *VirtualContainerHostConfigSpec) AddVolumeLocation(name string, u *url.URL)
func (*VirtualContainerHostConfigSpec) ClearGrantPerms ¶
func (t *VirtualContainerHostConfigSpec) ClearGrantPerms()
func (*VirtualContainerHostConfigSpec) IsCreating ¶
func (t *VirtualContainerHostConfigSpec) IsCreating() bool
IsCreating is checking if this configuration is for one creating VCH VM
func (*VirtualContainerHostConfigSpec) SetDebug ¶
func (t *VirtualContainerHostConfigSpec) SetDebug(level int)
SetDebug configures the debug logging level for the VCH
func (*VirtualContainerHostConfigSpec) SetGrantPerms ¶
func (t *VirtualContainerHostConfigSpec) SetGrantPerms()
func (*VirtualContainerHostConfigSpec) SetHostCertificate ¶
func (t *VirtualContainerHostConfigSpec) SetHostCertificate(key *[]byte)
SetHostCertificate sets the certificate for authenticting with the appliance itself
func (*VirtualContainerHostConfigSpec) SetIsCreating ¶
func (t *VirtualContainerHostConfigSpec) SetIsCreating(creating bool)
SetIsCreating sets the ID of the VCH to a constant if creating is true, to identify the creating VCH VM before the VM moref can be set into this property Reset the property back to empty string if creating is false
func (*VirtualContainerHostConfigSpec) SetMoref ¶
func (t *VirtualContainerHostConfigSpec) SetMoref(moref *types.ManagedObjectReference)
SetMoref sets the moref of the VCH - this allows components to acquire a handle to the appliance VM.
func (*VirtualContainerHostConfigSpec) SetName ¶
func (t *VirtualContainerHostConfigSpec) SetName(name string)
SetName sets the name of the VCH - this will be used as the hostname for the appliance
func (*VirtualContainerHostConfigSpec) ShouldGrantPerms ¶
func (t *VirtualContainerHostConfigSpec) ShouldGrantPerms() bool
Source Files
¶
- virtual_container_host.go