aci

package
v0.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

README

Azure ACI

The Azure ACI plugin deploys a container to Azure Container Instances.

Components

  1. Platform
  1. Docker

Documentation

Overview

Package aci contains components for deploying to Azure ACI.

Index

Constants

This section is empty.

Variables

View Source
var File_waypoint_builtin_azure_aci_plugin_proto protoreflect.FileDescriptor
View Source
var Options = []sdk.Option{
	sdk.WithComponents(&Platform{}),
}

Options are the SDK options to use for instantiation for the Azure ACI plugin.

Functions

This section is empty.

Types

type AzureFileShareVolume

type AzureFileShareVolume struct {
	// Name of the FileShare in Azure storage
	Name string `hcl:"name,attr"`
	// Storage account name
	StorageAccountName string `hcl:"storage_account_name,attr"`
	// Storage account key to access the storage
	StorageAccountKey string `hcl:"storage_account_key,attr"`
}

AzureFileShareVolume allows you to mount an Azure container storage fileshare into the container

type Capacity

type Capacity struct {
	// Memory to allocate to the container specified in MB, min 512, max 16384.
	// Default value of 0 sets memory to 1536MB which is default container instance value
	Memory int `hcl:"memory,attr" validate:"eq=0|gte=512,lte=16384"`
	// CPUCount is the number CPUs to allocate to a container instance
	CPUCount int `hcl:"cpu_count,attr" validate:"gte=0,lte=4"`
}

type Config

type Config struct {
	// ResourceGroup is the resource group to deploy to.
	ResourceGroup string `hcl:"resource_group,attr"`

	// Region to deploy the container instance to
	Location string `hcl:"location,optional"`

	// Azure subscription id, if not set plugin will attempt to use the environment variable
	// AZURE_SUBSCRIPTION_ID
	SubscriptionID string `hcl:"subscription_id,optional"`

	// ManagedIdentity assigned to the container group
	// use managed identity to enable containers to access other
	// Azure resources
	// (https://docs.microsoft.com/en-us/azure/container-instances/container-instances-managed-identity#:~:text=Enable%20a%20managed%20identity&text=Azure%20Container%20Instances%20supports%20both,or%20both%20types%20of%20identities.)
	// Note: ManagedIdentity can not be used to authorize Container Instances to pull from private Container registries in Azure
	ManagedIdentity string `hcl:"managed_identity,optional"`

	// Port the applications is listening on.
	Ports []int `hcl:"ports,optional"`

	// Environment variables that are meant to configure the application in a static
	// way. This might be control an image that has multiple modes of operation,
	// selected via environment variable. Most configuration should use the waypoint
	// config commands.
	StaticEnvVars map[string]string `hcl:"static_environment,optional"`

	// Capacity details for cloud run container.
	Capacity *Capacity `hcl:"capacity,block"`

	Volumes []Volume `hcl:"volume,block" validate:"dive"`
}

Config is the configuration structure for the Platform. In addition to HCL defined configuration the following environment variables are also valid AZURE_SUBSCRIPTION_ID = Subscription ID for your Azure account [required] REGISTRY_USERNAME = Username for container registry, required when using a private registry REGISTRY_PASSWORD = Password for container registry, required when using a private registry

type Deployment

type Deployment struct {
	Url            string                     `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Id             string                     `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	ContainerGroup *Deployment_ContainerGroup `protobuf:"bytes,3,opt,name=container_group,json=containerGroup,proto3" json:"container_group,omitempty"`
	// contains filtered or unexported fields
}

func (*Deployment) Descriptor deprecated

func (*Deployment) Descriptor() ([]byte, []int)

Deprecated: Use Deployment.ProtoReflect.Descriptor instead.

func (*Deployment) GetContainerGroup

func (x *Deployment) GetContainerGroup() *Deployment_ContainerGroup

func (*Deployment) GetId

func (x *Deployment) GetId() string

func (*Deployment) GetUrl

func (x *Deployment) GetUrl() string

func (*Deployment) ProtoMessage

func (*Deployment) ProtoMessage()

func (*Deployment) ProtoReflect

