Skip to content

☸️ Kubernetes operator for the AeroGear UnifiedPush Server

License

Notifications You must be signed in to change notification settings

jomrazek/unifiedpush-operator

 
 

Repository files navigation

UnifiedPush Operator

The UnifiedPush Operator for Kubernetes provides an easy way to install and manage an AeroGear UnifiedPush Server on Kubernetes.

Installation

As a user with admin permissions, you can easily install the unifiedpush-operator in your OpenShift cluster as follows:

kubectl create namespace unifiedpush
kubectl create -n unifiedpush -f deploy/service_account.yaml
kubectl create -n unifiedpush -f deploy/role.yaml
kubectl create -n unifiedpush -f deploy/role_binding.yaml
kubectl create -n unifiedpush -f deploy/crds/push_v1alpha1_unifiedpushserver_crd.yaml
kubectl create -n unifiedpush -f deploy/operator.yaml

Configuration

Deploying custom images

There are default images that this operator will use for the containers in the deployed pods. These can be configured with the use of environment variables. The following table shows the available environment variable names, along with their default values:

Table 1. Environment Variables
Name Default Value

UNIFIEDPUSH_IMAGE

docker.io/aerogear/unifiedpush-wildfly-plain:2.2.1.Final

POSTGRESQL_IMAGE

docker.io/centos/postgresql-96-centos7:9.6

OAUTH_PROXY_IMAGE

docker.io/openshift/oauth-proxy:v1.1.0

🔥
Re-deploying this operator with customized images will cause all instances owned by the operator to be updated.

Metrics

The application-monitoring stack provisioned by the application-monitoring-operator can be used to gather metrics from the operator here. Once you have provisioned that (or the ServiceMonitor CRD at a minimum), you can run the following commands to configure it:

kubectl label namespace unifiedpush monitoring-key=middleware
kubectl create -n unifiedpush -f deploy/service_monitor.yaml

Getting help

All AeroGear projects use the same communication channels.

Issue tracker

Our main issue tracker is AeroGear on JBoss Jira. Issues may also be created here on GitHub for individual projects.

Chat

For synchronous real-time chat, we use Matrix/IRC. These are bridged together, so you can choose which is more convenient for you: #aerogear:matrix.org on Matrix or #aerogear on FreeNode IRC.

Discussion list

For important conversations, we discuss asynchronously on this Google Groups Mailing List. This is great for discussions that should involve many people in different time zones, and allows us to easily link back to conversations in future.

Limitations

ℹ️

This operator currently only works on OpenShift. This is because it provisions a Route, and also relies on the fact that OpenShift provides an OAuth server. In future we aim to make it work on vanilla Kubernetes also.

Development

Prerequisites

  • Access to an OpenShift cluster with admin privileges to be able to create Roles. Minishift is suggested.

  • Go, Make, dep, operator-sdk, kubectl (kubectl can just be a symlink to oc)

Running the operator

  1. Prepare the operator project:

make cluster/prepare
  1. Run the operator (locally, not in OpenShift):

make code/run
  1. Create a UPS instance (in another terminal):

kubectl apply -f deploy/crds/push_v1alpha1_unifiedpushserver_cr.yaml
  1. Watch the status of your UPS instance provisioning (optional):

watch -n1 "kubectl get po && echo '' && kubectl get ups -o yaml"
  1. When finished, clean up:

make cluster/clean

Testing

Run unit tests

make test/unit

Run e2e tests

  1. Export env vars used in commands below

export NAMESPACE="<name-of-your-openshift-project-used-for-testing>"
export IMAGE="quay.io/<your-account-name>/unifiedpush-operator"
  1. Login to OpenShift cluster as a user with cluster-admin role

oc login <url> --token <token>
  1. Prepare a new OpenShift project for testing

make NAMESPACE=$NAMESPACE cluster/prepare
  1. Modify the operator image name in manifest file

yq w -i deploy/operator.yaml spec.template.spec.containers[0].image $IMAGE

Note: If you do not have yq installed, just simply edit the image name in deploy/operator.yaml

  1. Build & push the operator container image to your Dockerhub/Quay image repository, e.g.

operator-sdk build $IMAGE --enable-tests && docker push $IMAGE
  1. Run the test

operator-sdk test cluster $IMAGE --namespace $NAMESPACE --service-account unifiedpush-operator

Security Response

If you’ve found a security issue that you’d like to disclose confidentially please contact the Red Hat Product Security team.

The UnifiedPush Operator is licensed under the Apache License, Version 2.0 License, and is subject to the AeroGear Export Policy.

About

☸️ Kubernetes operator for the AeroGear UnifiedPush Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.4%
  • Makefile 2.2%
  • Other 1.4%