GithubHelp home page GithubHelp logo

pytoshka / openshift-vagrant Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 7.0 48 KB

Easy deployment solution for all-in-one Openshift cluster

License: BSD 3-Clause "New" or "Revised" License

Shell 100.00%
vagrant openshift openshift-origin ansible ruby python devops automation openshift-cluster openshift-ansible

openshift-vagrant's Introduction

openshift-vagrant

This project aims to provision a CentOS 7 with OKD all-in-one, using openshift-ansible with container storage, router, registry, metrics, logging and etc.

You can change in environment varibles Vagrantfile file or use os environment varibles. It defaults to origin, v3.11 and 10.0.0.111 respectively.

After vagrant up you'll be able to access your OpenShift instance at: https://okd.master1.10.0.0.111.nip.io:8443 with admin:admin.

Brokers

List of work brokers

CLI for work with them

Switch container runtime

For switching container runtime you need change this setting to False in OSEv3.yml (folder group_vars):

openshift_use_crio: true
openshift_use_crio_only: true

Then in inventory file (folder ansible) change node group to node-config-all-in-one for okd-master1:

okd-master1 openshift_node_group_name=node-config-all-in-one-crio ansible_connection=local

Hostname of VM

Hostname defines here:

hostname = project + "-master#{node_nr}"

Backup script

In folder templates there is script backupimage.sh which can re-tag images and push to your registry.

Openshift variables

All variables in vars file located in group_vars in file OSEv3.yml. Enjoy :) (For comments thanks to Asgoret)

Vagrant variables

All vagrant variables located in Vagrantfile. Enjoy :)

Vagrant DNS

If you want to add Vagrant DNS use this plugin: Vagrant DNS And some examples:

  • Vagrantfile:
#
# Create dnsmasq
#
config.dns.tld = "okd-vagrant.domain.com"
config.vm.hostname = "apps"
config.dns.patterns = [/^.*apps.okd-vagrant.domain.com$/]
  • Vagrantfile (part deploy_cluster):
