Git Product home page Git Product logo

openshift-nginx's Introduction

Build Status

openshift-nginx

Uses existing OpenShift install and configures NGINX to be the router. Tested on OpenShift 3.11

Performs the following tasks:

  • Installs NGINX or NGINX Plus openshift router

Supported platforms

  • Red Hat

Prerequisites

  • Ansible 2.4+
  • openshift installed
  • copy nginx-repo.crt and nginx-repo.key to the files directory

Known Issues

You must have a certificate that matches the docker-registry service URL. The default installation usually uses a self-signed certificate tied to the IP address of the pod running docker-registry. This usually won't work. Running a proper PKI certificate chain will work very well. For self-signed, install the router manually.

Defaults

nginx_plus: no

Enable NGINX Plus. If you select yes (you rock!!!) then make sure you drop the nginx-repo.crt and nginx-repo.key in the /files directory

openshift_user: admin

Username for the administrator account (it will create this account if it doesn't exist).

openshift_password: admin

Password for the administrator account.

Example Playbook

Below is a sample playbook that includes all of the default parameters. You'll find this exact example in the root of the project tree.

---
- name: Install NGINX router for OpenShift
  hosts: localhost
  connection: local
  gather_facts: yes
  roles:
    - role: magicalyak.openshift_nginx
      nginx_plus: yes
      openshift_user: admin
      openshift_password: admin

After you install the role, copy openshift-nginx.yml to your project directory. For example:

# Install the role
$ ansible-galaxy install magicalyak.openshift_nginx

# Copy nginx-repo.crt and nginx-repo-key files
$ mkdir ${ANSIBLE_ROLES_PATH}/magicalyak.openshift_nginx/files
$ cp nginx-repo.{crt,key} ${ANSIBLE_ROLES_PATH}/magicalyak.openshift_nginx/files

# Copy the playbook from your roles path to the current working directory
$ cp ${ANSIBLE_ROLES_PATH}/magicalyak.openshift_nginx/openshift-nginx.yml .

# Create a localhost inventory file
$ echo "localhost">./inventory

# Run the playbook
$ ansible-playbook -i inventory --ask-become-pass openshift-nginx.yml

Uninstall

To revert the changes make sure you don't delete the default-router-backup.yml file in the $HOME directory and run the following:

# Delete the NGINX Router
$ oc delete service/router dc/router clusterrolebinding/router-router-role serviceaccount/router

# Restore existing router
$ oc create -f $HOME/default-router-backup.yml

Dependencies

OpenShift installed

License

Apache v2

Author

@magicalyak

openshift-nginx's People

Contributors

magicalyak 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.