Coder Social home page Coder Social logo

updater's Introduction

Edge Delta Agent Updater

Agent updater is a configurable minimal program that helps with updating your Kubernetes resources. It is designed to be used to update daemonset and deployment images, but can be used to update any spec property of these resources.

Usage

Image

The latest updater image can be found in the public Google Container Registry: gcr.io/edgedelta/agent-updater:latest.

You can also build the image yourself with several options.

Ko

Ko is a simple container image builder for Go applications. To install ko, run the following command:

go install github.com/google/ko@latest

To build the image, run the following command:

ko build --local --platform=all -B ./cmd/agent-updater

Docker

To build the image using Docker, you can use the Dockerfile under the root directory. To build the image, run the following command:

docker build . -t edgedelta/agent-updater:latest

Configuration

The updater can be configured using a YAML configuration file. The configuration file can be passed to the updater using the --config flag. The configuration file defines the resources to be updated, the API to be used to fetch the latest version, and the logging configuration.

Entities

Entities are the resources to be updated. The updater supports updating the following Kubernetes resources:

  • DaemonSet
  • Deployment

Entities are defined under the entities list in the configuration file. The following is an example of a configuration file with two entities:

entities:
- id: 111-222-333
  image: some-agent
  paths:
  - default:ds/my-agent:spec.template.spec.containers[0].image
- id: 444-555-666
  image: some-other-agent
  paths:
  - default:ds/my-other-agent:spec.template.spec.containers[0].image
Property Type Description Required
id string Unique ID of the resource Yes
image string Resource's image kind Yes
paths []string K8s object paths of the properties to be updated Yes

API

The API is used to fetch the latest version of the resource. The updater supports HTTP REST APIs.

The API is defined under the api section in the configuration file. The following is an example API configuration:

api:
  base_url: http://localhost:8080
  auth:
    header_key: Authorization
    header_value: 'Some_token'
  latest_tag:
    endpoint: /latest-version
  metadata:
    endpoint: /metadata
  log_upload:
    enabled: true
    method: PUT
    encoding:
      type: raw
      options:
        delimiter: '\n'
    compression: gzip
    presigned_upload_url:
      endpoint: /log-upload-link
      params:
        query:
          size: '{{ .ctx.size }}'
          format: json
          compression: gzip
Property Type Description Required
base_url string Base URL of the API Yes
auth APIAuth Authentication configuration No
latest_tag EndpointConfig Configuration for fetching the latest version Yes
metadata EndpointConfig Configuration for fetching the metadata Yes
log_upload LogUploadConfig Configuration for uploading logs No

Installation

The updater can be deployed to a Kubernetes cluster using the latest image from the public Google Container Registry.

  1. Replace the data.updater-config.yml under the examples/cronjob.yml with your configuration file content.
  2. Run the following command to deploy the updater:
chmod +x ./examples/deploy.sh
./examples/deploy.sh
  1. To verify that the updater is working, you can check the logs of the updater pod:
kubectl logs -f updater-<random-id>

updater's People

Contributors

ozansz avatar soyvural avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar Latif Uysal avatar  avatar yoandy avatar Tyler Combs avatar  avatar  avatar H. Ozgur Batur 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.