Code Monkey home page Code Monkey logo

image-controller's Introduction

codecov

The Image Controller for AppStudio

The Image Controller for AppStudio helps set up container image repositories for AppStudio Components.

Try it!

Installation

  1. Install the project on your cluster by running make deploy.
  2. Set up the Quay.io token that would be used by the controller to setup image repositories under the quay.io/redhat-user-workloads organization.
kind: Secret
apiVersion: v1
metadata:
  name: quaytoken
  namespace: image-controller-system
data:
  organization: redhat-user-workloads
  quaytoken: redacted
type: Opaque

Create a Component

To request the controller to setup an image repository, annotate the Component with image.redhat.com/generate: '{"visibility": "public"}' or image.redhat.com/generate: '{"visibility": "private"}' depending on desired repository visibility.

apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
  annotations:
    image.redhat.com/generate: '{"visibility": "public"}'
  name: billing
  namespace: image-controller-system
spec:
  application: city-transit
  componentName: billing

The image.redhat.com/generate annotation will be deleted after processing. The visibility status will be shown in visibility field of image.redhat.com/image annotation.

Also, it's possible to change the visibility of the repository after it's creation by setting the annotation again.


NOTE

Your quay.io organization plan should allow creation of private repositories. If your quay.io organization has free plan that does not allow setting repositories as private, then the error will be shown in message field of image.redhat.com/image annotation and the repository will not be created or will remain public.


If Component's auto-generated image repository should be deleted after component deletion, add image.redhat.com/delete-image-repo annotation to the Component.

Verify

The Image controller would create the necessary resources on Quay.io and write out the details of the same into the Component resource as an annotation, namely:

  • The image repository URL.
  • The image repository visibility.
  • The name of the Kubernets Secret in which the robot account token was written out to.
{
   "image":"quay.io/redhat-user-workloads/image-controller-system/city-transit/billing",
   "visibility":"public",
   "secret":"billing",
}
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
  annotations:
    image.redhat.com/generate: 'false'
    image.redhat.com/image: >-
      {"image":"quay.io/redhat-user-workloads/image-controller-system/city-transit/billing","visibility":"public","secret":"billing"}
  name: billing
  namespace: image-controller-system
  resourceVersion: '86424'
  uid: 0e0f30b6-d77e-406f-bfdf-5802db1447a4
spec:
  application: city-transit
  componentName: billing

License

Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

image-controller's People

Contributors

michkov avatar mkosiarc avatar mmorhun avatar sbose78 avatar stuartwdouglas avatar tisutisu avatar tkdchen avatar tnevrlka 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.