Skip to content

Instantly share code, notes, and snippets.

@mtougeron
mtougeron / CAPA.md
Last active January 23, 2024 21:22
Notes for importing managed clusters into Cluster API

WARNING: This hasn't been tested extensively outside of my environment. Your mileage may vary.

Assumptions:

  • Any security group modifications or creation that CAPA does that's not specifically flagged below are acceptable for a brief disruption when modified
  • This is valid as of CAPA 2.0.2. This may not work with new versions (e.g., the steps were different pre-2.x and it was easier to import even the VPC itself pre-2.x)

Importing CAPA Cluster (using BYO VPC):

  • Make sure AWSManagedControlPlane.spec.eksClusterName matches the EKS cluster name
  • Optionally set AWSManagedControlPlane.spec.network.securityGroupOverrides.controlplane to match the security group you have on the EKS controlplane. If you have extra security groups I haven't been able to figure out how to import those into CAPA but they stay attached to the EKS cluster and are just ignored by CAPA
  • Set the VPC information according to the BYO VPC specs https://cluster-api-aws.sigs.k8s.io/topics/bring-your-own-aws-infrastructure.html#configur
@jappievw
jappievw / LICENSE
Last active July 31, 2024 12:05
Boto3 Management Session with Refreshable Assume Role
MIT License
Copyright (c) 2018 Jasper van Wanrooy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
WITH btree_index_atts AS (
SELECT nspname, relname, reltuples, relpages, indrelid, relam,
regexp_split_to_table(indkey::text, ' ')::smallint AS attnum,
indexrelid as index_oid
FROM pg_index
JOIN pg_class ON pg_class.oid=pg_index.indexrelid
JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
JOIN pg_am ON pg_class.relam = pg_am.oid
WHERE pg_am.amname = 'btree'
),