This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
forked from mojolingo/puppet-openshift
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add openshift_origin::ose_supported_config
This class checks for known configurations that are not supported by Openshift Enterprise. Includes basic spec tests for a good configuration, but I need to add some unsupported test cases.
- Loading branch information
Showing
4 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
== Openshift Enterprise Specific notes | ||
|
||
If you wish to perform an Openshift Enterprise install you should set ose_version appropriately as this will | ||
assist in ensuring supported configurations. | ||
|
||
While this module will assist in providing supported configruations please refer to Openshift Enterprise | ||
Deployment Guide for current prerequisites and supported configuration details. | ||
|
||
=== Constraints imposed : | ||
* Red Hat Enterprise Linux 6 version 6.5 or later | ||
* Broker and Node roles are mutually exclusive | ||
* Broker HA load balancing must be external to OSE nodes and therefore can not be configured via this module | ||
* Avahi and Route53 DNS plugins are not supported | ||
* ActiveMQ, if clustered, requires 2+ nodes | ||
* MongoDB replicasets must 3+(2*n) nodes | ||
|
||
=== Yum repositories | ||
Configuring yum repositories via this module is not currently supported. Please ensure subscriptions and/or | ||
yum repositories are configured per the deployment guide. https://access.redhat.com/documentation/en-US/OpenShift_Enterprise/2/html/Deployment_Guide/Red_Hat_Subscription_Requirements.html | ||
|
||
=== TODO | ||
* Use stored configs to push node dns changes from broker without sharing secrets to nodes | ||
* Stored configs for districts | ||
* Broker API key, rsync key? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright 2014 Red Hat, Inc., All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# == Class openshift_origin::ose_supported_config | ||
# | ||
# This class enforces or provides notices about unsupported configurations. | ||
# | ||
# TODO: write a custom function to avoid all the fail vs. notice logic | ||
# | ||
class openshift_origin::ose_supported_config { | ||
if ($::operatingsystem != 'RedHat') or ($::operatingsystemmajrelease != '6') or | ||
($::operatingsystemrelease < '6.5') { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise requires Red Hat Enterprise Linux Server 6 version 6.5 or later') | ||
} else { | ||
fail('Openshift Enterprise requires Red Hat Enterprise Linux Server 6 version 6.5 or later') | ||
} | ||
} | ||
if member( $openshift_origin::node_frontend_plugins, 'apache-mod-rewrite' ) { | ||
notice('Openshift Enterprise 2.2 has deprecated the apache-mod-rewrite frontend.') | ||
} | ||
if $::architecture != 'x86_64' { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise is only supported on x86_64.') | ||
} else { | ||
fail('Openshift Enterprise is only supported on x86_64.') | ||
} | ||
} | ||
if member( $openshift_origin::roles, 'node' ) and member( $openshift_origin::roles, 'broker' ) { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise does not support co-location of node and broker') | ||
} else { | ||
fail('Openshift Enterprise does not support co-location of node and broker') | ||
} | ||
} | ||
if member( $openshift_origin::roles, 'load_balancer' ) { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Broker load balancing must be handled by external facilities') | ||
} else { | ||
fail('Broker load balancing must be handled by external facilities') | ||
} | ||
} | ||
if $openshift_origin::broker_dns_plugin =~ /avahi|route53/ { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise does not support avahi or route53 dns plugins') | ||
} else { | ||
fail('Openshift Enterprise does not support avahi or route53 dns plugins') | ||
} | ||
} | ||
if $openshift_origin::msgserver_cluster { | ||
if !(size($openshift_origin::msgserver_cluster_members) >= 2) { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise requires at least 2 ActiveMQ nodes for clustered messaging') | ||
} else { | ||
fail('Openshift Enterprise requires at least 2 ActiveMQ nodes for clustered messaging') | ||
} | ||
} | ||
} | ||
if $openshift_origin::mongodb_replicasets { | ||
if ( (size($openshift_origin::mongodb_replicasets_members) < 3) or | ||
!((size($openshift_origin::mongodb_replicasets_members) % 2) == 1) ) { | ||
if $openshift_origin::ose_unsupported { | ||
notice('Openshift Enterprise requires replicasets have 3 or more members. It must also be an odd number of members.') | ||
} else { | ||
fail('Openshift Enterprise requires replicasets have 3 or more members. It must also be an odd number of members.') | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
require 'spec_helper' | ||
|
||
describe 'openshift_origin' do | ||
let :facts do { | ||
:osfamily => 'RedHat', | ||
} end | ||
|
||
describe 'ose supported configs' do | ||
let :facts do { | ||
:osfamily => 'RedHat', | ||
:operatingsystem => 'RedHat', | ||
:operatingsystemmajrelease => '6', | ||
:operatingsystemrelease => '6.5', | ||
:architecture => 'x86_64', | ||
} end | ||
let :params do { | ||
:ose_version => 2.2, | ||
:roles => ['broker'], | ||
# BIND / named config | ||
# This is the key for updating the OpenShift BIND server | ||
:bind_key => 'something', | ||
# The domain under which applications should be created. | ||
:domain => 'example.com', | ||
# Apps would be named <app>-<namespace>.example.com | ||
# This also creates hostnames for local components under our domain | ||
:register_host_with_nameserver => true, | ||
# Forward requests for other domains (to Google by default) | ||
:conf_nameserver_upstream_dns => ['8.8.8.8', '8.8.4.4'], | ||
|
||
# NTP Servers for OpenShift hosts to sync time | ||
:ntp_servers => ['ntp.example.com iburst'], | ||
|
||
# The FQDNs of the OpenShift component hosts | ||
:broker_hostname => 'broker.example.com', | ||
:msgserver_hostname => 'broker.example.com', | ||
:node_hostname => 'node.example.com', | ||
|
||
# To enable installing the Jenkins cartridge: | ||
:install_method => 'yum', | ||
:jenkins_repo_base => 'http://pkg.jenkins-ci.org/redhat', | ||
|
||
# Cartridges to install on Node hosts | ||
:install_cartridges => ['php', 'mysql'], | ||
|
||
#Enable development mode for more verbose logs | ||
:development_mode => true, | ||
|
||
# apache-mod-rewrite is deprecated | ||
:node_frontend_plugins => ['apache-vhost'], | ||
|
||
# clustered message servers need > 2 nodes | ||
:msgserver_cluster => true, | ||
:msgserver_cluster_members => ['1.1.1.1','2.2.2.2'], | ||
|
||
# replicasets require 3 nodes | ||
:mongodb_replicasets => true, | ||
:mongodb_replicasets_members => ['a.example.com','b.example.com','c.example.com'], | ||
} end | ||
it { should compile.with_all_deps } | ||
end | ||
end |