-
Notifications
You must be signed in to change notification settings - Fork 14
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
Migrate providerId from aws://zone/vmid to aws:///zone/vmid #260
Conversation
Hi, I just tested and I can confirm that this PR does solve the issue :) |
Hi @azert9 , |
Here is the code that we use for testing (minus the apiVersion: v1
kind: Namespace
metadata:
name: capi-cluster
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: kapi-crs-ccm
cni: kapi-crs-cni
name: kapi
namespace: capi-cluster
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.42.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: TalosControlPlane
name: kapi-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscCluster
name: kapi
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscCluster
metadata:
name: kapi
namespace: capi-cluster
spec:
network:
clusterName: kapi
internetService:
clusterName: kapi
loadBalancer:
clusterName: kapi
loadbalancername: kapi-k8s
securitygroupname: kapi-load-balancer
natService:
clusterName: kapi
net:
clusterName: kapi
subregionName: eu-west-2a
securityGroups:
- name: kapi-talos-control-plane
description: Talos control plane nodes.
securityGroupRules:
- name: talos-control-plane-apid-from-cp
flow: Inbound
ipProtocol: tcp
ipRange: "10.0.4.0/24"
fromPortRange: 50000
toPortRange: 50000
- name: talos-control-plane-trustd-from-workers
flow: Inbound
ipProtocol: tcp
ipRange: "10.0.3.0/24"
fromPortRange: 50001
toPortRange: 50001
- name: talos-control-plane-trustd-from-cp
flow: Inbound
ipProtocol: tcp
ipRange: "10.0.4.0/24"
fromPortRange: 50001
toPortRange: 50001
- name: kapi-talos-workers
description: Talos worker nodes.
securityGroupRules:
- name: talos-workers-apid-from-cp
flow: Inbound
ipProtocol: tcp
ipRange: "10.0.4.0/24"
fromPortRange: 50000
toPortRange: 50000
- name: kapi-load-balancer
description: Kubernetes api load balancer.
securityGroupRules:
- name: kubernetes-api
flow: Inbound
ipProtocol: tcp
ipRange: "0.0.0.0/0"
fromPortRange: 6443
toPortRange: 6443
- name: kapi-talos-nodes
description: Common rules for kubernetes nodes.
securityGroupRules:
# TODO
- name: icmp
flow: Inbound
ipProtocol: icmp
ipRange: "0.0.0.0/0"
fromPortRange: 1
toPortRange: 1
- name: open-all-udp
flow: Inbound
ipProtocol: udp
ipRange: "10.0.0.0/16"
fromPortRange: 3000
toPortRange: 60000
- name: open-all-tcp
flow: Inbound
ipProtocol: tcp
ipRange: "10.0.0.0/16"
fromPortRange: 3000
toPortRange: 60000
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: kapi-worker
namespace: capi-cluster
spec:
clusterName: kapi
replicas: 1
selector:
matchLabels: null
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: TalosConfigTemplate
name: kapi-worker
clusterName: kapi
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscMachineTemplate
name: kapi-worker
version: 1.27.4
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscMachineTemplate
metadata:
name: kapi-worker
namespace: capi-cluster
spec:
template:
spec:
node:
clusterName: kapi
image:
name: talos148
keypair:
name: bootstrap
vm:
clusterName: kapi
keypairName: bootstrap
rootDisk:
rootDiskIops: 1500
rootDiskSize: 100
rootDiskType: io1
subregionName: eu-west-2a
vmType: tinav5.c4r16p1
securityGroupNames:
- name: kapi-talos-nodes
- name: kapi-talos-workers
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscMachineTemplate
metadata:
name: kapi-control-plane
namespace: capi-cluster
spec:
template:
spec:
node:
clusterName: kapi
image:
name: talos148
keypair:
name: bootstrap
vm:
clusterName: kapi
keypairName: bootstrap
loadBalancerName: kapi-k8s
role: controlplane
rootDisk:
rootDiskIops: 1500
rootDiskSize: 100
rootDiskType: io1
subregionName: eu-west-2a
vmType: tinav5.c4r16p1
securityGroupNames:
- name: kapi-talos-nodes
- name: kapi-talos-control-plane
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
kind: TalosConfigTemplate
metadata:
name: kapi-worker
namespace: capi-cluster
spec:
template:
spec:
generateType: worker
talosVersion: v1.4
configPatches:
- op: add
path: /cluster/externalCloudProvider
value:
enabled: true
manifests:
- "https://raw.githubusercontent.com/outscale/cloud-provider-osc/v0.2.3/deploy/osc-ccm-manifest.yml"
- op: add
path: /machine/kubelet/extraArgs
value:
cloud-provider: external
- op: add
path: /machine/network
value:
disableSearchDomain: true
- op: add
path: /machine/kubelet/registerWithFQDN
value: true
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
kind: TalosControlPlane
metadata:
name: kapi-control-plane
namespace: capi-cluster
spec:
controlPlaneConfig:
controlplane:
generateType: controlplane
talosVersion: v1.4
configPatches:
- op: add
path: /cluster/externalCloudProvider
value:
enabled: true
manifests:
- "https://raw.githubusercontent.com/outscale/cloud-provider-osc/v0.2.0/deploy/osc-ccm-manifest.yml"
- op: add
path: /machine/kubelet/extraArgs
value:
cloud-provider: external
- op: add
path: /machine/network
value:
disableSearchDomain: true
- op: add
path: /machine/kubelet/registerWithFQDN
value: true
- op: replace
path: /cluster/allowSchedulingOnControlPlanes
value: false
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscMachineTemplate
name: kapi-control-plane
replicas: 1
version: 1.27.4 In addition, Talos control plane nodes must be reachable by the local management cluster during bootstrap. We achieve this by creating a bastion machine with a wireguard server and we connect to it with the appropriate routing rules (we can share more on this if needed). |
Where do you set the secret cluster-api-provider-outscale ? (in TalosConfigTemplate?) |
We set it manually in the management cluster, and we don't need it in the workload cluster. |
Sorry i mean how to you create the secret osc-secret for the ccm in the workload cluster ? |
Can you please also share your wireguard config with routing rules ? (ps we have a feature https://github.com/outscale/cluster-api-provider-outscale/blob/main/example/cluster-machine-template-bastion.yaml#L62 to have a bastion :) ) |
We create it manually as well |
Here is the code that we use for the bastion : bastion.tar.gz You can set the VPC id and the subnet id as terraform variables. A wireguard config is outputed by terraform, you can apply it with wg-quick. We saw the integrated bastion feature but we are yet to explore it in depth :) |
Which bootstrapper do you use for your management cluster if it is matter with wireguard config ? (For me i try with kind in a vm in public cloud)
I can not access to the cluster to set the ccm secret with the kubeconfig received from clusterctl. |
I use a Kind cluster on a local machine. I see "capo-cluster" in your log output, is this correct? |
You can retrieve the config from a secret: kubectl -n capi-cluster get secret kapi-kubeconfig --template='{{.data.value}}' | base64 -d |
Hi
|
You need to build a Talos omi, it doesn't use cloud init. Here's how we build ours. |
Thanks @regisbelson |
@regisbelson @azert9 Is it possible to share this omi with 027440686109 ? |
We just tried and the permissions button is grayed out. Also we have to uncheck "Mine Only" in the filters to make it appear in the list, if this is related somehow. |
If you are ok, you can make your omi public with global_permission in packer (https://developer.hashicorp.com/packer/plugins/builders/outscale/outscale-bsusurrogate#global_permission) |
I recreated omi with https://www.talos.dev/v1.5/talos-guides/install/cloud-platforms/aws/ and now i get some logs to debug. |
It works :), thanks you
|
f0d10ab
to
035ab8c
Compare
@azert9 @regisbelson Are you ok if we set your config of talos as an example in cluster-api-provider-outscale repo ? |
035ab8c
to
bd4c025
Compare
bd4c025
to
0367c7b
Compare
Sure! However beware that the security groups are very open, they might need some adjustments. |
What type of PR is this?
/kind Bug
What this PR does / why we need it:
To be compatible with talos provider :)
Which issue(s) this PR fixes:
Fixes #259