-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add openstack provider * fmt * add flags * address review * wire templates * fix podscidr * add more flags * fmt * remove control plane machine flavor for now * fix newline * add node cidr * fix node cidr * hide openstack flags, drop ssh key support * Fix path * Remove false commit Co-authored-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
- Loading branch information
Showing
21 changed files
with
483 additions
and
81 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package provider | ||
|
||
import ( | ||
"context" | ||
"io" | ||
|
||
"github.com/giantswarm/k8sclient/v5/pkg/k8sclient" | ||
"github.com/giantswarm/microerror" | ||
|
||
"github.com/giantswarm/kubectl-gs/cmd/template/cluster/provider/templates/openstack" | ||
) | ||
|
||
func WriteOpenStackTemplate(ctx context.Context, client k8sclient.Interface, out io.Writer, config ClusterCRsConfig) error { | ||
data := struct { | ||
Description string | ||
KubernetesVersion string | ||
Name string | ||
Namespace string | ||
Organization string | ||
PodsCIDR string | ||
ReleaseVersion string | ||
|
||
Cloud string // OPENSTACK_CLOUD | ||
CloudConfig string // <no equivalent env var> | ||
DNSNameservers []string // OPENSTACK_DNS_NAMESERVERS | ||
ExternalNetworkID string // <no equivalent env var> | ||
FailureDomain string // OPENSTACK_FAILURE_DOMAIN | ||
ImageName string // OPENSTACK_IMAGE_NAME | ||
NodeCIDR string // <no equivalent env var> | ||
NodeMachineFlavor string // OPENSTACK_NODE_MACHINE_FLAVOR | ||
RootVolumeDiskSize string // <no equivalent env var> | ||
RootVolumeSourceType string // <no equivalent env var> | ||
RootVolumeSourceUUID string // <no equivalent env var> | ||
}{ | ||
Description: config.Description, | ||
KubernetesVersion: "v1.20.9", | ||
Name: config.Name, | ||
Namespace: config.Namespace, | ||
Organization: config.Organization, | ||
PodsCIDR: config.PodsCIDR, | ||
ReleaseVersion: config.ReleaseVersion, | ||
|
||
Cloud: config.Cloud, | ||
CloudConfig: config.CloudConfig, | ||
DNSNameservers: config.DNSNameservers, | ||
ExternalNetworkID: config.ExternalNetworkID, | ||
FailureDomain: config.FailureDomain, | ||
ImageName: config.ImageName, | ||
NodeCIDR: config.NodeCIDR, | ||
NodeMachineFlavor: config.NodeMachineFlavor, | ||
RootVolumeDiskSize: config.RootVolumeDiskSize, | ||
RootVolumeSourceType: config.RootVolumeSourceType, | ||
RootVolumeSourceUUID: config.RootVolumeSourceUUID, | ||
} | ||
|
||
var templates []templateConfig | ||
for _, t := range openstack.GetTemplates() { | ||
templates = append(templates, templateConfig(t)) | ||
} | ||
|
||
err := runMutation(ctx, client, data, templates, out) | ||
if err != nil { | ||
return microerror.Mask(err) | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.