-
Notifications
You must be signed in to change notification settings - Fork 11
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
Shoot migration not working anymore #306
Comments
Very rough idea:
|
With #308 we can make the firewall survive the shoot migration. However, as the firewall-controller is now maintaining a seed client for reconciliation, the seed client becomes invalid after a shoot migration. This is because we use a static service account token, which Kubernetes signs with the cluster's CA, which has, of course, changed after the migration. Also the server endpoint has changed after the migration. Thus, there must be a possibility for the firewall-controller to migrate its client to the new seed. For this, I think we have two options:
If we decide for the second variant, we should also consider migrating away from static service account tokens and instead start Here is a brief description of how the process could look like:
---
kind: ClusterRole
metadata:
name: firewall.metal-stack.io:system:firewall-bootstrapper
rules:
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- create
- get
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests/firewallcontroller
verbs:
- create
---
kind: ClusterRoleBinding
metadata:
name: firewall.metal-stack.io:system:firewall-bootstrapper
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: firewall.metal-stack.io:system:firewall-bootstrapper
subjects:
- kind: Group
name: system:bootstrappers
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Secret
metadata:
name: bootstrap-token-07401b
namespace: kube-system
type: bootstrap.kubernetes.io/token
stringData:
description: "Token for bootstrapping the metal-stack firewall-controller."
token-id: 07401b
token-secret: f395accd246ae52d
expiration: <now+60m>
usage-bootstrap-authentication: "true"
usage-bootstrap-signing: "true"
auth-extra-groups: system:bootstrappers
apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
metadata:
name: firewall-controller-csr
spec:
groups:
- system:authenticated
request: <csr>
signerName: kubernetes.io/kube-apiserver-client
usages:
- digital signature
- key encipherment
- client auth
username: shoot--pcfgbt--cilium-firewall-653f3 <-- FCM creates a rolebinding and role for every firewall
expirationSeconds: <1 year?>
status:
certificate: <cert>
conditions:
- lastTransitionTime: "2023-06-21T10:39:54Z"
lastUpdateTime: "2023-06-21T10:39:54Z"
message: Auto approving firewall-controller client certificate after SubjectAccessReview.
reason: AutoApproved
status: "True"
type: Approved
|
fw2,fwset,fwdeployment objects have a
firewall.metal-stack.io/firewall-controller-manager
finalizer, but fcm has already been deleted.After removing the finalizer, migration continues, but after the restore, a new firewall is created, without deleting the old one.
This results in a cluster with two firewalls.
The text was updated successfully, but these errors were encountered: