GithubHelp home page GithubHelp logo

isabella232 / web-ui-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubevirt/web-ui-operator

0.0 0.0 0.0 14.23 MB

Operator for web-ui

License: Apache License 2.0

Dockerfile 2.03% Go 82.30% Shell 11.12% Python 4.56%

web-ui-operator's Introduction

Kubevirt Web UI Operator

The kubernetes operator for managing Kubevirt Web UI deployment. Leverages the operator-sdk.

Kubevirt-web-ui image repository on quay.io: quay.io/repository/kubevirt/kubevirt-web-ui

How to Run

Depending on your OpenShift cluster installation, please choose from the two variants bellow.

If Cluster Console (in openshift-console project) is deployed (as by default), optional parameters can be automatically retrieved from its ConfigMap (follow Variant 1). Otherwise they need to be explicitely provided (Variant 2).

Variant 1: The openshift-console Is Installed

To ease deployment, parameters of the cluster deployment can be automatically retrieved from the openshift-console ConfigMap, if present.

To do so, the operator's service account will be granted to access the openshift-console namespace.

oc new-project kubevirt-web-ui
cd deploy

oc apply -f service_account.yaml

oc apply -f role.yaml

oc apply -f role_binding.yaml

oc create -f crds/kubevirt_v1alpha1_kwebui_crd.yaml
oc apply -f operator.yaml

Variant 2: The openshift-console Is Not Installed

In deploy/crds/kubevirt_v1alpha1_kwebui_cr.yaml, add following under spec section based on your actual OpenShift cluster deployment:

  • openshift_master_default_subdomain=[SUBDOMAIN FOR APPLICATIONS]

    • example: router.default.svc.cluster.local
    • Used for composition of web-ui's public URL
  • public_master_hostname=[FQDN:port]

    • example: master.your.domain.com:8443
    • Public URL of your first master node, used for composition of public console URL for redirects

Then execute:

oc new-project kubevirt-web-ui
cd deploy

oc apply -f service_account.yaml

oc apply -f role.yaml
oc apply -f role_binding.yaml

oc create -f crds/kubevirt_v1alpha1_kwebui_crd.yaml
oc apply -f operator.yaml

Kubevirt Web UI Version to Install

To actually deploy the Kubevirt Web UI, choose it's version by editting spec.version in deploy/crds/kubevirt_v1alpha1_kwebui_cr.yaml.

Example:

spec:
  version: "v1.4.0-9"

The image repository can be farther tweaked by using the spec.registry_url and spec.registry_namespace parameters.

To undeploy the Web UI, set spec.version to empty string (""). By providing non-empty value here, the Web UI deployment is upgraded/downgraded.

Please note, the version needs to match Web UI's docker image tag in the specified repository (seed default quay repo).

Fire Web UI Deployment

Actual Kubevirt Web UI deployment is managed via KWebUI custom resource

Once spec.version in the CR is set:

oc apply -f deploy/crds/kubevirt_v1alpha1_kwebui_cr.yaml

Other parameters:

  • registry_url: "quay.io"
  • registry_namespace: "kubevirt"
  • openshift_master_default_subdomain
  • public_master_hostname

Status

Processing status can be observed within the KWebUI custom resource's status section:

  • status.phase - contains one of the string constants for automatization
  • status.message - human readable details

In case of errors, watch operator's pod logs, sort of:

oc logs kubevirt-web-ui-operator-85ffcdd9d5-8lt9g

How to Build

See operator-sdk for the tooling installation instructions.

The operator is built using:

operator-sdk build quay.io/[YOUR_REPO]/kubevirt-web-ui-operator

Note About Internals

The project is intentionally not based on the ansible operator-sdk as there is still plan to remove the ansible code completely once the (de)provision logic can live in a single project only.

The ansible playbook is stored under build/kubevirt-web-ui-ansible directory. This playbook is extracted from the former kubevirt-ansible project.

By design, the kubevirt-web-ui-ansible uses the oc client to perform particular installation steps. To make it work, kubeconfig is recomposed by the operator based on in-cluster-config secrets.

Authors

  • Marek Libra

web-ui-operator's People

Contributors

alexxa avatar djzager avatar mareklibra avatar michalskrivanek avatar rawagner avatar tiraboschi 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.