deploy_cluster.extra_vars = {
...
    dns_name: "#{hostname}"
  • OSEv3.yml:
# OKD URLs
openshift_master_cluster_hostname: "{{ dns_name }}"
openshift_master_cluster_public_hostname: "okd-vagrant.domain.com"
openshift_master_default_subdomain: "apps.okd-vagrant.domain.com"

LDAP

LDAP configuratine in vars file located in group_vars in file OSEv3.yml.

Dependency

  • Vagrant
  • vagrant-hostmanager plugin
  • VirtualBox

Limitations

  • Tested only on MacOS, Suse
  • Only tested with VirtualBox

Updates:

  • Cri-O support many thanks to Asgoret
  • Testing on Linux Suse many thanks to gecube

openshift-vagrant's People

Contributors

asgoret avatar pytoshka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openshift-vagrant's Issues

Rewrite readme

  • Add part about brokers
  • Add part about switching runtime
  • Add part about names in vagrant provisioner
  • Add part about backup script
  • Add part about vagrant variables
  • Add part about OKD variables

Backup images

  • Write script which will re-tag images for local registry and push them there
  • Add provision names
  • LDAP identity provider

Сontainer images are not available

Describe the bug
After vagrant up I get this:

  1. Hosts: okd-master1
    Play: OpenShift Health Checks
    Task: Run health checks (install) - EL
    Message: One or more checks failed
    Details: check "docker_image_availability":
    One or more required container images are not available:
    docker.io/openshift/origin-docker-registry:v3.11.0,
    docker.io/openshift/origin-haproxy-router:v3.11.0,
    docker.io/openshift/origin-pod:v3.11.0,
    quay.io/coreos/etcd:v3.2.22
    Checked with: skopeo inspect [--tls-verify=false] [--creds=:] docker:///

To Reproduce
vagrant up from master or development branch

Screenshots
Снимок экрана 2019-03-14 в 10 14 36

Fixes

  • Fix loop ansible warn
    [WARNING]: The loop variable 'item' is already in use. You should set the 'loop_var' value in the 'loop_control' option for the task to something else to avoid variable collisions and unexpected behavior.

No package matching svcat

Need to investigate issue, as result we should fix it as soon as we can

failed: [okd-master1] (item=svcat) => {"changed": false, "msg": "No package matching 'svcat' found available, installed or updated", "package_cli_item": "svcat", "rc": 126, "results": ["No package matching 'svcat' found available, installed or updated"]}

broken vagrant up

Just download repo and start in vagrant. The cluster is created and is not started successfully:

TASK [openshift_control_plane : Report control plane errors] *******************
fatal: [okd-master1]: FAILED! => {"changed": false, "msg": "Control plane pods didn't come up and become ready"}

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
localhost                  : ok=11   changed=0    unreachable=0    failed=0    skipped=5    rescued=0    ignored=0   
okd-master1                : ok=334  changed=163  unreachable=0    failed=1    skipped=226  rescued=0    ignored=4   


INSTALLER STATUS ***************************************************************
Initialization              : Complete (0:00:16)
Health Check                : Complete (0:00:46)
Node Bootstrap Preparation  : Complete (0:03:35)
etcd Install                : Complete (0:00:40)
Master Install              : In Progress (0:22:11)
	This phase can be restarted by running: playbooks/openshift-master/config.yml


Failure summary:


  1. Hosts:    okd-master1
     Play:     Configure masters
     Task:     Report control plane errors
     Message:  Control plane pods didn't come up and become ready
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

somewhere before:

a lot of

        "E0623 14:53:37.175637       1 reflector.go:136] k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.ReplicaSet: Get https://okd-master1:8443/apis/extensions/v1beta1/replicasets?limit=500&resourceVersion=0: dial tcp 127.0.0.1:8443: connect: connection refused", 

somewhere much earlier:

FAILED - RETRYING: Wait for all control plane pods to come up and become ready (6 retries left).
FAILED - RETRYING: Wait for all control plane pods to come up and become ready (5 retries left).
FAILED - RETRYING: Wait for all control plane pods to come up and become ready (4 retries left).
FAILED - RETRYING: Wait for all control plane pods to come up and become ready (3 retries left).
FAILED - RETRYING: Wait for all control plane pods to come up and become ready (2 retries left).
FAILED - RETRYING: Wait for all control plane pods to come up and become ready (1 retries left).
failed: [okd-master1] (item=controllers) => {"ansible_loop_var": "item", "attempts": 72, "changed": false, "item": "controllers", "msg": {"cmd": "/bin/oc get pod master-controllers-okd-master1 -o json -n kube-system", "results": [{}], "returncode": 1, "stderr": "The connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\n", "stdout": ""}}
...ignoring

TASK [openshift_control_plane : Check status in the kube-system namespace] *****
fatal: [okd-master1]: FAILED! => {"changed": true, "cmd": ["oc", "status", "--config=/etc/origin/master/admin.kubeconfig", "-n", "kube-system"], "delta": "0:00:00.230023", "end": "2020-06-23 13:20:15.826486", "msg": "non-zero return code", "rc": 1, "start": "2020-06-23 13:20:15.596463", "stderr": "The connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?\nThe connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?", "stderr_lines": ["The connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?", "The connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?", "The connection to the server okd-master1.10.0.0.111.nip.io:8443 was refused - did you specify the right host or port?", "The connection to the server okd-master1.10.0.0.111.nip.

I am testing on Mac OS X with the Vagrant and VBox:

gaal@catalina openshift-vagrant % vagrant version
Installed Version: 2.2.7
Latest Version: 2.2.9
 
To upgrade to the latest version, visit the downloads page and
download and install the latest version of Vagrant from the URL
below:

  https://www.vagrantup.com/downloads.html

If you're curious what changed in the latest release, view the
CHANGELOG below:

  https://github.com/hashicorp/vagrant/blob/v2.2.9/CHANGELOG.md

The box is used:

==> okd-master1: Checking if box 'centos/7' version '2004.01' is up to date...

or (from inside of VM)

[root@okd-master1 ~]# uname -a
Linux okd-master1 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@okd-master1 ~]# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

Fix: DEPRECATION WARNING

[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions.
This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: include is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this
rationale.. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

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.