func (x *Deployment) ProtoReflect() protoreflect.Message

func (*Deployment) Reset

func (x *Deployment) Reset()

func (*Deployment) String

func (x *Deployment) String() string

type Deployment_ContainerGroup

type Deployment_ContainerGroup struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	ResourceGroup  string `protobuf:"bytes,2,opt,name=resource_group,json=resourceGroup,proto3" json:"resource_group,omitempty"`
	SubscriptionId string `protobuf:"bytes,3,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Deployment_ContainerGroup) Descriptor deprecated

func (*Deployment_ContainerGroup) Descriptor() ([]byte, []int)

Deprecated: Use Deployment_ContainerGroup.ProtoReflect.Descriptor instead.

func (*Deployment_ContainerGroup) GetName

func (x *Deployment_ContainerGroup) GetName() string

func (*Deployment_ContainerGroup) GetResourceGroup

func (x *Deployment_ContainerGroup) GetResourceGroup() string

func (*Deployment_ContainerGroup) GetSubscriptionId

func (x *Deployment_ContainerGroup) GetSubscriptionId() string

func (*Deployment_ContainerGroup) ProtoMessage

func (*Deployment_ContainerGroup) ProtoMessage()

func (*Deployment_ContainerGroup) ProtoReflect

func (*Deployment_ContainerGroup) Reset

func (x *Deployment_ContainerGroup) Reset()

func (*Deployment_ContainerGroup) String

func (x *Deployment_ContainerGroup) String() string

type GitRepoVolume

type GitRepoVolume struct {
	// GitHub repository to mount as a volume
	Repository string `hcl:"repository,attr" validate:"url"`
	// Branch, Tag or Commit SHA
	Revision string `hcl:"revision,optional"`
	// Directory name to checkout repo to, defaults to repository name
	Directory string `hcl:"directory,optional"`
}

GitRepoVolume allows the mounting of a Git repository into the container

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

Platform is the Platform implementation for Azure ACI.

func (*Platform) Config

func (p *Platform) Config() (interface{}, error)

Config implements Configurable

func (*Platform) ConfigSet

func (p *Platform) ConfigSet(config interface{}) error

ConfigSet is called after a configuration has been decoded we can use this to validate the config

func (*Platform) Deploy

func (p *Platform) Deploy(
	ctx context.Context,
	log hclog.Logger,
	src *component.Source,
	img *docker.Image,
	deployConfig *component.DeploymentConfig,
	ui terminal.UI,
) (*Deployment, error)

Deploy deploys an image to ACI.

func (*Platform) DeployFunc

func (p *Platform) DeployFunc() interface{}

DeployFunc implements component.Platform

func (*Platform) Documentation

func (p *Platform) Documentation() (*docs.Documentation, error)

type RegistryCredentials

type RegistryCredentials struct {
	Username string `hcl:"username"`
	Password string `hcl:"password"`
}

RegistryCredentials are the user credentials needed to authenticate with a container registry.

type Release

type Release struct {
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*Release) Descriptor deprecated

func (*Release) Descriptor() ([]byte, []int)

Deprecated: Use Release.ProtoReflect.Descriptor instead.

func (*Release) GetUrl

func (x *Release) GetUrl() string

func (*Release) ProtoMessage

func (*Release) ProtoMessage()

func (*Release) ProtoReflect

func (x *Release) ProtoReflect() protoreflect.Message

func (*Release) Reset

func (x *Release) Reset()

func (*Release) String

func (x *Release) String() string

type Volume

type Volume struct {
	// Name of the Volume to mount
	Name string `hcl:"name,attr"`
	// Filepath where the volume will be mounted in the container
	Path string `hcl:"path,attr"`
	// Is the volume read only?
	ReadOnly bool `hcl:"read_only,attr"`
	// Details for  an Azure file share volume
	AzureFileShare *AzureFileShareVolume `hcl:"azure_file_share,block"`
	// Details for  an GitHub repo volume
	GitRepoVolume *GitRepoVolume `hcl:"git_repo,block"`
}

Volume defines a volume mount for the container. Supported types are Azure file share or GitHub repository Only one type can be set

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL