Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

cookbook-openshift3 (157) Versions 1.10.9

Installs/Configures Openshift 3.x (>= 3.4)

Policyfile
Berkshelf
Knife
cookbook 'cookbook-openshift3', '= 1.10.9', :supermarket
cookbook 'cookbook-openshift3', '= 1.10.9'
knife supermarket install cookbook-openshift3
knife supermarket download cookbook-openshift3
README
Dependencies
Changelog
Quality 50%

Description

  • Installs OSEv3 and related packages.

Requirements

Platform

  • Tested on Red Hat RHEL 7.2
  • Tested on Centos 7.2

Openshift Version

  • Support OSE version from 3.1.0.4+
  • Support Origin version from 1.1.1+

Override Attributes

Read more about overriding attributes here!

Structure


  • node['cookbook-openshift3']['openshift_master_identity_provider']['HTPasswdPasswordIdentityProvider']
{
"name" : "htpasswd_auth", 
"login" : true, 
"challenge" : true, 
"kind" : "HTPasswdPasswordIdentityProvider", 
"filename" : "/etc/openshift/openshift-passwd"
}
  • node['cookbook-openshift3']['openshift_master_identity_provider']['LDAPPasswordIdentityProvider']
{
"name" : "ldap_identity", 
"login" : true, 
"challenge" : true, 
"kind" : "LDAPPasswordIdentityProvider", 
"ldap_server" : "ldap.domain.local",
 "ldap_bind_dn" : "", 
 "ldap_bind_password" : "",
 "ldap_insecure" : true, 
 "ldap_base_ou" : "OU=people,DC=domain,DC=local", 
 "ldap_preferred_username" : "uid"
}
  • node['cookbook-openshift3']['openshift_master_asset_config']
{
 "extensionStylesheets":["/path/to/css"],
 "extensionScripts":["/path/to/script"],
 "extensions":"/path/to/my_images",
 "templates":"/path/to/template"
}
  • node['cookbook-openshift3']['nameserver']
{
 "search": "domain.local",
 "domain": "domain.local",
 "nameservers": ["8.8.8.8","8.8.4.4"],
 "key_algorithm": "hmac-md5",
 "key_name": "domain.local.key",
 "key_secret": "DTngw5O8I5Axx631GjQ9pA=="
}
  • node['cookbook-openshift3']['openshift_node_docker-storage']
{
 "DEVS": ["/dev/sdb","/dev/sdc"],
 "VG": "docker-vg",
 "DATA_SIZE": "80%FREE"
}
  • node['cookbook-openshift3']['openshift_master_named_certificates']

  • CN or SAN names are automatically detected from the certificate file.

[
  {
   "certfile": "/etc/where_is/my_certfile",
   "keyfile": "/etc/where_is/my_keyfile"
  }
]

=====

Include the recipes in roles so as to ease the deployment.

Roles (Examples)

  • BASE
{
  "name": "base",
  "description": "Common Base Role",
  "json_class": "Chef::Role",
  "default_attributes": {

  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[cookbook-openshift3]",
    "recipe[cookbook-openshift3::common]",
    "recipe[cookbook-openshift3::master]",
    "recipe[cookbook-openshift3::node]"
  ],
  "env_run_lists": {

  }
}

ENVIRONMENT

Create at least 3 environments which would be assigned to nodes based on their profiles (single, cluster-native, cluster-pcs).
Please not that clsuter-pcs which relies on Pacemaker is only supported by Openshift <= 3.1.x.

Modify the attributes as required in your environments to change how various configurations are applied per the attributes section above.
In general, override attributes in the environment should be used when changing attributes.

Minimal example

  • CLUSTER-NATIVE (Only available option since 3.2)
{
  "name": "cluster_native",
  "description": "",
  "cookbook_versions": {

  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {

  },
  "override_attributes": {
    "cookbook-openshift3": {
      "openshift_HA": true,
      "openshift_cluster_name": "ose-cluster.domain.local",
      "openshift_master_cluster_vip": "1.1.1.100",
      "master_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "master_peers": [
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "etcd_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "node_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        },
        {
          "fqdn": "ose4-server.domain.local",
          "ipaddress": "1.1.1.4"
        },
        {
          "fqdn": "ose5-server.domain.local",
          "ipaddress": "1.1.1.5"
        },        
      ],
    }
  }
}
  • CLUSTER-PCS (only supported when using OpenShift < 3.2)
{
  "name": "cluster_pcs",
  "description": "",
  "cookbook_versions": {

  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {

  },
  "override_attributes": {
    "cookbook-openshift3": {
      "openshift_HA": true,
      "openshift_HA_method": "pcs",
      "openshift_master_cluster_vip": "1.1.1.100",
      "openshift_cluster_name": "ose-cluster.domain.local",
      "master_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "master_peers": [
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "etcd_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        }
      ],
      "node_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        },
        {
          "fqdn": "ose3-server.domain.local",
          "ipaddress": "1.1.1.3"
        },
        {
          "fqdn": "ose4-server.domain.local",
          "ipaddress": "1.1.1.4"
        },
        {
          "fqdn": "ose5-server.domain.local",
          "ipaddress": "1.1.1.5"
        },        
      ],
    }
  }
}
  • SINGLE
{
  "name": "single",
  "description": "",
  "cookbook_versions": {

  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {

  },
  "override_attributes": {
    "cookbook-openshift3": {
      "master_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        }
      ],
      "node_servers": [
        {
          "fqdn": "ose1-server.domain.local",
          "ipaddress": "1.1.1.1"
        },
        {
          "fqdn": "ose2-server.domain.local",
          "ipaddress": "1.1.1.2"
        }
      ],
    }
  }
}

