Giter VIP home page Giter VIP logo

atlasmap-operator's Introduction

AtlasMap Operator

CircleCI Go Report Card license

A Kubernetes operator based on the Operator SDK which can manage AtlasMap on a cluster.

Custom Resource

apiVersion: atlasmap.io/v1alpha1
kind: AtlasMap
metadata:
  name: example-atlasmap
spec:
  # The desired number of replicas
  replicas: 1
  # Override the default AtlasMap image version. The default is 'latest'.
  version: 1.43.4
  # The host name to use for the OpenShift route or Kubernetes Ingress. If not specified, this is generated automatically
  routeHostName: example-atlasmap.192.168.42.115.nip.io
  # The amount of CPU to request
  requestCPU: 200m
  # The amount of memory to request
  requestMemory: 256Mi
  # The amount of CPU to limit
  limitCPU: 300m
  # The amount of memory to limit
  limitMemory: 512Mi

Features

The AtlasMap operator can:

Create

  • AtlasMap deployment, route and service objects

Update

  • Reconcile replicas count into the deployment
  • Reconcile version for the container image tag into the deployment and override the default
  • Reconcile resource requests for CPU and memory into the deployment
  • Reconcile resource limits for CPU and memory into the deployment

Delete

  • Remove AtlasMap deployment, route and service objects

Install

On OpenShift the AtlasMap operator can be installed via OperatorHub.

To manually install the required CRDs, roles, role binding & service account run the following commands as a privileged user.

$ kubectl apply -f deploy/crds/atlasmaps.atlasmap.io.crd.yaml
$ kubectl apply -f deploy/service_account.yaml
$ kubectl apply -f deploy/role.yaml
$ kubectl apply -f deploy/role_binding.yaml
$ kubectl apply -f deploy/cluster_role.yaml
$ cat deploy/cluster_role_binding.yaml | sed "s/{{NAMESPACE}}/your-namespace/g" | kubectl apply -f -

To deploy the AtlasMap operator run:

$ kubectl apply -f deploy/operator.yaml

Verify that the operator is running:

$ kubectl get deployment atlasmap-operator
NAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
atlasmap-operator        1         1         1            1           1m

If you have make installed then you can simplify this by running make install & make deploy.

Test

When the operator is running you can deploy an example AtlasMap custom resource:

# Create example-atlasmap
$ kubectl create -f deploy/crds/atlasmap_cr.yaml
atlasmap.atlasmap.io/example-atlasmap created

# Verify example-atlasmap
$ kubectl get atlasmap example-atlasmap
NAME               URL                                                       IMAGE                                PHASE
example-atlasmap   https://example-atlasmap-atlasmap.192.168.42.186.nip.io   docker.io/atlasmap/atlasmap:latest   Deployed

# Scale example-atlasmap
$ kubectl patch atlasmap example-atlasmap --type='merge' -p '{"spec":{"replicas":3}}'
atlasmap.atlasmap.io/example-atlasmap patched

# Delete example-atlasmap
$ kubectl delete atlasmap example-atlasmap
atlasmap.atlasmap.io "example-atlasmap" deleted

Uninstall

To remove the AtlasMap operator from the cluster run:

$ make uninstall

Development

The AtlasMap operator can be run locally:

$ make run
INFO[0000] Running the operator locally.

The AtlasMap operator docker image can be built by running:

$ make build
INFO[0003] Building Docker image docker.io/atlasmap/operator:latest

Integration tests can be run by:

$ make test
INFO[0000] Testing operator locally.

Or to test a local operator build:

$ make test-local

To run lint checks. Install golangci-lint and run:

$ make lint

atlasmap-operator's People

Contributors

jamesnetherton avatar akoserwal avatar jeremyary avatar igarashitm avatar phantomjinx avatar pure-bot[bot] avatar

Watchers

James Cloos avatar  avatar

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.