Coder Social home page Coder Social logo

crossplane-fn-describe-nodegroups's Introduction

function-describe-nodegroups

A Crossplane Composition Function which reads EKS nodegroup information and uses that to create MachinePool anbd AWSManagedMachinePool objects.

In order to use this function as part of the Composition, the composition must be written to use pipeline mode. See the documentation on Composition functions to better understand how this is integrated

Composition integration

This function is placed in the pipeline with a reference to the cluster object for that composition.

This should be specified in your composition as follows, setting clusterRef as appropriate for your composition.

    - step: describe-nodegroups
      functionRef:
        name: function-describe-nodegroups
      input:
        apiVersion: describenodegroups.fn.giantswarm.io
        kind: Nodegroups
        metadata:
          namespace: crossplane
        spec:
          clusterRef: eks-cluster

How it works

AWS provider

This function performs a lookup against the AWS API for Nodegroups linked to the clustername referenced in clusterRef. It then iterates over that information and populates additional information from secondary lookups to the EC2 API and Autoscaling API as appropriate.

Once all information is retrieved, this is then populated into a cluster-api provider-aws AwsManagedMachinePool object, wrapped inside a crossplane-contrib/provider-kubernetes object and returned as a desired resource to be reconciled and created by crossplane.

If the nodegroup was created with a LaunchTemplate then the function will attempt to use that to build the specification for Cluster API. If no launch template is found then the function tries to provide all required information to Cluster Api so that it can formulate the nodepool(s).

To better understand what the function is doing, the following callgraph highlights the general flow the function follows to obtain the relevant information for building the CAPI objects.

run-function-callgraph.png

Azure provider

TBD

GCP Provider

TBD

Building

# Run code generation - see input/generate.go
$ go generate ./...

# Lint the code
$ docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/v1.54.2:/root/.cache -w /app golangci/golangci-lint:v1.54.2 golangci-lint run

# testing
$ go test ./... -coverprofile=cover.out && go tool cover -html=cover.out
?       github.com/giantswarm/crossplane-fn-describe-nodegroups/pkg/composite/v1beta1   [no test files]
?       github.com/giantswarm/crossplane-fn-describe-nodegroups/pkg/input/v1beta1       [no test files]
ok      github.com/giantswarm/crossplane-fn-describe-nodegroups 0.028s  coverage: 74.9% of statements

$ docker buildx build .

Known Issues

crossplane-fn-describe-nodegroups's People

Contributors

mproffitt avatar renovate[bot] avatar dependabot[bot] avatar

Watchers

Joe Salisbury avatar Oliver Thylmann avatar Alex Dabija avatar  avatar Snizhana avatar

crossplane-fn-describe-nodegroups's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency go to v1.23.0
  • Update module sigs.k8s.io/controller-tools to v0.16.1
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
dockerfile
Dockerfile
  • docker/dockerfile 1
  • golang 1
gomod
go.mod
  • go 1.21
  • go 1.21.1
  • k8s.io/client-go v0.29.1
  • github.com/alecthomas/kong v0.8.1
  • github.com/aws/aws-sdk-go-v2 v1.24.1
  • github.com/aws/aws-sdk-go-v2/service/autoscaling v1.36.7
  • github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0
  • github.com/aws/aws-sdk-go-v2/service/eks v1.37.1
  • github.com/crossplane/crossplane-runtime v1.14.3
  • github.com/crossplane/function-sdk-go v0.1.0
  • github.com/giantswarm/xfnlib v0.0.0-20231113084629-05c87f141449@05c87f141449
  • github.com/google/go-cmp v0.6.0
  • google.golang.org/protobuf v1.32.0
  • k8s.io/api v0.29.1
  • k8s.io/apimachinery v0.29.1
  • sigs.k8s.io/cluster-api v1.6.1
  • sigs.k8s.io/cluster-api-provider-aws/v2 v2.3.1
  • sigs.k8s.io/controller-runtime v0.17.0
  • sigs.k8s.io/controller-tools v0.13.0
kubernetes
package/composite/xr.describenodegroups.fn.giantswarm.io_xrobjectdefinitions.yaml
  • CustomResourceDefinition apiextensions.k8s.io/v1
package/input/describenodegroups.fn.giantswarm.io_inputs.yaml
  • CustomResourceDefinition apiextensions.k8s.io/v1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.