Once it is done you should assign the node to the relevant environment.

knife node environment set NODE_NAME ENVIRONMENT_NAME

LWRP

Create a DNS record using LWRP - ose_reghost

ose_reghost node["fqdn"] do
  type :a
  keyalgo "HMAC-MD5"
  keyname "example.com"
  keysecret "ddwDEdeedEEEdddd=ee=de=="
  action :create
end

Delete a DNS record using LWRP - ose_reghost

ose_reghost node["fqdn"] do
  type :a
  keyalgo "HMAC-MD5"
  keyname "example.com"
  keysecret "ddwDEdeedEEEdddd=ee=de=="
  action :delete
end
ose_setup_cluster 'Setup Pacemaker' do
  master_hosts ['1.1.1.1', '2.2.2.2', '3.3.3.3'] 
  cluster_password 'password_for_pacemaker'
  action :setup
end
ose_setup_cluster 'Wait until the VIP is up and running on the master server' do 
  action :init
end

Run list

knife node run_list add NODE_NAME 'role[base]'

Test (ORIGIN)

There is a way to quickly test this cookbook.
You will need a CentOS 7.1+ with "Minimal" installation option and at least 10GB left on the Volume group. (Later used by Docker)

  • Deploy ORIGIN ALL IN THE BOX Flavour (MASTER + NODE) bash <(curl -s https://raw.githubusercontent.com/IshentRas/cookbook-openshift3/master/origin_deploy.sh)

Development

License and Author

Author: William Burton (wburton@redhat.com)

The MIT License (MIT)

Copyright (C) 2014 OpenBet Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dependent cookbooks

iptables >= 2.0.0
selinux_policy >= 0.0.0
yum >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Openshift 3 Cookbook CHANGELOG

This file is used to list changes made in each version of the Openshift 3 cookbook.

v1.10.9

Bug

  • Fix URL for master API

Improvement

  • Clarify use of masterPublicURL, publicURL and masterURL

v1.10.8

Improvement

  • Simplify the creation of node/master servers

v1.10.7

Bug

  • Fix issue for dnsmasq

v1.10.6

Bug

  • Fix issue for documentation

v1.10.5

Bug

  • Fix issue for documentation

v1.10.4

Bug

  • Fix issue for restarting openshift-api or controllers
  • Fix issue for restarting node

Improvement

  • Update Openshift documentation
  • Use chef-solo attribute style as a default for setting attributes
  • Remove queries for any type of data that is indexed by the Chef server

v1.10.3

Bug

  • Fix issue for Openshift Node (Clashing ClusterNetwork)
  • Fix issue for generating certificates (NODES)

Improvement

  • Add capability for deploying 3.2.x
  • Add capability for deploying containerized version of Openshift
  • Add capability of using dnsmasq for interacting with skyDNS
  • Update Openshift template examples

v1.10.2

Bug

  • Fix issue for nodes certificate SAN

v1.10.1

Bug

  • Fix issue for ETCD certificate lifetime
  • Fix IP discovery for origin_deploy.sh

Improvement

  • Add capability for enabling or not a yum repository

v1.10.0

Bug

  • Fix docker restrart when running CHEF
  • Fix openshift-master restart when running CHEF
  • Fix openshift-node restart when running CHEF

v1.0.9

Bug

  • Remove dnsIP from node definiton. Default to use the kubernetes service network 172.x.x.1

v1.0.8

Improvement

  • Add kubeletArguments for node servers

Bug

  • Enable Docker at startup
  • Mask master service when running native HA

v1.0.7

Improvement

  • Add possibility to disable yum repositories
  • Fix etcd certificate (Simplify the call for peers members)
  • Add possibility to specify a version to be installed for docker

Bug

  • Fix permissions for directory (Set to Apache in case of a dodgy umask number)

v1.0.6

Improvement

  • Add delay/retry before installing servcieaccount
  • Change xip.io for nip.io (STABLE)

Bug

  • Fix scripts/origin_deploy.sh
  • Fix hostname for origin_deploy.sh

v1.0.5

Bug

  • Fix bug when enabling HTTPD at startup

v1.0.4

Improvement

  • Detect the CN or SAN from certificates file when using named certificates.
  • Move origin_deploy.sh in scripts folder

Bug

  • Enable HTTPD at startup
  • Fix some typos

v1.0.3

Improvement

  • Add possibility to customise docker-storage-setup
  • Add possibility for configuring Custom Certificates

v1.0.2

Improvement

  • Add MIT LICENCE model
  • Add script to auto deploy origin instance
  • Add the possibility to exclude packages from updates or installs

Bug fix

  • Fix attributes labelling when using chef in local mode (or solo)
  • Remove specific mentions to OSE

v0.0.1

  • Current public release

Collaborator Number Metric
            

1.10.9 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Foodcritic Metric
            

1.10.9 passed this metric