Skip to content

Instantly share code, notes, and snippets.

@chrigl
Last active November 28, 2018 18:23
Show Gist options
  • Save chrigl/754096d869ee84759bffd658a8cef4f3 to your computer and use it in GitHub Desktop.
Save chrigl/754096d869ee84759bffd658a8cef4f3 to your computer and use it in GitHub Desktop.
Add spec to ProviderSpec
type OpenstackClusterProviderSpec struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec,omitempty"`
}
type ClusterSpec struct {
// NodeCIDR is the OpenStack Subnet to be created
NodeCIDR string `json:"nodeCidr,omitempty"`
// Floating IP which will be assigned to a created loadbalancer. If not provided,
// no loadbalancer will be created.
FloatingIP string `json:"floatingIP,omitempty"`
ExternalNetworkID string `json:"externalNetworkId"`
}
@randomvariable
Copy link

e.g.

apiVersion: "cluster.k8s.io/v1alpha1"
kind: Cluster
metadata:
  name: cluster
  namespace: cluster-aws
spec:
  clusterNetwork:
    services:
      cidrBlocks:
        - $(CLUSTER_SERVICES_CIDR_BLOCK)
    pods:
      cidrBlocks:
        - $(CLUSTER_PODS_CIDR_BLOCK)
    serviceDomain: $(CLUSTER_SERVICE_DOMAIN)
  providerConfig:
    value:
      apiVersion: "awsprovider/v1alpha1"
      kind: "AWSClusterProviderConfig"
      region: $(CLUSTER_REGION)
      sshKeyName: $(CLUSTER_SSH_KEY_NAME)

vs.

apiVersion: "cluster.k8s.io/v1alpha1"
kind: Cluster
metadata:
  name: cluster
  namespace: cluster-aws
spec:
  clusterNetwork:
    services:
      cidrBlocks:
        - $(CLUSTER_SERVICES_CIDR_BLOCK)
    pods:
      cidrBlocks:
        - $(CLUSTER_PODS_CIDR_BLOCK)
    serviceDomain: $(CLUSTER_SERVICE_DOMAIN)
  providerConfig:
    value:
      apiVersion: "awsprovider/v1alpha1"
      kind: "AWSClusterProviderConfig"
	  spec:
        region: $(CLUSTER_REGION)
        sshKeyName: $(CLUSTER_SSH_KEY_NAME)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment