Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupKubernetesFirewalls(ctx context.Context, client gcpclient.Interface, ...) error
- func CleanupKubernetesRoutes(ctx context.Context, client gcpclient.Interface, ...) error
- func ComputeStatus(tf *terraformer.Terraformer, config *gcpv1alpha1.InfrastructureConfig) (*gcpv1alpha1.InfrastructureStatus, error)
- func ComputeTerraformerChartValues(infra *extensionsv1alpha1.Infrastructure, account *internal.ServiceAccount, ...) map[string]interface{}
- func DeleteFirewalls(ctx context.Context, client gcpclient.Interface, projectID string, ...) error
- func DeleteRoutes(ctx context.Context, client gcpclient.Interface, projectID string, ...) error
- func GetServiceAccountFromInfrastructure(ctx context.Context, c client.Client, ...) (*internal.ServiceAccount, error)
- func ListKubernetesFirewalls(ctx context.Context, client gcpclient.Interface, ...) ([]string, error)
- func ListKubernetesRoutes(ctx context.Context, client gcpclient.Interface, ...) ([]string, error)
- func StatusFromTerraformState(state *TerraformState) *gcpv1alpha1.InfrastructureStatus
- type TerraformFiles
- type TerraformState
Constants ¶
const ( // DefaultVPCName is the default VPC terraform name. DefaultVPCName = "${google_compute_network.network.name}" // TerraformerPurpose is the terraformer infrastructure purpose. TerraformerPurpose = "infra" // TerraformerOutputKeyVPCName is the name of the vpc_name terraform output variable. TerraformerOutputKeyVPCName = "vpc_name" // TerraformerOutputKeyServiceAccountEmail is the name of the service_account_email terraform output variable. TerraformerOutputKeyServiceAccountEmail = "service_account_email" // TerraformerOutputKeySubnetNodes is the name of the subnet_nodes terraform output variable. TerraformerOutputKeySubnetNodes = "subnet_nodes" // TerraformerOutputKeySubnetInternal is the name of the subnet_internal terraform output variable. TerraformerOutputKeySubnetInternal = "subnet_internal" )
const (
KubernetesFirewallNamePrefix string = "k8s"
)
KubernetesFirewallNamePrefix is the name prefix that Kubernetes related firewall rules have.
Variables ¶
var ( // StatusTypeMeta is the TypeMeta of the GCP InfrastructureStatus StatusTypeMeta = metav1.TypeMeta{ APIVersion: gcpv1alpha1.SchemeGroupVersion.String(), Kind: "InfrastructureStatus", } )
Functions ¶
func CleanupKubernetesFirewalls ¶
func CleanupKubernetesFirewalls(ctx context.Context, client gcpclient.Interface, projectID, network, shootSeedNamespace string) error
CleanupKubernetesFirewalls lists all Kubernetes firewall rules and then deletes them one after another.
If a deletion fails, this method returns immediately with the encountered error.
func CleanupKubernetesRoutes ¶
func CleanupKubernetesRoutes(ctx context.Context, client gcpclient.Interface, projectID, network, shootSeedNamespace string) error
CleanupKubernetesRoutes lists all Kubernetes route rules and then deletes them one after another.
If a deletion fails, this method returns immediately with the encountered error.
func ComputeStatus ¶
func ComputeStatus(tf *terraformer.Terraformer, config *gcpv1alpha1.InfrastructureConfig) (*gcpv1alpha1.InfrastructureStatus, error)
ComputeStatus computes the status based on the Terraformer and the given InfrastructureConfig.
func ComputeTerraformerChartValues ¶
func ComputeTerraformerChartValues( infra *extensionsv1alpha1.Infrastructure, account *internal.ServiceAccount, config *gcpv1alpha1.InfrastructureConfig, cluster *controller.Cluster, ) map[string]interface{}
ComputeTerraformerChartValues computes the values for the GCP Terraformer chart.
func DeleteFirewalls ¶
func DeleteFirewalls(ctx context.Context, client gcpclient.Interface, projectID string, firewalls []string) error
DeleteFirewalls deletes the firewalls with the given names in the given project.
If a deletion fails, it immediately returns the error of that deletion.
func DeleteRoutes ¶
func DeleteRoutes(ctx context.Context, client gcpclient.Interface, projectID string, routes []string) error
DeleteRoutes deletes the route entries with the given names in the given project.
If a deletion fails, it immediately returns the error of that deletion.
func GetServiceAccountFromInfrastructure ¶
func GetServiceAccountFromInfrastructure(ctx context.Context, c client.Client, config *extensionsv1alpha1.Infrastructure) (*internal.ServiceAccount, error)
GetServiceAccountFromInfrastructure retrieves the ServiceAccount from the Secret referenced in the given Infrastructure.
func ListKubernetesFirewalls ¶
func ListKubernetesFirewalls(ctx context.Context, client gcpclient.Interface, projectID, network, shootSeedNamespace string) ([]string, error)
ListKubernetesFirewalls lists all firewalls that are in the given network and for the given shoot and have the KubernetesFirewallNamePrefix.
func ListKubernetesRoutes ¶
func ListKubernetesRoutes(ctx context.Context, client gcpclient.Interface, projectID, network, shootSeedNamespace string) ([]string, error)
ListKubernetesRoutes returns a list of all routes within the shoot network which have the shoot's seed namespace as prefix.
func StatusFromTerraformState ¶
func StatusFromTerraformState(state *TerraformState) *gcpv1alpha1.InfrastructureStatus
StatusFromTerraformState computes an InfrastructureStatus from the given Terraform variables.
Types ¶
type TerraformFiles ¶
TerraformFiles are the files that have been rendered from the infrastructure chart.
func RenderTerraformerChart ¶
func RenderTerraformerChart( renderer chartrenderer.Interface, infra *extensionsv1alpha1.Infrastructure, account *internal.ServiceAccount, config *gcpv1alpha1.InfrastructureConfig, cluster *controller.Cluster, ) (*TerraformFiles, error)
RenderTerraformerChart renders the gcp-infra chart with the given values.
type TerraformState ¶
type TerraformState struct { // VPCName is the name of the VPC created for an infrastructure. VPCName string // ServiceAccountEmail is the service account email for a network. ServiceAccountEmail string // SubnetNodes is the CIDR of the nodes subnet of an infrastructure. SubnetNodes string // SubnetInternal is the CIDR of the internal subnet of an infrastructure. SubnetInternal *string }
TerraformState is the Terraform state for an infrastructure.
func ExtractTerraformState ¶
func ExtractTerraformState(tf *terraformer.Terraformer, config *gcpv1alpha1.InfrastructureConfig) (*TerraformState, error)
ExtractTerraformState extracts the TerraformState from the given Terraformer.