Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix k3s v1beta1 openstack #101

Merged
merged 2 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions samples/openstack/k3s-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
kind: KThreesControlPlane
name: ${CLUSTER_NAME}-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackCluster
name: ${CLUSTER_NAME}
---
Expand All @@ -47,7 +47,7 @@ spec:
clusterName: ${CLUSTER_NAME}
failureDomain: ${OPENSTACK_FAILURE_DOMAIN}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackMachineTemplate
name: ${CLUSTER_NAME}-md-0
version: ${KUBERNETES_VERSION}
Expand All @@ -59,57 +59,54 @@ metadata:
namespace: default
spec:
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackMachineTemplate
name: ${CLUSTER_NAME}-control-plane
replicas: 1
version: ${KUBERNETES_VERSION}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackCluster
metadata:
name: ${CLUSTER_NAME}
namespace: default
spec:
cloudName: ${OPENSTACK_CLOUD}
dnsNameservers:
- ${OPENSTACK_DNS_NAMESERVERS}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
externalNetwork:
id: ${OPENSTACK_EXTERNAL_NETWORK_ID}
identityRef:
kind: Secret
cloudName: ${OPENSTACK_CLOUD}
name: k3s-cloud-config
managedSecurityGroups: false
managedSecurityGroups: {}
disablePortSecurity: true
nodeCidr: 10.6.0.0/24
managedSubnets:
- cidr: 10.6.0.0/24
dnsNameservers:
- ${OPENSTACK_DNS_NAMESERVERS}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: default
spec:
template:
spec:
cloudName: ${OPENSTACK_CLOUD}
flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR}
identityRef:
kind: Secret
name: k3s-cloud-config
image: ${OPENSTACK_IMAGE_NAME}
image:
filter:
name: ${OPENSTACK_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
namespace: default
spec:
template:
spec:
cloudName: ${OPENSTACK_CLOUD}
flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR}
identityRef:
kind: Secret
name: k3s-cloud-config
image: ${OPENSTACK_IMAGE_NAME}
image:
filter:
name: ${OPENSTACK_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
2 changes: 1 addition & 1 deletion samples/openstack/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi

## Create a secret for your OpenStack API

if [ -z "${OS_AUTH_URL}" ] || [ -z "${OS_USERNAME}" ] || [ -z "${OS_PASSWORD}" ] || [ -z "${OS_PROJECT_NAME}" ] || [ -z "${OS_USER_DOMAIN_NAME}" ] || [ -z "${OS_PROJECT_DOMAIN_NAME}" ] || [ -z "${OS_REGION_NAME}" ]; thenn
if [ -z "${OS_AUTH_URL}" ] || [ -z "${OS_USERNAME}" ] || [ -z "${OS_PASSWORD}" ] || [ -z "${OS_PROJECT_NAME}" ] || [ -z "${OS_USER_DOMAIN_NAME}" ] || [ -z "${OS_PROJECT_DOMAIN_NAME}" ] || [ -z "${OS_REGION_NAME}" ]; then
echo 'Please set OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_USER_DOMAIN_NAME, OS_PROJECT_DOMAIN_NAME, OS_REGION_NAME'
exit 0
fi
Expand Down
Loading