Documentation ¶
Index ¶
- Constants
- Variables
- func CreateOrUpdateAppByUri(ctx context.Context, cred azcore.TokenCredential, app aadApp) (objectId string, err error)
- func CreateServicePrincipal(ctx context.Context, cred azcore.TokenCredential, appId string) (string, error)
- func GetAppByUri(ctx context.Context, cred azcore.TokenCredential, uri string) (aadApp, error)
- func GetChartSpec(helmChartConfig *HelmChartConfig, helmClient helmclient.Client, ...) (helmclient.ChartSpec, error)
- func GetDefaultApiVersionForResource(ctx context.Context, resourceId string, ...) (string, error)
- func GetDomainNameRegex(location string) *regexp.Regexp
- func GetDomainNameSuffix(location string) string
- func GetGraphToken(ctx context.Context, cred azcore.TokenCredential) (azcore.AccessToken, error)
- func GetServicePrincipalByAppId(ctx context.Context, cred azcore.TokenCredential, appId string) (string, error)
- func GetServicePrincipalDisplayName(ctx context.Context, cred azcore.TokenCredential, objectId string) (string, error)
- func GetSubscriptionId(ctx context.Context, subName string, cred azcore.TokenCredential) (string, error)
- func GetUserPrincipalName(ctx context.Context, cred azcore.TokenCredential, objectId string) (string, error)
- func NewMiAwareAzureCLICredential(options *azidentity.AzureCLICredentialOptions) (azcore.TokenCredential, error)
- func Ptr[T any](t T) *T
- func RandomAlphanumString(n int) string
- func RenderConfig(templateValues ConfigTemplateValues, writer io.Writer) error
- type ApiConfig
- type AuthConfig
- type CloudConfig
- type CloudEnvironmentConfig
- type ClusterConfig
- type ComputeConfig
- type ConfigTemplateValues
- type DatabaseConfig
- type FirewallRule
- type HelmChartConfig
- type HelmConfig
- type Installer
- func (inst *Installer) ApplyMigrations(ctx context.Context, targetVersion int, ...) error
- func (inst *Installer) CreateStorageAccount(ctx context.Context, storageAccountConfig *StorageAccountConfig, ...) (any, error)
- func (inst *Installer) GetMigrationLogs(ctx context.Context, id int, destination io.Writer) error
- func (inst *Installer) GetTygerInstallationRevision(ctx context.Context) (int, error)
- func (inst *Installer) GetUserRESTConfig(ctx context.Context) (*rest.Config, error)
- func (inst *Installer) InstallCloud(ctx context.Context) (err error)
- func (inst *Installer) InstallIdentities(ctx context.Context, cred azcore.TokenCredential) error
- func (inst *Installer) InstallTyger(ctx context.Context) error
- func (inst *Installer) InstallTygerHelmChart(ctx context.Context, dryRun bool) (manifest string, valuesYaml string, err error)
- func (inst *Installer) ListDatabaseVersions(ctx context.Context, allVersions bool) ([]install.DatabaseVersion, error)
- func (inst *Installer) PodExec(ctx context.Context, podName string, command ...string) (stdout *bytes.Buffer, stderr *bytes.Buffer, err error)
- func (inst *Installer) QuickValidateConfig() bool
- func (inst *Installer) UninstallCloud(ctx context.Context) (err error)
- func (inst *Installer) UninstallTyger(ctx context.Context, _, _ bool) error
- type NamedAzureResource
- type NodePoolConfig
- type Principal
- type PrincipalKind
- type StorageAccountConfig
- type StorageConfig
Constants ¶
View Source
const ( DefaultDatabaseComputeTier = armpostgresqlflexibleservers.SKUTierBurstable DefaultDatabaseVMSize = "Standard_B1ms" DefaultPostgresMajorVersion = 16 DefaultInitialDatabaseSizeGb = 32 DefaultBackupRetentionDays = 7 )
View Source
const ( TygerNamespace = "tyger" DefaultTygerReleaseName = TygerNamespace )
View Source
const DefaultKubernetesVersion = "1.30" // LTS
View Source
const (
EnvironmentKindCloud = "azureCloud"
)
View Source
const (
TagKey = "tyger-environment"
)
Variables ¶
View Source
var ( ResourceNameRegex = regexp.MustCompile(`^[a-z][a-z\-0-9]{2,23}$`) StorageAccountNameRegex = regexp.MustCompile(`^[a-z0-9]{3,24}$`) SubdomainRegex = regexp.MustCompile(`^[a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?$`) DatabaseServerNameRegex = regexp.MustCompile(`^([a-z0-9](?:[a-z0-9\-]{1,61}[a-z0-9])?)?$`) )
View Source
var (
ErrNotLoggedIn = errors.New("you must run `az login` before running this command")
)
Functions ¶
func CreateOrUpdateAppByUri ¶
func CreateServicePrincipal ¶
func GetAppByUri ¶
func GetChartSpec ¶
func GetChartSpec( helmChartConfig *HelmChartConfig, helmClient helmclient.Client, overrideHelmChartConfig *HelmChartConfig, customizeSpec ...func(*helmclient.ChartSpec, helmclient.Client) error, ) (helmclient.ChartSpec, error)
func GetDefaultApiVersionForResource ¶
func GetDefaultApiVersionForResource(ctx context.Context, resourceId string, providersClient *armresources.ProvidersClient) (string, error)
func GetDomainNameRegex ¶
func GetDomainNameSuffix ¶
func GetGraphToken ¶
func GetGraphToken(ctx context.Context, cred azcore.TokenCredential) (azcore.AccessToken, error)
func GetSubscriptionId ¶
func GetUserPrincipalName ¶
func NewMiAwareAzureCLICredential ¶
func NewMiAwareAzureCLICredential(options *azidentity.AzureCLICredentialOptions) (azcore.TokenCredential, error)
az account get-access-token fails if --tenant is provided and the user is logged in with a managed identity This creates a TokenProvider that works around this case
func RandomAlphanumString ¶
func RenderConfig ¶
func RenderConfig(templateValues ConfigTemplateValues, writer io.Writer) error
Types ¶
type ApiConfig ¶
type ApiConfig struct { DomainName string `json:"domainName"` Auth *AuthConfig `json:"auth"` Helm *HelmConfig `json:"helm"` }
type AuthConfig ¶
type CloudConfig ¶
type CloudConfig struct { TenantID string `json:"tenantId"` SubscriptionID string `json:"subscriptionId"` DefaultLocation string `json:"defaultLocation"` ResourceGroup string `json:"resourceGroup"` Compute *ComputeConfig `json:"compute"` Storage *StorageConfig `json:"storage"` DatabaseConfig *DatabaseConfig `json:"database"` LogAnalyticsWorkspace *NamedAzureResource `json:"logAnalyticsWorkspace"` }
type CloudEnvironmentConfig ¶
type CloudEnvironmentConfig struct { Kind string `json:"kind"` EnvironmentName string `json:"environmentName"` Cloud *CloudConfig `json:"cloud"` Api *ApiConfig `json:"api"` }
type ClusterConfig ¶
type ClusterConfig struct { Name string `json:"name"` ApiHost bool `json:"apiHost"` Location string `json:"location"` Sku armcontainerservice.ManagedClusterSKUTier `json:"sku"` KubernetesVersion string `json:"kubernetesVersion,omitempty"` SystemNodePool *NodePoolConfig `json:"systemNodePool"` UserNodePools []*NodePoolConfig `json:"userNodePools"` }
type ComputeConfig ¶
type ComputeConfig struct { Clusters []*ClusterConfig `json:"clusters"` ManagementPrincipals []Principal `json:"managementPrincipals"` LocalDevelopmentIdentityId string `json:"localDevelopmentIdentityId"` // undocumented - for local development only PrivateContainerRegistries []string `json:"privateContainerRegistries"` Identities []string `json:"identities"` }
func (*ComputeConfig) GetApiHostCluster ¶
func (c *ComputeConfig) GetApiHostCluster() *ClusterConfig
func (*ComputeConfig) GetManagementPrincipalIds ¶
func (c *ComputeConfig) GetManagementPrincipalIds() []string
type ConfigTemplateValues ¶
type ConfigTemplateValues struct { EnvironmentName string ResourceGroup string TenantId string SubscriptionId string DefaultLocation string KubernetesVersion string Principal Principal DatabaseServerName string PostgresMajorVersion int BufferStorageAccountName string LogsStorageAccountName string DomainName string ApiTenantId string CurrentIpAddress string CpuNodePoolMinCount int GpuNodePoolMinCount int }
type DatabaseConfig ¶
type DatabaseConfig struct { ServerName string `json:"serverName"` Location string `json:"location"` ComputeTier string `json:"computeTier"` VMSize string `json:"vmSize"` FirewallRules []*FirewallRule `json:"firewallRules,omitempty"` PostgresMajorVersion int `json:"postgresMajorVersion"` StorageSizeGB int `json:"storageSizeGB"` BackupRetentionDays int `json:"backupRetentionDays"` BackupGeoRedundancy bool `json:"backupGeoRedundancy"` }
type FirewallRule ¶
type HelmChartConfig ¶
type HelmConfig ¶
type HelmConfig struct { Tyger *HelmChartConfig `json:"tyger"` Traefik *HelmChartConfig `json:"traefik"` CertManager *HelmChartConfig `json:"certManager"` NvidiaDevicePlugin *HelmChartConfig `json:"nvidiaDevicePlugin"` }
type Installer ¶
type Installer struct { Config *CloudEnvironmentConfig Credential azcore.TokenCredential // contains filtered or unexported fields }
func (*Installer) ApplyMigrations ¶
func (*Installer) CreateStorageAccount ¶
func (*Installer) GetMigrationLogs ¶
func (*Installer) GetTygerInstallationRevision ¶
0 means not installed.
func (*Installer) GetUserRESTConfig ¶
func (*Installer) InstallCloud ¶
func (*Installer) InstallIdentities ¶
func (*Installer) InstallTygerHelmChart ¶
func (*Installer) ListDatabaseVersions ¶
func (*Installer) QuickValidateConfig ¶
func (*Installer) UninstallCloud ¶
type NamedAzureResource ¶
type NodePoolConfig ¶
type Principal ¶
type Principal struct { ObjectId string `json:"objectId"` UserPrincipalName string `json:"userPrincipalName"` Kind PrincipalKind `json:"kind"` // Deprecated: Id is deprecated. Use ObjectId instead Id string `json:"id"` }
func ObjectsIdToPrincipals ¶
type PrincipalKind ¶
type PrincipalKind string
const ( PrincipalKindUser PrincipalKind = "User" PrincipalKindGroup PrincipalKind = "Group" PrincipalKindServicePrincipal PrincipalKind = "ServicePrincipal" )
type StorageAccountConfig ¶
type StorageConfig ¶
type StorageConfig struct { Buffers []*StorageAccountConfig `json:"buffers"` Logs *StorageAccountConfig `json:"logs"` }
Click to show internal directories.
Click to hide internal directories.