GithubHelp home page GithubHelp logo

mcarden / minishift-up-role Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chouseknecht/minishift-up-role

0.0 2.0 0.0 74 KB

Creates a local OpenShift instance by installing and running minishift

License: Apache License 2.0

minishift-up-role's Introduction

Build Status

minishift-up-role

Installs the latest minishift binary, and creates a minishift instance.

Performs the following tasks:

  • Downloads and installs the latest minishift binary
  • Copies the latest oc binary from ~/.minishift/cache/oc to a directory in your PATH
  • Installs the Docker Machine driver
  • Creates a minishift instance
  • Grants cluster admin to the developer account
  • Creates a route to the internal registry
  • Adds a hostname to /etc/hosts for accessing the internal registry

Accessing the registry

After the role executes, and minishift is running, you will be able to access the internal registry using the openshift_hostname value. The default vaule is local.openshift. For example, log in by running the following:

$ docker login -u developer -p $(oc whoami -t) https://local.openshift

Supported platforms:

  • Debian
  • Red Hat
  • OSX

Prerequisites

  • Ansible 2.4+
  • Prior to running the role, clear your terminal session of any DOCKER* environment variables.
  • sudo access is required for installing packages

OSX

Mounting /Users to the Minishift VM

When the Minishift VM is started, the /Users volume will be mounted to the VM. This is done by setting the environment variable XHYVE_VIRTIO_9P=true. The variable is set temporarily during the :q

Linux

  • KVM installed and working. The role installs the Docker Machine driver for KVM, but it assumes KVM is already installed, and working.
  • Ansible 2.2+

Fedora

  • Install packages python2-dnf, and libselinux-python

Known Issues

Fedora

  • Before accessing the Docker daemon on the Minishift instance, you'll need to modify the /etc/sysconfig/docker script to prevent it from overriding the DOCKER_CERT_PATH environment variable. Edit the file, and change the line DOCKER_CERT_PATH=/etc/docker to the following:

    if [ -z "${DOCKER_CERT_PATH}" ]; then
        DOCKER_CERT_PATH=/etc/docker
    fi
    

Defaults

minishift_repo: minishift/minishift

Repo where the minishift binary can be found

minishift_github_url: https://api.github.com/repos

URL to access GitHub API.

minishift_release_tag_name: ""

Defaults to installing the latest release. Use to install a specific minishift release.

minishift_dest: /usr/local/bin**

Where to install the minishift binary.

minishift_force_install: yes

Overwrite any existing minishift binary found at {{ minishift_dest }}

minishift_restart: yes

Stop and recreate the existing minishift instance.

minishift_delete: yes

Perform minishift delete, and remove ~/.minishift. If you're upgrading, you most likely want to do this.

minishift_start_options: []

Provide a list of options to pass to minishift start.

openshift_client_dest: /usr/local/bin

Where to install the OpenShift client binary.

openshift_force_client_copy: yes

Overwrite any existing OpenShift client binary found at {{ openshift_client_dest }}.

openshift_hostname: local.openshift

The hostname you'll use to reference the local registry when you're ready to push images. Gets added to /etc/hosts.

Example Playbook

Below is a sample playbook that includes all of the default parameters. You'll find this exact example in files/minishift-up.yml:

---
- name: Install minishift
  hosts: localhost
  connection: local
  gather_facts: yes
  roles:
    - role: chouseknecht.minishift-up-role
      minishift_repo: minishift/minishift 
      minishift_github_url: https://api.github.com/repos
      minishift_release_tag_name: ""
      minishift_dest: /usr/local/bin  
      minishift_force_install: yes
      minishift_restart: yes 
      minishift_delete: yes 
      minishift_start_options: []
      openshift_client_dest: /usr/local/bin
      openshift_force_client_copy: yes
      openshift_hostname: local.openshift

After you install the role, copy files/minishift-up.yml to your project directory, and execute it with the --ask-sudo-pass option. For example:

# Install the role 
$ ansible-galaxy install chouseknecht.minishift-up-role

# Copy the playbook from your roles path to the current working directory 
$ cp ${ANSIBLE_ROLES_PATH}/chouseknecht.minishift-up-role/files/minishift-up.yml .

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

# Run the playbook
$ ansible-playbook -i inventory --ask-sudo-pass minishift-up.yml

Dependencies

None

License

Apache v2

Author

@chouseknecht

minishift-up-role's People

Contributors

gregdek avatar

Watchers

 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.