├── .gitignore ├── CONTRIBUTING.adoc ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.adoc ├── TESTING.adoc ├── add-ons ├── ansible-service-broker │ ├── README.md │ ├── ansible-service-broker.addon │ └── ansible-service-broker.addon.remove ├── che │ └── README.md ├── cockpit │ ├── README.md │ ├── cockpit-template.json │ └── cockpit.addon ├── cors │ ├── README.md │ └── cors.addon ├── debezium │ ├── README.md │ ├── debezium.addon │ └── register.json ├── dotnet │ ├── README.md │ └── dotnet.addon ├── dynamic-admission-controllers │ ├── dynamic-admission-controllers.addon │ └── dynamic-admission-controllers.addon.remove ├── eap-cd │ ├── eap-cd.addon │ ├── imagestream │ │ └── eap-cd-image-stream.json │ └── templates │ │ ├── eap-cd-amq-persistent-s2i.json │ │ ├── eap-cd-amq-s2i.json │ │ ├── eap-cd-basic-s2i.json │ │ ├── eap-cd-https-s2i.json │ │ ├── eap-cd-mongodb-persistent-s2i.json │ │ ├── eap-cd-mongodb-s2i.json │ │ ├── eap-cd-mysql-persistent-s2i.json │ │ ├── eap-cd-mysql-s2i.json │ │ ├── eap-cd-postgresql-persistent-s2i.json │ │ ├── eap-cd-postgresql-s2i.json │ │ ├── eap-cd-sso-s2i.json │ │ ├── eap-cd-starter-s2i.json │ │ ├── eap-cd-third-party-db-s2i.json │ │ ├── eap-cd-tx-recovery-postgresql-s2i.json │ │ └── eap-cd-tx-recovery-s2i.json ├── example │ ├── example.addon │ └── example.addon.remove ├── fabric8-launcher │ ├── README.md │ ├── fabric8-launcher.addon │ └── fabric8-launcher.addon.remove ├── fabric8 │ ├── README.md │ └── fabric8.addon ├── grafana │ ├── README.md │ ├── cluster-metrics-per-namespace.json │ ├── grafana.addon │ └── openshift-template-persistent.yml ├── helm │ ├── README.md │ ├── helm.addon │ └── version ├── htpasswd-identity-provider │ ├── README.adoc │ ├── htpasswd-identity-provider.addon │ └── htpasswd-identity-provider.addon.remove ├── istio │ ├── README.adoc │ ├── installation.yaml │ ├── istio.addon │ ├── istio.addon.remove │ └── istio_community_operator_template.yaml ├── kube-dashboard │ ├── README.md │ └── kube-dashboard.addon ├── management-infra │ ├── README.md │ ├── hawkular-metrics-admin.yaml │ ├── management-infra-admin.yaml │ └── management-infra.addon ├── openwhisk │ ├── README.md │ ├── openwhisk.addon │ └── openwhisk.addon.remove ├── prometheus │ ├── README.md │ ├── prometheus.addon │ └── prometheus.yaml └── workshop │ ├── README.md │ └── workshop.addon ├── centos_ci.sh └── test ├── integration ├── features │ ├── addon-eap-cd.feature │ ├── cors.feature │ ├── dynamic-admission-controllers.feature │ ├── example.feature │ └── istio.feature └── integration_test.go └── utils └── minishift_latest_version.py /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | testing 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.adoc: -------------------------------------------------------------------------------- 1 | [[contribution-guidelines]] 2 | = Contribution guidelines 3 | 4 | [[filing-issues]] 5 | == Filing issues 6 | 7 | File issues using the standard 8 | https://github.com/minishift/minishift-addons/issues[Github issue tracker] for the repository. 9 | Before you submit a new issue, we recommend that you search the list of issues to see if anyone already submitted a similar issue. 10 | 11 | [[contributing-patches]] 12 | == Contributing patches 13 | 14 | Thank you for your contributions! Please follow this process to submit a patch: 15 | 16 | . Create an issue describing your proposed change to the repository. 17 | . Fork the repository and create a topic branch. 18 | . Submit a pull request with the proposed changes. 19 | .. The required format for the git commit message is 'Issue # message'. 20 | 21 | NOTE: If you submit a new add-on, the add-on must be added as a sub-directory in the *_/add-ons/_* sub-directory of the repository. 22 | See the documentation for information about link:https://docs.okd.io/latest/minishift/using/addons.html#add-ons-overview[file structure and content format]. 23 | 24 | NOTE: We also recommend providing integration tests for the add-on. 25 | See the link:TESTING.adoc[integration tests documentation] for more information. 26 | 27 | [[questions]] 28 | == Questions? 29 | 30 | If you run into issues or have any questions about contributions, you can reach the Minishift community by: 31 | 32 | - Signing up to our https://lists.minishift.io/admin/lists/minishift.lists.minishift.io[mailing list] 33 | - Joining the #minishift channel on https://freenode.net/[Freenode IRC] 34 | -------------------------------------------------------------------------------- /Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | branch = "master" 6 | name = "github.com/Azure/go-ansiterm" 7 | packages = [ 8 | ".", 9 | "winterm" 10 | ] 11 | revision = "d6e3b3328b783f23731bc4d058875b0371ff8109" 12 | 13 | [[projects]] 14 | name = "github.com/DATA-DOG/godog" 15 | packages = [ 16 | ".", 17 | "colors", 18 | "gherkin" 19 | ] 20 | revision = "0371765570d36374bef4ab9f62ed0491f0862a3c" 21 | version = "v0.7.6" 22 | 23 | [[projects]] 24 | name = "github.com/asaskevich/govalidator" 25 | packages = ["."] 26 | revision = "7b3beb6df3c42abd3509abfc3bcacc0fbfb7c877" 27 | version = "v5" 28 | 29 | [[projects]] 30 | name = "github.com/blang/semver" 31 | packages = ["."] 32 | revision = "b38d23b8782a487059e8fc8773e9a5b228a77cb6" 33 | version = "v3.5.0" 34 | 35 | [[projects]] 36 | branch = "master" 37 | name = "github.com/docker/docker" 38 | packages = [ 39 | "pkg/term", 40 | "pkg/term/windows" 41 | ] 42 | revision = "1ef1cc8388165b2b848f9b3f53ec91c87de09f63" 43 | 44 | [[projects]] 45 | name = "github.com/docker/go-units" 46 | packages = ["."] 47 | revision = "0bbddae09c5a5419a8c6dcdd7ff90da3d450393b" 48 | 49 | [[projects]] 50 | name = "github.com/docker/machine" 51 | packages = [ 52 | "libmachine/drivers", 53 | "libmachine/log", 54 | "libmachine/mcnflag", 55 | "libmachine/mcnutils", 56 | "libmachine/ssh", 57 | "libmachine/state", 58 | "version" 59 | ] 60 | revision = "b48dc28d9139c93d166f07d8b3a049b59bceef9c" 61 | version = "v0.15.0" 62 | 63 | [[projects]] 64 | name = "github.com/elazarl/goproxy" 65 | packages = ["."] 66 | revision = "aacba83f36a55ac31cbb71c06547a328c0cd1604" 67 | 68 | [[projects]] 69 | name = "github.com/gbraad/go-hvkvp" 70 | packages = ["."] 71 | revision = "a692e030379b6de28a10b7697decdf8109899f6e" 72 | version = "0.3" 73 | 74 | [[projects]] 75 | name = "github.com/golang/glog" 76 | packages = ["."] 77 | revision = "335da9dda11408a34b64344f82e9c03779b71673" 78 | source = "https://github.com/openshift/glog.git" 79 | 80 | [[projects]] 81 | name = "github.com/kardianos/osext" 82 | packages = ["."] 83 | revision = "ae77be60afb1dcacde03767a8c37337fad28ac14" 84 | 85 | [[projects]] 86 | branch = "master" 87 | name = "github.com/minishift/minishift" 88 | packages = [ 89 | "pkg/minikube/constants", 90 | "pkg/minishift/config", 91 | "pkg/minishift/constants", 92 | "pkg/minishift/hostfolder/config", 93 | "pkg/minishift/network", 94 | "pkg/minishift/shell/powershell", 95 | "pkg/util", 96 | "pkg/util/cmd", 97 | "pkg/util/filehelper", 98 | "pkg/util/os", 99 | "pkg/util/os/atexit", 100 | "pkg/util/strings", 101 | "pkg/version", 102 | "test/integration/proxy", 103 | "test/integration/testsuite", 104 | "test/integration/util" 105 | ] 106 | revision = "e4d359a30b6a167a9b59842530f28016c44a7623" 107 | 108 | [[projects]] 109 | name = "github.com/pkg/errors" 110 | packages = ["."] 111 | revision = "645ef00459ed84a119197bfb8d8205042c6df63d" 112 | version = "v0.8.0" 113 | 114 | [[projects]] 115 | name = "github.com/sirupsen/logrus" 116 | packages = ["."] 117 | revision = "3e01752db0189b9157070a0e1668a620f9a85da2" 118 | version = "v1.0.6" 119 | 120 | [[projects]] 121 | name = "golang.org/x/crypto" 122 | packages = [ 123 | "curve25519", 124 | "ed25519", 125 | "ed25519/internal/edwards25519", 126 | "ssh", 127 | "ssh/terminal" 128 | ] 129 | revision = "b080dc9a8c480b08e698fb1219160d598526310f" 130 | 131 | [[projects]] 132 | branch = "master" 133 | name = "golang.org/x/sys" 134 | packages = [ 135 | "unix", 136 | "windows" 137 | ] 138 | revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" 139 | 140 | [[projects]] 141 | name = "gopkg.in/yaml.v2" 142 | packages = ["."] 143 | revision = "a3f3340b5840cee44f372bddb5880fcbc419b46a" 144 | 145 | [solve-meta] 146 | analyzer-name = "dep" 147 | analyzer-version = 1 148 | inputs-digest = "d209bdee5f8b1657772ff0d088877bb5de9d42fc0c2c8caf5d9659f3789b1bc4" 149 | solver-name = "gps-cdcl" 150 | solver-version = 1 151 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | 28 | [[constraint]] 29 | name = "github.com/DATA-DOG/godog" 30 | version = "=0.7.6" 31 | 32 | [[constraint]] 33 | name = "github.com/minishift/minishift" 34 | branch = "master" 35 | 36 | [prune] 37 | go-tests = true 38 | unused-packages = true 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Red Hat, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Setting up paths 16 | REPOPATH ?= github.com/minishift/minishift-addons 17 | TEST_DIR ?= $(CURDIR)/testing 18 | BIN_DIR ?= $(TEST_DIR)/bin 19 | 20 | MINISHIFT_LATEST_URL=http://artifacts.ci.centos.org/minishift/minishift/master/latest 21 | 22 | GOOS ?= $(shell go env GOOS) 23 | GOARCH ?= $(shell go env GOARCH) 24 | ORG := github.com/minishift 25 | 26 | # Platfrom dependency 27 | ifeq ($(GOOS),windows) 28 | IS_EXE := .exe 29 | endif 30 | 31 | # Integration tests 32 | TIMEOUT ?= 3600s 33 | MINISHIFT_BINARY ?= $(TEST_DIR)/bin/minishift$(IS_EXE) 34 | 35 | # Make target definitions 36 | default: 37 | @echo "Nothing to make. Run 'make integration' to run integration tests." 38 | 39 | .PHONY: integration 40 | integration: ADDON ?= "" 41 | integration: vendor 42 | integration: $(BIN_DIR)/minishift 43 | integration: 44 | mkdir -p $(TEST_DIR)/integration-test 45 | go test -timeout $(TIMEOUT) $(REPOPATH)/test/integration --tags=integration -v -args --test-dir $(TEST_DIR)/integration-test --binary $(MINISHIFT_BINARY) \ 46 | --run-before-feature="$(RUN_BEFORE_FEATURE)" --test-with-specified-shell="$(TEST_WITH_SPECIFIED_SHELL)" --tags=$(ADDON) $(GODOG_OPTS) 47 | 48 | vendor: 49 | dep ensure -v 50 | 51 | $(BIN_DIR)/minishift: 52 | @echo "Downloading latest minishift binary at $(BIN_DIR)/minishift$(IS_EXE)..." 53 | @mkdir -p $(BIN_DIR) 54 | @cd $(BIN_DIR) && \ 55 | curl -LO --progress-bar $(MINISHIFT_LATEST_URL)/$(GOOS)-$(GOARCH)/minishift$(IS_EXE) && \ 56 | chmod 755 minishift$(IS_EXE) 57 | @echo "Done." 58 | 59 | .PHONY: clean 60 | clean: 61 | rm -rf $(TEST_DIR) 62 | rm -rf vendor 63 | rm -rf $(GOPATH)/pkg/$(GOOS)_$(GOARCH)/$(ORG) 64 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | [[minishift-addons]] 2 | = Minishift Add-ons 3 | :icons: 4 | :toc: macro 5 | :toc-title: 6 | :toclevels: 1 7 | 8 | toc::[] 9 | 10 | This repository contains add-ons contributed by the Minishift community. 11 | 12 | We hope that by sharing these add-ons, folks in the community will be able to make the most out of their Minishift environment. 13 | Community add-ons are tested and supported by the community. 14 | 15 | [[introduction-addons]] 16 | == Introduction 17 | 18 | link:https://docs.okd.io/latest/minishift/using/addons.html[Minishift add-ons] are extensions, or plug-ins, that customize the default OpenShift cluster configuration and behavior. 19 | For example, you can use the link:https://github.com/minishift/minishift/tree/master/addons/anyuid[anyuid] add-on to allow authenticated users to run images without a pre-allocated UID, or the link:https://github.com/minishift/minishift/tree/master/addons/registry-route[registry-route] add-on to expose the OpenShift registry as a route. 20 | 21 | Minishift includes several link:https://docs.okd.io/latest/minishift/using/addons.html#default-addons[default add-ons], which are installed automatically when you first start Minishift. 22 | These add-ons are tested and supported by the Minishift core team. 23 | You can also write your own link:https://docs.okd.io/latest/minishift/using/addons.html#custom-addons[custom add-ons] that use any of the link:https://docs.okd.io/latest/minishift/using/addons.html#addon-commands[supported add-on commands]. 24 | 25 | [[share-addons-with-community]] 26 | == Share your add-ons with the community 27 | 28 | You are invited to share your add-ons with the Minishift community by submitting them to this repository. 29 | To submit your add-on, follow the link:CONTRIBUTING.adoc[contribution guidelines] to open a new issue and submit a pull request. 30 | 31 | Community add-ons are not officially supported by the Minishift core team, although the core developers do their best to help out when reviewing and merging new add-ons to this repository. 32 | The community is encouraged to help contributors by testing and improving these add-ons. 33 | 34 | [[download-use-community-addons]] 35 | == Download and use community add-ons 36 | 37 | To use any of the add-ons from this repository in your Minishift environment: 38 | 39 | . Clone the repository to your local machine. 40 | 41 | . Install the add-on that you want to use by running the following command: 42 | + 43 | ---- 44 | $ minishift addons install 45 | ---- 46 | 47 | . Choose whether to apply the add-on to a running Minishift VM or enable the add-on to start each time that Minishift starts. 48 | + 49 | - To apply the add-on once to a running Minishift VM, run the following command: 50 | + 51 | ---- 52 | $ minishift addons apply 53 | ---- 54 | + 55 | - To enable the add-on to start each time that Minishift starts, run the following command: 56 | + 57 | ---- 58 | $ minishift addons enable 59 | ---- 60 | 61 | For more information about enabling, disabling, and applying add-ons, see the link:https://docs.okd.io/latest/minishift/using/addons.html[Add-ons] topic in the Minishift documentation. 62 | 63 | [[ci-setup]] 64 | == CI Setup 65 | 66 | `minishift-addons` uses link:https://ci.centos.org/[CentOS CI] as CI build server. 67 | A link:https://ci.centos.org/job/minishift-addons-pr/[pull request build job] will be triggered for every pull request. 68 | However, the build job runs the integration tests only when the pull request contains any change related to add-on. 69 | Also, a link:https://ci.centos.org/job/minishift-addons-nightly-centos/[nightly job] runs daily at midnight. 70 | It execute all available add-on link:https://github.com/minishift/minishift-addons/tree/master/test/integration/features[integration tests] against the _master_ branch of the `minishift-addons` GitHub repository with link:https://github.com/minishift/minishift-centos-iso[CentOS ISO]. 71 | 72 | [[contact-community]] 73 | == Contact the Minishift community 74 | 75 | Minishift is an open-source project dedicated to developing and supporting Minishift. 76 | Contributions, questions, and comments are all welcomed and encouraged! 77 | 78 | You can reach the Minishift community by: 79 | 80 | - Signing up to our https://lists.minishift.io/admin/lists/minishift.lists.minishift.io[mailing list] 81 | - Joining the #minishift channel on https://freenode.net/[Freenode IRC] 82 | -------------------------------------------------------------------------------- /TESTING.adoc: -------------------------------------------------------------------------------- 1 | [[integration-tests]] 2 | = Integration Testing for Add-ons 3 | :icons: 4 | :toc: macro 5 | :toc-title: 6 | :toclevels: 1 7 | 8 | toc::[] 9 | 10 | [[introduction]] 11 | == Introduction 12 | This repository uses the integration test suite from the link:https://github.com/minishift/minishift[*minishift/minishift*] repository to test the functionality of Minishift add-ons. 13 | The test suite is written in Go and uses the Gherkin language to define test sets. 14 | This allows add-on contributors to write tests effectively using predefined, understandable sentences. 15 | For example: 16 | 17 | ```gherkin 18 | Scenario: Applying the CORS add-on 19 | Given Minishift has state "Running" 20 | When executing "minishift addons apply cors" succeeds 21 | Then stdout should contain "CORS is now allowed from any address" 22 | ``` 23 | 24 | [NOTE] 25 | ==== 26 | We recommend aligning white space to the ends of the Gherkin keywords `Given`, `When`, `Then`, and `And`. 27 | ==== 28 | 29 | See the link:https://github.com/cucumber/cucumber/wiki/Gherkin[Gherkin wiki] for more information about Gherkin. 30 | More in-depth information about the Minishift integration test suite can be found in the link:https://docs.okd.io/latest/minishift/contributing/developing.html#integration-tests[Developing Minishift] documentation. 31 | 32 | [[structure-of-tests]] 33 | === Structure of Tests 34 | Feature files which define the test cases for each individual add-on are stored in the *_test/integration/features_* directory. 35 | The feature files follow the naming convention of `.feature` and begin with the tag `@`. 36 | 37 | Integration tests are implemented in the *_test/integration/integration_test.go_* file. 38 | This file imports the test suite from the Minishift repository and can be used for the import of additional step definitions. 39 | 40 | [[prerequisites]] 41 | == Prerequisites 42 | You must do the following to run the tests successfully: 43 | 44 | - Install link:https://docs.okd.io/latest/minishift/getting-started/installing.html[Minishift and its prerequisites]. 45 | - Install a recent link:https://golang.org/dl/[Go distribution] (>=1.8). 46 | - Install the link:https://github.com/golang/dep[dep package] with the following: `go get -u github.com/golang/dep/cmd/dep` 47 | - `git clone` this repository into *_$GOPATH/src/github.com/minishift/minishift-addons_*. 48 | - Get the latest `minishift` binary from https://github.com/minishift/minishift/releases/latest and place it in *_testing/bin_*. 49 | - Vendor the needed Go packages by runining `make vendor` in the root directory of the *minishift-addons* repository. 50 | 51 | [NOTE] 52 | ==== 53 | We recommend vendoring the packages after every `git pull` from the *minishift-addons* master branch. 54 | ==== 55 | 56 | [[running-tests]] 57 | == Running Tests 58 | To run integration tests for a specific add-on, go to the root directory of the *minishift-addons* repository and run the following command: 59 | 60 | ``` 61 | make integration ADDON= 62 | ``` 63 | 64 | This command will start tests on all Gherkin feature files present in *_tests/integration/features_* which contain the tag `@`. 65 | For most add-ons, this will mean using one feature file located at *_tests/integration/features/.feature_*. 66 | 67 | To run the tests on all add-ons, you can use the following: 68 | 69 | ``` 70 | make integration 71 | ``` 72 | 73 | [[additional-options]] 74 | === Additional Options 75 | It is possible to run the tests with a Minishift binary located outside of the default location of *_testing/bin_*. 76 | To do so, use the `MINISHIFT_BINARY` parameter with the `make integration` target. 77 | For example: 78 | 79 | ``` 80 | make integration ADDON=xpaas MINISHIFT_BINARY=/home/user/minishift/minishift 81 | ``` 82 | 83 | [[writing-tests]] 84 | == Writing Tests 85 | Create a new file named *_tests/integration/features/.feature_* to create a new integration test for an add-on. 86 | The *_example.feature_* file demonstrates the basic structure of an integration test for an example add-on and may be used as a starting point. 87 | 88 | Features should contain at least 6 key parts which secure that the tested add-on can be installed, applied, removed and uninstalled: 89 | 90 | - Installation of the add-on: `executing "minishift addons install ../../add-ons/" succeeds` 91 | - Starting of Minishift: `executing "minishift start" succeeds` 92 | - Application of the add-on: `executing "minishift addons apply " succeeds` 93 | - Removal of the add-on: `executing "minishift addons remove " succeeds` 94 | - Add-on uninstallation: `executing "minishift addons uninstall " succeeds` 95 | - Deletion of the Minishift instance: `executing "minishift delete --force" succeeds` 96 | 97 | [[advanced-steps]] 98 | === Advanced Steps 99 | The Minishift *testsuite* package contains step definitions which can cover the functionality of an add-on in more detail. 100 | For example: 101 | 102 | - Evaluation of Minishift commands: `stdout of command "minishift ssh -- docker ps" contains "my-container"` 103 | - Execution of `oc` commands: `executing "oc login --username=developer --password=developer" succeeds` 104 | - Checking for OpenShift console accessibility: `"status code" of HTTP request to "/console" of OpenShift instance is equal to "200"` 105 | - Checking if the HTTP endpoint of an application is accessible and contains the expected data: `"body" of HTTP request to "/" of service "ruby-ex" in namespace "ruby" contains "Welcome to your Ruby application on OpenShift"` 106 | 107 | Check the implementation of the provided step definitions in Minishift's link:https://github.com/minishift/minishift/tree/master/test/integration/testsuite[testsuite package] for more information. 108 | -------------------------------------------------------------------------------- /add-ons/ansible-service-broker/README.md: -------------------------------------------------------------------------------- 1 | Ansible Service Broker Addon 2 | ====================== 3 | 4 | This addon installs the [Ansible Service Broker](https://github.com/openshift/ansible-service-broker). The Ansible Service Broker 5 | is an Open Service Broker designed to deploy [Ansible Playbook Bundles](https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/) (hereafter referred to as APBs). 6 | 7 | # Prerequisites 8 | 9 | This addon is designed for an RBAC enabled OpenShift cluster of `>=3.9`. Minishift can be configured to 10 | deploy 3.9 with the following command: 11 | 12 | ``` 13 | $ minishift config set openshift-version v3.9.0 14 | ``` 15 | 16 | Minishift must be deployed with the Service Catalog enabled 17 | 18 | **NOTE**: Prior to minishift `v1.16.1`, minishift was installed with the Service 19 | Catalog in a different way. These instructions are for minishift `>=v1.16.1`, 20 | and it is strongly recommended that this version or greater is used. 21 | 22 | The Service Catalog can be deployed by adding the `--service-catalog` when starting Minishift. The ability to pass extra flags during startup can be enabled by setting the _MINISHIFT_ENABLE_EXPERIMENTAL_ environmental variable as follows: 23 | 24 | ``` 25 | $ export MINISHIFT_ENABLE_EXPERIMENTAL=y 26 | ``` 27 | 28 | Configure minishift to deploy the centos iso: 29 | 30 | 31 | ``` 32 | $ minishift config set iso-url centos 33 | ``` 34 | 35 | Note: CentOS ISO is required for Fedora, CentOS, or RHEL hosts due to a [known issue](https://docs.okd.io/latest/minishift/troubleshooting/troubleshooting-misc.html#authentication-required-to-push-image) between the host's docker client and the default boot2docker iso. 36 | 37 | Start Minishift with the `--service-catalog` extra flag. See the [OpenShift documentation](https://docs.okd.io/latest/minishift/using/experimental-features.html#enabling-experimental-oc-flags) for more info on `--extra-cluster-up` flags. 38 | 39 | ``` 40 | minishift start --extra-clusterup-flags "--service-catalog" 41 | ``` 42 | 43 | 44 | If you are planning on building or pushing to the minishift registry, be sure 45 | to configure your shell using `eval $(minishift docker-env)`. This configures your environment 46 | so that the apb tool can use the minishift registry. [See minishift documentation for more details](https://docs.okd.io/latest/minishift/openshift/openshift-docker-registry.html). 47 | 48 | # Deploy the Ansible Service Broker 49 | 50 | 1. Make sure this repository is cloned to the local machine 51 | 2. Install the addon 52 | 53 | 54 | ``` 55 | $ minishift addons install 56 | ``` 57 | 58 | ## Addon Variables 59 | 60 | To customize the deployment of the Ansible Service Broker, the following variables can be applied to the execution: 61 | 62 | |Name|Description|Default Value| 63 | |----|-----------|-------------| 64 | |`BROKER_REPO_TAG`|Tag used to specify the broker's template in the upstream asb repo|`ansible-service-broker-1.1.6-1`| 65 | |`APBTOOLS_REPO_TAG`|Tag used to specify the apb tooling permission template in the upstream apb repo|`apb-1.1.6-1`| 66 | |`DOCKERHUB_ORG`|Organization to query for Ansible Playbook Bundles in DockerHub|`ansibleplaybookbundle`| 67 | 68 | Variables can be specified by adding `--addon-env ` when the addon is being invoked (`minishift start` or `minishift addons apply`) 69 | 70 | ## Apply the Addon 71 | 72 | To apply the addon to a running instance of Minishift, execute the following command: 73 | 74 | ``` 75 | $ minishift addons apply ansible-service-broker 76 | ``` 77 | 78 | To enable the addon each time Minishift starts, execute the following command: 79 | 80 | ``` 81 | $ minishift addons enable ansible-service-broker 82 | ``` 83 | 84 | ## Remove the Addon 85 | 86 | To remove all of the deployed components, execute the following command 87 | 88 | ``` 89 | $ minishift addons remove ansible-service-broker 90 | ``` 91 | 92 | ## Uninstall the addon 93 | 94 | To uninstall the addon, execute the following command 95 | 96 | ``` 97 | $ minishift addons uninstall ansible-service-broker 98 | ``` 99 | -------------------------------------------------------------------------------- /add-ons/ansible-service-broker/ansible-service-broker.addon: -------------------------------------------------------------------------------- 1 | # Name: ansible-service-broker 2 | # Description: Deploys the Ansible Service Broker 3 | # OpenShift-Version: >=3.9.0 4 | # Required-Vars: BROKER_REPO_TAG, APBTOOLS_REPO_TAG, DOCKERHUB_ORG 5 | # Var-Defaults: BROKER_REPO_TAG=ansible-service-broker-1.2.9-1, APBTOOLS_REPO_TAG=release-1.1, DOCKERHUB_ORG=ansibleplaybookbundle 6 | 7 | # Create ansible-service-broker project 8 | oc new-project ansible-service-broker 9 | 10 | # Add upstream broker deployment template to the project 11 | oc create -n ansible-service-broker -f https://raw.githubusercontent.com/openshift/ansible-service-broker/#{BROKER_REPO_TAG}/templates/deploy-ansible-service-broker.template.yaml 12 | oc create -n ansible-service-broker -f https://raw.githubusercontent.com/ansibleplaybookbundle/ansible-playbook-bundle/#{APBTOOLS_REPO_TAG}/templates/openshift-permissions.template.yaml 13 | 14 | ## Instantiate Template, wrap in docker execs 15 | docker exec origin /bin/bash -c $'oc process ansible-service-broker -n ansible-service-broker -p BROKER_IMAGE=ansibleplaybookbundle/origin-ansible-service-broker:#{BROKER_REPO_TAG} -p DOCKERHUB_ORG=#{DOCKERHUB_ORG} -p ROUTING_SUFFIX=#{routing-suffix} -p BROKER_CA_CERT=$(oc get secret -n kube-service-catalog -o go-template=\'{{ range .items }}{{ if eq .type \"kubernetes.io/service-account-token\" }}{{ index .data \"service-ca.crt\" }}{{end}}{{\"\\n\"}}{{end}}\' | tail -n 1) | oc create -n ansible-service-broker -f-' 16 | docker exec origin /bin/bash -c $'oc process apbtools-permission -n ansible-service-broker | oc create -f-' 17 | 18 | echo Ansible Service Broker Deployed 19 | echo User [ developer ] has been given permission for usage with the apb tools 20 | -------------------------------------------------------------------------------- /add-ons/ansible-service-broker/ansible-service-broker.addon.remove: -------------------------------------------------------------------------------- 1 | # Name: ansible-service-broker 2 | # Description: Removes the Ansible Service Broker 3 | # OpenShift-Version: >=3.9.0 4 | # Required-Vars: BROKER_REPO_TAG, APBTOOLS_REPO_TAG 5 | # Var-Defaults: BROKER_REPO_TAG=ansible-service-broker-1.2.8-1, APBTOOLS_REPO_TAG=release-1.1 6 | 7 | oc delete clusterrolebinding asb-auth-bind 8 | oc delete clusterrolebinding asb 9 | oc delete clusterrolebinding ansibleservicebroker-client 10 | 11 | oc delete clusterrole asb-auth 12 | oc delete clusterrole access-asb-role 13 | 14 | oc delete clusterservicebroker ansible-service-broker 15 | 16 | oc delete project ansible-service-broker 17 | 18 | oc delete clusterrolebinding apbtool-relist 19 | oc delete clusterrole apbtool-relist 20 | 21 | oc delete clusterrolebinding apbtool-system-registry 22 | oc delete clusterrolebinding apbtool-system-image-builder 23 | 24 | oc delete -n openshift rolebinding apbtool-openshift-admin 25 | 26 | oc delete -n ansible-service-broker -f https://raw.githubusercontent.com/openshift/ansible-service-broker/#{BROKER_REPO_TAG}/templates/deploy-ansible-service-broker.template.yaml 27 | oc delete -n ansible-service-broker -f https://raw.githubusercontent.com/ansibleplaybookbundle/ansible-playbook-bundle/#{APBTOOLS_REPO_TAG}/templates/openshift-permissions.template.yaml 28 | -------------------------------------------------------------------------------- /add-ons/che/README.md: -------------------------------------------------------------------------------- 1 | Please open issues or pull requests for Che add-on in [Minishift repository](https://github.com/minishift/minishift/) as it is moved there. 2 | Che is a default Minishift add-on now. 3 | -------------------------------------------------------------------------------- /add-ons/cockpit/README.md: -------------------------------------------------------------------------------- 1 | # Cockpit Add-on 2 | An addon to install [cockpit](http://cockpit-project.org/). 3 | 4 | Verify you have installed these addons, by following the [general readme](../../README.adoc#download-and-use-community-add-ons). 5 | 6 | ## Deploy cockpit 7 | To deploy cockpit 8 | 9 | ``` 10 | $ minishift addon apply cockpit 11 | ``` 12 | 13 | ## Use cockpit 14 | Find cockpit console at the following URL: 15 | 16 | ``` 17 | $ minishift openshift service openshift-cockpit -n cockpit 18 | ``` 19 | 20 | You will need to log in with same user and creadentials as to OpenShift 21 | 22 | ## Delete cockpit 23 | To delete cockpit, just do: 24 | 25 | ``` 26 | $ oc delete oauthclients/cockpit-oauth-client project/cockpit --as=system:admin 27 | ``` 28 | -------------------------------------------------------------------------------- /add-ons/cockpit/cockpit-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Template", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "cockpit" 6 | }, 7 | "parameters": [ 8 | { 9 | "description": "The name for the application. The service will be named like the application.", 10 | "displayName": "Application name.", 11 | "name": "APPLICATION_NAME", 12 | "value": "cockpit", 13 | "required": true 14 | }, 15 | { 16 | "description": "Custom hostname for service routes. Leave blank for default hostname, e.g.: ..", 17 | "displayName": "Cockpit instance hostname", 18 | "name": "APPLICATION_HOSTNAME", 19 | "required": true 20 | }, 21 | { 22 | "description": "Ip where the master can be located", 23 | "displayName": "Master's IP", 24 | "name": "MASTER_IP", 25 | "required": true 26 | } 27 | ], 28 | "objects": [ 29 | { 30 | "kind": "DeploymentConfig", 31 | "apiVersion": "v1", 32 | "metadata": { 33 | "name": "openshift-cockpit", 34 | "labels": { 35 | "name": "openshift-cockpit" 36 | } 37 | }, 38 | "spec": { 39 | "strategy": { 40 | "type": "Rolling", 41 | "rollingParams": { 42 | "updatePeriodSeconds": 1, 43 | "intervalSeconds": 1, 44 | "timeoutSeconds": 600, 45 | "maxUnavailable": "25%", 46 | "maxSurge": "25%" 47 | }, 48 | "resources": {} 49 | }, 50 | "triggers": [ 51 | { 52 | "type": "ConfigChange" 53 | } 54 | ], 55 | "replicas": 1, 56 | "test": false, 57 | "selector": { 58 | "name": "openshift-cockpit" 59 | }, 60 | "template": { 61 | "metadata": { 62 | "labels": { 63 | "name": "openshift-cockpit" 64 | } 65 | }, 66 | "spec": { 67 | "containers": [ 68 | { 69 | "name": "openshift-cockpit", 70 | "image": "cockpit/kubernetes", 71 | "ports": [ 72 | { 73 | "containerPort": 9090, 74 | "protocol": "TCP" 75 | } 76 | ], 77 | "env": [ 78 | { 79 | "name": "OPENSHIFT_OAUTH_PROVIDER_URL", 80 | "value": "https://${MASTER_IP}:8443" 81 | }, 82 | { 83 | "name": "OPENSHIFT_OAUTH_CLIENT_ID", 84 | "value": "cockpit-oauth-client" 85 | }, 86 | { 87 | "name": "KUBERNETES_INSECURE" 88 | }, 89 | { 90 | "name": "KUBERNETES_CA_DATA" 91 | }, 92 | { 93 | "name": "COCKPIT_KUBE_INSECURE", 94 | "value": "true" 95 | }, 96 | { 97 | "name": "REGISTRY_HOST" 98 | }, 99 | { 100 | "name": "REGISTRY_ONLY", 101 | "value": "false" 102 | } 103 | ], 104 | "resources": {}, 105 | "terminationMessagePath": "/dev/termination-log", 106 | "imagePullPolicy": "IfNotPresent" 107 | } 108 | ], 109 | "restartPolicy": "Always", 110 | "terminationGracePeriodSeconds": 30, 111 | "dnsPolicy": "ClusterFirst", 112 | "securityContext": {} 113 | } 114 | } 115 | } 116 | }, 117 | { 118 | "kind": "Service", 119 | "apiVersion": "v1", 120 | "metadata": { 121 | "name": "openshift-cockpit", 122 | "labels": { 123 | "name": "openshift-cockpit" 124 | } 125 | }, 126 | "spec": { 127 | "ports": [ 128 | { 129 | "name": "http", 130 | "protocol": "TCP", 131 | "port": 80, 132 | "targetPort": 9090 133 | } 134 | ], 135 | "selector": { 136 | "name": "openshift-cockpit" 137 | }, 138 | "type": "ClusterIP", 139 | "sessionAffinity": "None" 140 | } 141 | }, 142 | { 143 | "kind": "Route", 144 | "apiVersion": "v1", 145 | "metadata": { 146 | "name": "openshift-cockpit", 147 | "labels": { 148 | "name": "openshift-cockpit" 149 | } 150 | }, 151 | "spec": { 152 | "host": "${APPLICATION_HOSTNAME}", 153 | "to": { 154 | "kind": "Service", 155 | "name": "openshift-cockpit" 156 | }, 157 | "port": { 158 | "targetPort": "http" 159 | } 160 | } 161 | }, 162 | { 163 | "kind": "OAuthClient", 164 | "apiVersion": "v1", 165 | "metadata": { 166 | "name": "cockpit-oauth-client", 167 | "labels": { 168 | "name": "openshift-cockpit" 169 | } 170 | }, 171 | "respondWithChallenges": false, 172 | "secret": "usermaBGPqkERbospcYt0ED64DDBtu2Nby1lv1bJbrlpaxwSYlr3nXwGwTdO05sjWlLm", 173 | "allowAnyScope": true, 174 | "redirectURIs": [ 175 | "http://${APPLICATION_HOSTNAME}" 176 | ] 177 | } 178 | ] 179 | } -------------------------------------------------------------------------------- /add-ons/cockpit/cockpit.addon: -------------------------------------------------------------------------------- 1 | # Name: cockpit 2 | # Description: Installs cockpit 3 | # Url: Template from https://raw.githubusercontent.com/cockpit-project/cockpit/master/containers/openshift-cockpit.template 4 | 5 | oc adm new-project cockpit 6 | oc apply -f cockpit-template-orig.json -n cockpit 7 | oc new-app cockpit-openshift-template -p COCKPIT_KUBE_URL=http://cockpit.#{routing-suffix} -p OPENSHIFT_OAUTH_PROVIDER_URL=https://#{ip}:8443 -p COCKPIT_KUBE_INSECURE=true -l app=cockpit -n cockpit 8 | oc expose svc/openshift-cockpit --hostname=cockpit.#{routing-suffix} --port=http -l app=cockpit -n cockpit 9 | 10 | echo You have installed #{addon-name} 11 | echo To access #{addon-name} go to http://cockpit.#{routing-suffix} 12 | echo or 13 | echo Use minishift: 14 | echo minishift openshift service openshift-cockpit -n cockpit 15 | echo 16 | echo To delete: 17 | echo oc delete oauthclients/cockpit-oauth-client project/cockpit --as=system:admin 18 | 19 | -------------------------------------------------------------------------------- /add-ons/cors/README.md: -------------------------------------------------------------------------------- 1 | ## cors Add-on 2 | An addon that will enable Cross-Origin resources from any source. 3 | 4 | Verify you have installed these addons, by following the [general readme](../../README.adoc#download-and-use-community-add-ons). 5 | 6 | ## Deploy cors 7 | To deploy cors 8 | 9 | ``` 10 | $ minishift addon apply cors 11 | ``` 12 | -------------------------------------------------------------------------------- /add-ons/cors/cors.addon: -------------------------------------------------------------------------------- 1 | # Name: cors 2 | # Description: Configures OpenShift to allow cross-origin requests from any address 3 | 4 | apicontainer := docker ps -f "label=io.kubernetes.container.name=api" --format "{{.ID}}" 5 | 6 | # TODO: This will add an entry every time is executed. Not the best sed command 7 | docker exec #{apicontainer} sed -i '/corsAllowedOrigins/ a \- .*' /etc/origin/master/master-config.yaml 8 | 9 | # openshift ex config patch openshift.local.config/master/master-config.yaml --patch='{"corsAllowedOrigins": [".*"]}' 10 | docker restart #{apicontainer} 11 | 12 | echo CORS is now allowed from any address 13 | -------------------------------------------------------------------------------- /add-ons/debezium/README.md: -------------------------------------------------------------------------------- 1 | # Deploying Debezium on OpenShift 2 | 3 | This addon provides an easy way to install [Debezium](http://debezium.io/) on [Minishift](https://github.com/minishift/minishift). 4 | 5 | Prerequisites: 6 | 7 | * [Installed and running](https://docs.okd.io/latest/minishift/getting-started/installing.html) Minishift 8 | * [Installed](https://docs.okd.io/latest/minishift/command-ref/minishift_oc-env.html) OpenShift CLI 9 | 10 | ## Start Minishift 11 | The deployment works with Minishift default resources - 2 CPUs and 2 GB RAM. Nevertheless we prefer to allocate more memory (4 GB) available to Debezium and associated infrastructure. Start Minishift using following command to provide more RAM. 12 | ``` 13 | $ minishift start --memory=4GB 14 | ``` 15 | 16 | ## Add-on installation 17 | Clone this repository onto your local machine and then install the add-on via: 18 | ``` 19 | $ minishift addons install 20 | ``` 21 | 22 | ## Debezium start 23 | Deploy the Kafka broker, Kafka Connect with Debezium and MySQL connector 24 | 25 | ``` 26 | minishift addon apply -a DEBEZIUM_VERSION=0.6.1 -a DEBEZIUM_PLUGIN=mysql -a PROJECT=myproject debezium 27 | ``` 28 | 29 | After a while all parts should be up and running: 30 | 31 | ``` 32 | oc get pods 33 | NAME READY STATUS RESTARTS AGE 34 | debezium-1-build 0/1 Completed 0 3m 35 | debezium-2-build 0/1 Completed 0 3m 36 | kafka-0 1/1 Running 2 3m 37 | kafka-1 1/1 Running 0 2m 38 | kafka-2 1/1 Running 0 2m 39 | kafka-connect-3-3v4n9 1/1 Running 1 3m 40 | zookeeper-0 1/1 Running 0 3m 41 | ``` 42 | 43 | **Note:** You might see one or two debezium builds in the above output depending on the timing of `oc get pods` command. In both the cases it is fine. 44 | 45 | ## Supported parameters 46 | * `DEBEZIUM_VERSION` - the verson of Debezium to be used (only released versions are supported) 47 | * `DEBEZIUM_PLUGIN` - which plugin should be added into the Connect cluster 48 | * `PROJECT` - the name of the project to which Debezium is deployed 49 | 50 | ## Debezium Tutorial 51 | You can try the [Debezium Tutorial](http://debezium.io/docs/tutorial/) in this environment too. Yoy can either follow the steps below to dpeloy the test database or use a [prepared MiniShift add-on](https://github.com/debezium/debezium-examples/tree/master/openshift/tutorial-database) for that purpose. 52 | 53 | First we need to start a MySQL server instance: 54 | 55 | ``` 56 | # Deploy pre-populated MySQL instance 57 | oc new-app --name=mysql debezium/example-mysql:0.6 58 | 59 | # Configure credentials for the database 60 | oc env dc/mysql MYSQL_ROOT_PASSWORD=debezium MYSQL_USER=mysqluser MYSQL_PASSWORD=mysqlpw 61 | ``` 62 | 63 | A new pod with MySQL server should be up and running: 64 | 65 | ``` 66 | oc get pods 67 | NAME READY STATUS RESTARTS AGE 68 | ... 69 | mysql-1-4503l 1/1 Running 0 2s 70 | ... 71 | ``` 72 | 73 | Then we are going to register the Debezium MySQL connector to run against the deployed MySQL instance: 74 | 75 | ``` 76 | cat register.json | oc exec -i kafka-0 -- curl -s -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://kafka-connect:8083/connectors -d @- 77 | ``` 78 | 79 | **Note:** You can find the register.json in the debezium add-on directory. 80 | 81 | Kafka Connect's log file should contain messages regarding execution of initial snapshot: 82 | 83 | ``` 84 | oc logs $(oc get pods -o name -l name=kafka-connect) 85 | ``` 86 | 87 | Read customer table CDC messages from the Kafka topic: 88 | 89 | ``` 90 | oc exec -it kafka-0 -- /opt/kafka/bin/kafka-console-consumer.sh \ 91 | --bootstrap-server kafka:9092 \ 92 | --from-beginning \ 93 | --property print.key=true \ 94 | --topic dbserver1.inventory.customers 95 | ``` 96 | 97 | Modify some records in the `CUSTOMERS` table of the database: 98 | 99 | ``` 100 | oc exec -it $(oc get pods -o custom-columns=NAME:.metadata.name --no-headers -l app=mysql) -- bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory' 101 | ``` 102 | 103 | You should see additional change messages in the consumer started before. 104 | -------------------------------------------------------------------------------- /add-ons/debezium/debezium.addon: -------------------------------------------------------------------------------- 1 | # Name: debezium 2 | # Description: Deploys a Kafka Cluster and a Connect cluster with Debezium 3 | # Required-Vars: DEBEZIUM_VERSION,DEBEZIUM_PLUGIN,PROJECT,STRIMZI_RELEASE 4 | # Var-Defaults: STRIMZI_RELEASE=0.1.0,STRIMZI_REPO_NAME=strimzi,STRIMZI_IMAGE_TAG=0.1.0,PROJECT=debezium 5 | 6 | # Pull images 7 | echo Pulling images... 8 | docker pull #{STRIMZI_REPO_NAME}/zookeeper:#{STRIMZI_IMAGE_TAG} 9 | docker pull #{STRIMZI_REPO_NAME}/kafka-statefulsets:#{STRIMZI_IMAGE_TAG} 10 | docker pull #{STRIMZI_REPO_NAME}/kafka-connect-s2i:#{STRIMZI_IMAGE_TAG} 11 | 12 | # Install templates 13 | oc create -f https://raw.githubusercontent.com/strimzi/strimzi/#{STRIMZI_RELEASE}/kafka-statefulsets/resources/openshift-template.yaml -n #{PROJECT} 14 | oc create -f https://raw.githubusercontent.com/strimzi/strimzi/#{STRIMZI_RELEASE}/kafka-connect/s2i/resources/openshift-template.yaml -n #{PROJECT} 15 | 16 | # Deploy Kafka components 17 | echo Deploying ZooKeeper... 18 | oc new-app -p ZOOKEEPER_NODE_COUNT=1 -n #{PROJECT} strimzi 19 | 20 | # Deploy Debezium build config and deployment config 21 | echo Deploying Kafka broker... 22 | oc new-app -p BUILD_NAME=debezium -p TARGET_IMAGE_NAME=debezium -p TARGET_IMAGE_TAG=#{DEBEZIUM_VERSION} -n #{PROJECT} strimzi-connect-s2i 23 | 24 | # Build a Connect image with Debezium 25 | sleep 10 26 | echo Deploying Debezium... 27 | oc start-build debezium --from-archive http://central.maven.org/maven2/io/debezium/debezium-connector-#{DEBEZIUM_PLUGIN}/#{DEBEZIUM_VERSION}/debezium-connector-#{DEBEZIUM_PLUGIN}-#{DEBEZIUM_VERSION}-plugin.tar.gz -n #{PROJECT} --follow 28 | 29 | echo Completed, wait for Debezium start! 30 | -------------------------------------------------------------------------------- /add-ons/debezium/register.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inventory-connector", 3 | "config": { 4 | "connector.class": "io.debezium.connector.mysql.MySqlConnector", 5 | "tasks.max": "1", 6 | "database.hostname": "mysql", 7 | "database.port": "3306", 8 | "database.user": "debezium", 9 | "database.password": "dbz", 10 | "database.server.id": "184054", 11 | "database.server.name": "dbserver1", 12 | "database.whitelist": "inventory", 13 | "database.history.kafka.bootstrap.servers": "kafka:9092", 14 | "database.history.kafka.topic": "schema-changes.inventory" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /add-ons/dotnet/README.md: -------------------------------------------------------------------------------- 1 | # .NET Core Add-on 2 | 3 | This add-on will enable imagestreams and templates for developing and deploying .NET Core based applications on OpenShift. 4 | 5 | 6 | ## Deploy 7 | 8 | To deploy this add-on 9 | 10 | ``` 11 | $ minishift addon apply dotnet 12 | ``` 13 | -------------------------------------------------------------------------------- /add-ons/dotnet/dotnet.addon: -------------------------------------------------------------------------------- 1 | # Name: dotnet 2 | # Description: ImageStreams and Templates for developing and deploying application using .NET Core 3 | 4 | oc create --namespace openshift -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/dotnet_imagestreams.json 5 | oc create --namespace openshift -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-example.json 6 | oc create --namespace openshift -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-runtime-example.json 7 | oc create --namespace openshift -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-pgsql-persistent.json 8 | 9 | -------------------------------------------------------------------------------- /add-ons/dynamic-admission-controllers/dynamic-admission-controllers.addon: -------------------------------------------------------------------------------- 1 | # Name: dynamic-admission-controllers 2 | # Description: Enables ValidatingAdmissionWebhook & MutatingAdmissionWebhook 3 | # Url: https://docs.openshift.com/container-platform/latest/architecture/additional_concepts/dynamic_admission_controllers.html 4 | # OpenShift-Version: >=3.10.0 5 | 6 | echo Enable required admission configs 7 | ssh cp -pv /var/lib/minishift/base/kube-apiserver/master-config.yaml /var/lib/minishift/base/kube-apiserver/master-config.yaml.dac 8 | ssh /var/lib/minishift/bin/oc ex config patch /var/lib/minishift/base/kube-apiserver/master-config.yaml.dac -p '{"admissionConfig": {"pluginConfig": {"MutatingAdmissionWebhook": {"configuration": {"apiVersion": "v1", "kind": "DefaultAdmissionConfig", "disable": false } }, "ValidatingAdmissionWebhook": {"configuration": {"apiVersion": "v1", "kind": "DefaultAdmissionConfig", "disable": false }}}}}' > /var/lib/minishift/base/kube-apiserver/master-config.new.yaml 9 | ssh cp -pv /var/lib/minishift/base/kube-apiserver/master-config.new.yaml /var/lib/minishift/base/kube-apiserver/master-config.yaml 10 | 11 | echo Restart kube-api 12 | docker stop $(docker ps -l -q --filter "label=io.kubernetes.container.name=api") 13 | ssh until curl -f -k https://#{ip}:8443/healthz;do sleep 1;done 14 | sleep 10 15 | 16 | echo Dynamic admission controllers add-on successfully applied 17 | -------------------------------------------------------------------------------- /add-ons/dynamic-admission-controllers/dynamic-admission-controllers.addon.remove: -------------------------------------------------------------------------------- 1 | # Name: dynamic-admission-controllers 2 | # Description: Enables ValidatingAdmissionWebhook & MutatingAdmissionWebhook 3 | # Url: https://docs.openshift.com/container-platform/latest/architecture/additional_concepts/dynamic_admission_controllers.html 4 | # OpenShift-Version: >=3.10.0 5 | 6 | echo Disable required admission configs 7 | ssh cp -pv /var/lib/minishift/base/kube-apiserver/master-config.yaml /var/lib/minishift/base/kube-apiserver/master-config.yaml.dac 8 | ssh /var/lib/minishift/bin/oc ex config patch /var/lib/minishift/base/kube-apiserver/master-config.yaml.dac -p '{"admissionConfig": {"pluginConfig": null}}' > /var/lib/minishift/base/kube-apiserver/master-config.new.yaml 9 | ssh cp -pv /var/lib/minishift/base/kube-apiserver/master-config.new.yaml /var/lib/minishift/base/kube-apiserver/master-config.yaml 10 | 11 | echo Restart kube-api 12 | docker stop $(docker ps -l -q --filter "label=io.kubernetes.container.name=api") 13 | 14 | ssh until curl -f -k https://#{ip}:8443/healthz;do sleep 1;done 15 | 16 | sleep 10; 17 | 18 | echo Dynamic admission controllers add-on successfully removed 19 | -------------------------------------------------------------------------------- /add-ons/eap-cd/eap-cd.addon: -------------------------------------------------------------------------------- 1 | # Name: eap-cd 2 | # Description: Imports EAP CD 15 templates 3 | # Url: https://github.com/jboss-container-images/jboss-eap-7-openshift-image/tree/eap-cd/templates 4 | 5 | # Templates 6 | oc apply -f templates -n openshift 7 | # ImageStream 8 | oc apply -f imagestream -n openshift 9 | 10 | echo EAP CD 15 imagestreams and templates installed -------------------------------------------------------------------------------- /add-ons/eap-cd/imagestream/eap-cd-image-stream.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "List", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "jboss-cd-image-streams", 6 | "annotations": { 7 | "description": "ImageStream definition for JBoss Enterprise Application Platform continuous delivery.", 8 | "openshift.io/provider-display-name": "Red Hat, Inc." 9 | } 10 | }, 11 | "items": [ 12 | { 13 | "kind": "ImageStream", 14 | "apiVersion": "v1", 15 | "metadata": { 16 | "name": "eap-cd-openshift", 17 | "annotations": { 18 | "openshift.io/display-name": "JBoss EAP continuous delivery", 19 | "openshift.io/provider-display-name": "Red Hat, Inc.", 20 | "version": "14.0" 21 | } 22 | }, 23 | "labels": { 24 | "xpaas": "15.0" 25 | }, 26 | "spec": { 27 | "tags": [ 28 | { 29 | "name": "latest", 30 | "annotations": { 31 | "description": "The latest available build of JBoss EAP continuous delivery Tech Preview.", 32 | "iconClass": "icon-eap", 33 | "tags": "builder,eap,javaee,java,jboss,hidden", 34 | "supports": "eap:7.3,javaee:8,java:8", 35 | "sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift", 36 | "sampleContextDir": "kitchensink", 37 | "sampleRef": "openshift", 38 | "version": "latest", 39 | "openshift.io/display-name": "JBoss EAP continuous delivery (Tech Preview)" 40 | }, 41 | "referencePolicy": { 42 | "type": "Local" 43 | }, 44 | "from": { 45 | "kind": "DockerImage", 46 | "name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:latest" 47 | } 48 | }, 49 | { 50 | "name": "15", 51 | "annotations": { 52 | "description": "JBoss EAP continuous delivery Tech Preview version 15.", 53 | "iconClass": "icon-eap", 54 | "tags": "builder,eap,javaee,java,jboss,hidden", 55 | "supports": "eap:7.3,javaee:8,java:8", 56 | "sampleRepo": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 57 | "sampleContextDir": "kitchensink", 58 | "sampleRef": "openshift", 59 | "version": "15", 60 | "openshift.io/display-name": "JBoss EAP continuous delivery 15 (Tech Preview)" 61 | }, 62 | "referencePolicy": { 63 | "type": "Local" 64 | }, 65 | "from": { 66 | "kind": "ImageStreamTag", 67 | "name": "15.0" 68 | 69 | } 70 | }, 71 | { 72 | "name": "14", 73 | "annotations": { 74 | "description": "JBoss EAP continuous delivery Tech Preview version 14.", 75 | "iconClass": "icon-eap", 76 | "tags": "builder,eap,javaee,java,jboss,hidden", 77 | "supports": "eap:7.2,javaee:8,java:8", 78 | "sampleRepo": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 79 | "sampleContextDir": "kitchensink", 80 | "sampleRef": "openshift", 81 | "version": "14", 82 | "openshift.io/display-name": "JBoss EAP continuous delivery 14 (Tech Preview)" 83 | }, 84 | "referencePolicy": { 85 | "type": "Local" 86 | }, 87 | "from": { 88 | "kind": "ImageStreamTag", 89 | "name": "14.0" 90 | 91 | } 92 | }, 93 | { 94 | "name": "13", 95 | "annotations": { 96 | "description": "JBoss EAP continuous delivery Tech Preview version 13.", 97 | "iconClass": "icon-eap", 98 | "tags": "builder,eap,javaee,java,jboss,hidden", 99 | "supports": "eap:7.2,javaee:7,java:8", 100 | "sampleRepo": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 101 | "sampleContextDir": "kitchensink", 102 | "sampleRef": "openshift", 103 | "version": "13", 104 | "openshift.io/display-name": "JBoss EAP continuous delivery 13 (Tech Preview)" 105 | }, 106 | "referencePolicy": { 107 | "type": "Local" 108 | }, 109 | "from": { 110 | "kind": "ImageStreamTag", 111 | "name": "13.0" 112 | 113 | } 114 | }, 115 | { 116 | "name": "12", 117 | "annotations": { 118 | "description": "JBoss EAP continuous delivery Tech Preview version 12.", 119 | "iconClass": "icon-eap", 120 | "tags": "builder,eap,javaee,java,jboss,hidden", 121 | "supports": "eap:7.2,javaee:7,java:8", 122 | "sampleRepo": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 123 | "sampleContextDir": "kitchensink", 124 | "sampleRef": "openshift", 125 | "version": "12", 126 | "openshift.io/display-name": "JBoss EAP continuous delivery 12 (Tech Preview)" 127 | }, 128 | "referencePolicy": { 129 | "type": "Local" 130 | }, 131 | "from": { 132 | "kind": "ImageStreamTag", 133 | "name": "12.0" 134 | 135 | } 136 | }, 137 | { 138 | "name": "12.0", 139 | "annotations": { 140 | "description": "JBoss EAP continuous delivery 12 Tech Preview S2I Image", 141 | "iconClass": "icon-eap", 142 | "tags": "builder,eap,javaee,java,jboss,hidden", 143 | "supports": "eap:7.2,javaee:7,java:8", 144 | "sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift", 145 | "sampleContextDir": "kitchensink", 146 | "sampleRef": "openshift", 147 | "version": "12.0", 148 | "openshift.io/display-name": "JBoss EAP continuous delivery 12 (Tech Preview)" 149 | }, 150 | "referencePolicy": { 151 | "type": "Local" 152 | }, 153 | "from": { 154 | "kind": "DockerImage", 155 | "name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:12.0" 156 | } 157 | }, 158 | { 159 | "name": "13.0", 160 | "annotations": { 161 | "description": "JBoss EAP continuous delivery 13 Tech Preview S2I Image", 162 | "iconClass": "icon-eap", 163 | "tags": "builder,eap,javaee,java,jboss,hidden", 164 | "supports": "eap:7.2,javaee:7,java:8", 165 | "sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift", 166 | "sampleContextDir": "kitchensink", 167 | "sampleRef": "openshift", 168 | "version": "13.0", 169 | "openshift.io/display-name": "JBoss EAP continuous delivery 13 (Tech Preview)" 170 | }, 171 | "referencePolicy": { 172 | "type": "Local" 173 | }, 174 | "from": { 175 | "kind": "DockerImage", 176 | "name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:13.0" 177 | } 178 | }, 179 | { 180 | "name": "14.0", 181 | "annotations": { 182 | "description": "JBoss EAP continuous delivery 14 Tech Preview S2I Image", 183 | "iconClass": "icon-eap", 184 | "tags": "builder,eap,javaee,java,jboss,hidden", 185 | "supports": "eap:7.2,javaee:8,java:8", 186 | "sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift", 187 | "sampleContextDir": "kitchensink", 188 | "sampleRef": "openshift", 189 | "version": "14.0", 190 | "openshift.io/display-name": "JBoss EAP continuous delivery 14 (Tech Preview)" 191 | }, 192 | "referencePolicy": { 193 | "type": "Local" 194 | }, 195 | "from": { 196 | "kind": "DockerImage", 197 | "name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:14.0" 198 | } 199 | }, 200 | { 201 | "name": "15.0", 202 | "annotations": { 203 | "description": "JBoss EAP continuous delivery 15 Tech Preview S2I Image", 204 | "iconClass": "icon-eap", 205 | "tags": "builder,eap,javaee,java,jboss,hidden", 206 | "supports": "eap:7.3,javaee:8,java:8", 207 | "sampleRepo": "https://github.com/jbossas/eap-quickstarts/openshift", 208 | "sampleContextDir": "kitchensink", 209 | "sampleRef": "openshift", 210 | "version": "15.0", 211 | "openshift.io/display-name": "JBoss EAP continuous delivery 15 (Tech Preview)" 212 | }, 213 | "referencePolicy": { 214 | "type": "Local" 215 | }, 216 | "from": { 217 | "kind": "DockerImage", 218 | "name": "registry.redhat.io/jboss-eap-7-tech-preview/eap-cd-openshift:15.0" 219 | } 220 | } 221 | 222 | ] 223 | } 224 | } 225 | ] 226 | } 227 | -------------------------------------------------------------------------------- /add-ons/eap-cd/templates/eap-cd-basic-s2i.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Template", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "annotations": { 6 | "iconClass": "icon-eap", 7 | "tags": "eap,javaee,java,jboss", 8 | "version": "15.0", 9 | "openshift.io/display-name": "JBoss EAP CD 15", 10 | "openshift.io/provider-display-name": "Red Hat, Inc.", 11 | "description": "An example JBoss Enterprise Application Platform continuous delivery application. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc", 12 | "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery based application, including a build configuration, application deployment configuration and secure communication using edge TLS.", 13 | "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/", 14 | "template.openshift.io/support-url": "https://access.redhat.com" 15 | }, 16 | "name": "eap-cd-basic-s2i" 17 | }, 18 | "labels": { 19 | "template": "eap-cd-basic-s2i", 20 | "xpaas": "15.0" 21 | }, 22 | "message": "A new JBoss EAP CD based application has been created in your project.", 23 | "parameters": [ 24 | { 25 | "displayName": "Application Name", 26 | "description": "The name for the application.", 27 | "name": "APPLICATION_NAME", 28 | "value": "eap-app", 29 | "required": true 30 | }, 31 | { 32 | "displayName": "Git Repository URL", 33 | "description": "Git source URI for application", 34 | "name": "SOURCE_REPOSITORY_URL", 35 | "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 36 | "required": true 37 | }, 38 | { 39 | "displayName": "Git Reference", 40 | "description": "Git branch/tag reference", 41 | "name": "SOURCE_REPOSITORY_REF", 42 | "value": "openshift", 43 | "required": false 44 | }, 45 | { 46 | "displayName": "Context Directory", 47 | "description": "Path within Git project to build; empty for root project directory.", 48 | "name": "CONTEXT_DIR", 49 | "value": "kitchensink", 50 | "required": false 51 | }, 52 | { 53 | "displayName": "Queues", 54 | "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all queues used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", 55 | "name": "MQ_QUEUES", 56 | "value": "", 57 | "required": false 58 | }, 59 | { 60 | "displayName": "Topics", 61 | "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all topics used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", 62 | "name": "MQ_TOPICS", 63 | "value": "", 64 | "required": false 65 | }, 66 | { 67 | "displayName": "AMQ cluster password", 68 | "description": "AMQ cluster admin password", 69 | "name": "MQ_CLUSTER_PASSWORD", 70 | "from": "[a-zA-Z0-9]{8}", 71 | "generate": "expression", 72 | "required": true 73 | }, 74 | { 75 | "displayName": "Github Webhook Secret", 76 | "description": "GitHub trigger secret", 77 | "name": "GITHUB_WEBHOOK_SECRET", 78 | "from": "[a-zA-Z0-9]{8}", 79 | "generate": "expression", 80 | "required": true 81 | }, 82 | { 83 | "displayName": "Generic Webhook Secret", 84 | "description": "Generic build trigger secret", 85 | "name": "GENERIC_WEBHOOK_SECRET", 86 | "from": "[a-zA-Z0-9]{8}", 87 | "generate": "expression", 88 | "required": true 89 | }, 90 | { 91 | "displayName": "ImageStream Namespace", 92 | "description": "Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project.", 93 | "name": "IMAGE_STREAM_NAMESPACE", 94 | "value": "openshift", 95 | "required": true 96 | }, 97 | { 98 | "displayName": "JGroups Cluster Password", 99 | "description": "JGroups cluster password", 100 | "name": "JGROUPS_CLUSTER_PASSWORD", 101 | "from": "[a-zA-Z0-9]{8}", 102 | "generate": "expression", 103 | "required": true 104 | }, 105 | { 106 | "displayName": "Deploy Exploded Archives", 107 | "description": "Controls whether exploded deployment content should be automatically deployed", 108 | "name": "AUTO_DEPLOY_EXPLODED", 109 | "value": "false", 110 | "required": false 111 | }, 112 | { 113 | "displayName": "Maven mirror URL", 114 | "description": "Maven mirror to use for S2I builds", 115 | "name": "MAVEN_MIRROR_URL", 116 | "value": "", 117 | "required": false 118 | }, 119 | { 120 | "displayName": "Maven Additional Arguments", 121 | "description": "Maven additional arguments to use for S2I builds", 122 | "name": "MAVEN_ARGS_APPEND", 123 | "value": "-Dcom.redhat.xpaas.repo.jbossorg", 124 | "required": false 125 | }, 126 | { 127 | "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.", 128 | "name": "ARTIFACT_DIR", 129 | "value": "", 130 | "required": false 131 | }, 132 | { 133 | "description": "Container memory limit", 134 | "name": "MEMORY_LIMIT", 135 | "value": "1Gi", 136 | "required": false 137 | } 138 | ], 139 | "objects": [ 140 | { 141 | "kind": "Service", 142 | "apiVersion": "v1", 143 | "spec": { 144 | "ports": [ 145 | { 146 | "port": 8080, 147 | "targetPort": 8080 148 | } 149 | ], 150 | "selector": { 151 | "deploymentConfig": "${APPLICATION_NAME}" 152 | } 153 | }, 154 | "metadata": { 155 | "name": "${APPLICATION_NAME}", 156 | "labels": { 157 | "application": "${APPLICATION_NAME}" 158 | }, 159 | "annotations": { 160 | "description": "The web server's http port." 161 | } 162 | } 163 | }, 164 | { 165 | "kind": "Service", 166 | "apiVersion": "v1", 167 | "spec": { 168 | "publishNotReadyAddresses": true, 169 | "clusterIP": "None", 170 | "ports": [ 171 | { 172 | "name": "ping", 173 | "port": 8888 174 | } 175 | ], 176 | "selector": { 177 | "deploymentConfig": "${APPLICATION_NAME}" 178 | } 179 | }, 180 | "metadata": { 181 | "name": "${APPLICATION_NAME}-ping", 182 | "labels": { 183 | "application": "${APPLICATION_NAME}" 184 | }, 185 | "annotations": { 186 | "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true", 187 | "description": "The JGroups ping port for clustering." 188 | } 189 | } 190 | }, 191 | { 192 | "kind": "Route", 193 | "apiVersion": "v1", 194 | "id": "${APPLICATION_NAME}-https", 195 | "metadata": { 196 | "name": "${APPLICATION_NAME}", 197 | "labels": { 198 | "application": "${APPLICATION_NAME}" 199 | }, 200 | "annotations": { 201 | "description": "Route for application's https service." 202 | } 203 | }, 204 | "spec": { 205 | "to": { 206 | "name": "${APPLICATION_NAME}" 207 | }, 208 | "tls": { 209 | "insecureEdgeTerminationPolicy": "Redirect", 210 | "termination": "edge" 211 | } 212 | } 213 | }, 214 | { 215 | "kind": "ImageStream", 216 | "apiVersion": "v1", 217 | "metadata": { 218 | "name": "${APPLICATION_NAME}", 219 | "labels": { 220 | "application": "${APPLICATION_NAME}" 221 | } 222 | } 223 | }, 224 | { 225 | "kind": "BuildConfig", 226 | "apiVersion": "v1", 227 | "metadata": { 228 | "name": "${APPLICATION_NAME}", 229 | "labels": { 230 | "application": "${APPLICATION_NAME}" 231 | } 232 | }, 233 | "spec": { 234 | "source": { 235 | "type": "Git", 236 | "git": { 237 | "uri": "${SOURCE_REPOSITORY_URL}", 238 | "ref": "${SOURCE_REPOSITORY_REF}" 239 | }, 240 | "contextDir": "${CONTEXT_DIR}" 241 | }, 242 | "strategy": { 243 | "type": "Source", 244 | "sourceStrategy": { 245 | "env": [ 246 | { 247 | "name": "MAVEN_MIRROR_URL", 248 | "value": "${MAVEN_MIRROR_URL}" 249 | }, 250 | { 251 | "name": "MAVEN_ARGS_APPEND", 252 | "value": "${MAVEN_ARGS_APPEND}" 253 | }, 254 | { 255 | "name": "ARTIFACT_DIR", 256 | "value": "${ARTIFACT_DIR}" 257 | } 258 | ], 259 | "forcePull": true, 260 | "incremental": true, 261 | "from": { 262 | "kind": "ImageStreamTag", 263 | "namespace": "${IMAGE_STREAM_NAMESPACE}", 264 | "name": "eap-cd-openshift:15" 265 | } 266 | } 267 | }, 268 | "output": { 269 | "to": { 270 | "kind": "ImageStreamTag", 271 | "name": "${APPLICATION_NAME}:latest" 272 | } 273 | }, 274 | "triggers": [ 275 | { 276 | "type": "GitHub", 277 | "github": { 278 | "secret": "${GITHUB_WEBHOOK_SECRET}" 279 | } 280 | }, 281 | { 282 | "type": "Generic", 283 | "generic": { 284 | "secret": "${GENERIC_WEBHOOK_SECRET}" 285 | } 286 | }, 287 | { 288 | "type": "ImageChange", 289 | "imageChange": {} 290 | }, 291 | { 292 | "type": "ConfigChange" 293 | } 294 | ] 295 | } 296 | }, 297 | { 298 | "kind": "DeploymentConfig", 299 | "apiVersion": "v1", 300 | "metadata": { 301 | "name": "${APPLICATION_NAME}", 302 | "labels": { 303 | "application": "${APPLICATION_NAME}" 304 | } 305 | }, 306 | "spec": { 307 | "strategy": { 308 | "type": "Recreate" 309 | }, 310 | "triggers": [ 311 | { 312 | "type": "ImageChange", 313 | "imageChangeParams": { 314 | "automatic": true, 315 | "containerNames": [ 316 | "${APPLICATION_NAME}" 317 | ], 318 | "from": { 319 | "kind": "ImageStreamTag", 320 | "name": "${APPLICATION_NAME}:latest" 321 | } 322 | } 323 | }, 324 | { 325 | "type": "ConfigChange" 326 | } 327 | ], 328 | "replicas": 1, 329 | "selector": { 330 | "deploymentConfig": "${APPLICATION_NAME}" 331 | }, 332 | "template": { 333 | "metadata": { 334 | "name": "${APPLICATION_NAME}", 335 | "labels": { 336 | "deploymentConfig": "${APPLICATION_NAME}", 337 | "application": "${APPLICATION_NAME}" 338 | } 339 | }, 340 | "spec": { 341 | "terminationGracePeriodSeconds": 75, 342 | "containers": [ 343 | { 344 | "name": "${APPLICATION_NAME}", 345 | "image": "${APPLICATION_NAME}", 346 | "imagePullPolicy": "Always", 347 | "resources": { 348 | "limits": { 349 | "memory": "${MEMORY_LIMIT}" 350 | } 351 | }, 352 | "livenessProbe": { 353 | "exec": { 354 | "command": [ 355 | "/bin/bash", 356 | "-c", 357 | "/opt/eap/bin/livenessProbe.sh" 358 | ] 359 | }, 360 | "initialDelaySeconds": 60 361 | }, 362 | "readinessProbe": { 363 | "exec": { 364 | "command": [ 365 | "/bin/bash", 366 | "-c", 367 | "/opt/eap/bin/readinessProbe.sh" 368 | ] 369 | } 370 | }, 371 | "ports": [ 372 | { 373 | "name": "jolokia", 374 | "containerPort": 8778, 375 | "protocol": "TCP" 376 | }, 377 | { 378 | "name": "http", 379 | "containerPort": 8080, 380 | "protocol": "TCP" 381 | }, 382 | { 383 | "name": "ping", 384 | "containerPort": 8888, 385 | "protocol": "TCP" 386 | } 387 | ], 388 | "env": [ 389 | { 390 | "name": "JGROUPS_PING_PROTOCOL", 391 | "value": "openshift.DNS_PING" 392 | }, 393 | { 394 | "name": "OPENSHIFT_DNS_PING_SERVICE_NAME", 395 | "value": "${APPLICATION_NAME}-ping" 396 | }, 397 | { 398 | "name": "OPENSHIFT_DNS_PING_SERVICE_PORT", 399 | "value": "8888" 400 | }, 401 | { 402 | "name": "MQ_CLUSTER_PASSWORD", 403 | "value": "${MQ_CLUSTER_PASSWORD}" 404 | }, 405 | { 406 | "name": "MQ_QUEUES", 407 | "value": "${MQ_QUEUES}" 408 | }, 409 | { 410 | "name": "MQ_TOPICS", 411 | "value": "${MQ_TOPICS}" 412 | }, 413 | { 414 | "name": "JGROUPS_CLUSTER_PASSWORD", 415 | "value": "${JGROUPS_CLUSTER_PASSWORD}" 416 | }, 417 | { 418 | "name": "AUTO_DEPLOY_EXPLODED", 419 | "value": "${AUTO_DEPLOY_EXPLODED}" 420 | } 421 | ] 422 | } 423 | ] 424 | } 425 | } 426 | } 427 | } 428 | ] 429 | } 430 | -------------------------------------------------------------------------------- /add-ons/eap-cd/templates/eap-cd-https-s2i.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Template", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "annotations": { 6 | "iconClass": "icon-eap", 7 | "tags": "eap,javaee,java,jboss", 8 | "version": "15.0", 9 | "openshift.io/display-name": "JBoss EAP CD 15 with passthrough TLS", 10 | "openshift.io/provider-display-name": "Red Hat, Inc.", 11 | "description": "An example JBoss Enterprise Application Platform continuous delivery application configured with secure communication using HTTPS. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc", 12 | "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery application, including a build configuration, application deployment configuration and secure communication using passthrough TLS.", 13 | "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/", 14 | "template.openshift.io/support-url": "https://access.redhat.com" 15 | }, 16 | "name": "eap-cd-https-s2i" 17 | }, 18 | "labels": { 19 | "template": "eap-cd-https-s2i", 20 | "xpaas": "15.0" 21 | }, 22 | "message": "A new JBoss EAP CD based application with SSL support has been created in your project. Please be sure to create the following secrets: \"${HTTPS_SECRET}\" containing the ${HTTPS_KEYSTORE} file used for serving secure content; \"${JGROUPS_ENCRYPT_SECRET}\" containing the ${JGROUPS_ENCRYPT_KEYSTORE} file used for securing JGroups communications.", 23 | "parameters": [ 24 | { 25 | "displayName": "Application Name", 26 | "description": "The name for the application.", 27 | "name": "APPLICATION_NAME", 28 | "value": "eap-app", 29 | "required": true 30 | }, 31 | { 32 | "displayName": "Custom https Route Hostname", 33 | "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure--.", 34 | "name": "HOSTNAME_HTTPS", 35 | "value": "", 36 | "required": false 37 | }, 38 | { 39 | "displayName": "Git Repository URL", 40 | "description": "Git source URI for application", 41 | "name": "SOURCE_REPOSITORY_URL", 42 | "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 43 | "required": true 44 | }, 45 | { 46 | "displayName": "Git Reference", 47 | "description": "Git branch/tag reference", 48 | "name": "SOURCE_REPOSITORY_REF", 49 | "value": "openshift", 50 | "required": false 51 | }, 52 | { 53 | "displayName": "Context Directory", 54 | "description": "Path within Git project to build; empty for root project directory.", 55 | "name": "CONTEXT_DIR", 56 | "value": "kitchensink", 57 | "required": false 58 | }, 59 | { 60 | "displayName": "Queues", 61 | "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all queues used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", 62 | "name": "MQ_QUEUES", 63 | "value": "", 64 | "required": false 65 | }, 66 | { 67 | "displayName": "Topics", 68 | "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all topics used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", 69 | "name": "MQ_TOPICS", 70 | "value": "", 71 | "required": false 72 | }, 73 | { 74 | "displayName": "Server Keystore Secret Name", 75 | "description": "The name of the secret containing the keystore file", 76 | "name": "HTTPS_SECRET", 77 | "value": "eap7-app-secret", 78 | "required": true 79 | }, 80 | { 81 | "displayName": "Server Keystore Filename", 82 | "description": "The name of the keystore file within the secret", 83 | "name": "HTTPS_KEYSTORE", 84 | "value": "keystore.jks", 85 | "required": false 86 | }, 87 | { 88 | "displayName": "Server Keystore Type", 89 | "description": "The type of the keystore file (JKS or JCEKS)", 90 | "name": "HTTPS_KEYSTORE_TYPE", 91 | "value": "", 92 | "required": false 93 | }, 94 | { 95 | "displayName": "Server Certificate Name", 96 | "description": "The name associated with the server certificate", 97 | "name": "HTTPS_NAME", 98 | "value": "", 99 | "required": false 100 | }, 101 | { 102 | "displayName": "Server Keystore Password", 103 | "description": "The password for the keystore and certificate", 104 | "name": "HTTPS_PASSWORD", 105 | "value": "", 106 | "required": false 107 | }, 108 | { 109 | "displayName": "AMQ cluster password", 110 | "description": "AMQ cluster admin password", 111 | "name": "MQ_CLUSTER_PASSWORD", 112 | "from": "[a-zA-Z0-9]{8}", 113 | "generate": "expression", 114 | "required": true 115 | }, 116 | { 117 | "displayName": "Github Webhook Secret", 118 | "description": "GitHub trigger secret", 119 | "name": "GITHUB_WEBHOOK_SECRET", 120 | "from": "[a-zA-Z0-9]{8}", 121 | "generate": "expression", 122 | "required": true 123 | }, 124 | { 125 | "displayName": "Generic Webhook Secret", 126 | "description": "Generic build trigger secret", 127 | "name": "GENERIC_WEBHOOK_SECRET", 128 | "from": "[a-zA-Z0-9]{8}", 129 | "generate": "expression", 130 | "required": true 131 | }, 132 | { 133 | "displayName": "ImageStream Namespace", 134 | "description": "Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project.", 135 | "name": "IMAGE_STREAM_NAMESPACE", 136 | "value": "openshift", 137 | "required": true 138 | }, 139 | { 140 | "displayName": "JGroups Secret Name", 141 | "description": "The name of the secret containing the keystore file", 142 | "name": "JGROUPS_ENCRYPT_SECRET", 143 | "value": "eap7-app-secret", 144 | "required": false 145 | }, 146 | { 147 | "displayName": "JGroups Keystore Filename", 148 | "description": "The name of the keystore file within the secret", 149 | "name": "JGROUPS_ENCRYPT_KEYSTORE", 150 | "value": "jgroups.jceks", 151 | "required": false 152 | }, 153 | { 154 | "displayName": "JGroups Certificate Name", 155 | "description": "The name associated with the server certificate", 156 | "name": "JGROUPS_ENCRYPT_NAME", 157 | "value": "", 158 | "required": false 159 | }, 160 | { 161 | "displayName": "JGroups Keystore Password", 162 | "description": "The password for the keystore and certificate", 163 | "name": "JGROUPS_ENCRYPT_PASSWORD", 164 | "value": "", 165 | "required": false 166 | }, 167 | { 168 | "displayName": "JGroups Cluster Password", 169 | "description": "JGroups cluster password", 170 | "name": "JGROUPS_CLUSTER_PASSWORD", 171 | "from": "[a-zA-Z0-9]{8}", 172 | "generate": "expression", 173 | "required": true 174 | }, 175 | { 176 | "displayName": "Deploy Exploded Archives", 177 | "description": "Controls whether exploded deployment content should be automatically deployed", 178 | "name": "AUTO_DEPLOY_EXPLODED", 179 | "value": "false", 180 | "required": false 181 | }, 182 | { 183 | "displayName": "Maven mirror URL", 184 | "description": "Maven mirror to use for S2I builds", 185 | "name": "MAVEN_MIRROR_URL", 186 | "value": "", 187 | "required": false 188 | }, 189 | { 190 | "displayName": "Maven Additional Arguments", 191 | "description": "Maven additional arguments to use for S2I builds", 192 | "name": "MAVEN_ARGS_APPEND", 193 | "value": "-Dcom.redhat.xpaas.repo.jbossorg", 194 | "required": false 195 | }, 196 | { 197 | "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.", 198 | "name": "ARTIFACT_DIR", 199 | "value": "", 200 | "required": false 201 | }, 202 | { 203 | "description": "Container memory limit", 204 | "name": "MEMORY_LIMIT", 205 | "value": "1Gi", 206 | "required": false 207 | } 208 | ], 209 | "objects": [ 210 | { 211 | "kind": "Service", 212 | "apiVersion": "v1", 213 | "spec": { 214 | "ports": [ 215 | { 216 | "port": 8080, 217 | "targetPort": 8080 218 | } 219 | ], 220 | "selector": { 221 | "deploymentConfig": "${APPLICATION_NAME}" 222 | } 223 | }, 224 | "metadata": { 225 | "name": "${APPLICATION_NAME}", 226 | "labels": { 227 | "application": "${APPLICATION_NAME}" 228 | }, 229 | "annotations": { 230 | "description": "The web server's http port." 231 | } 232 | } 233 | }, 234 | { 235 | "kind": "Service", 236 | "apiVersion": "v1", 237 | "spec": { 238 | "ports": [ 239 | { 240 | "port": 8443, 241 | "targetPort": 8443 242 | } 243 | ], 244 | "selector": { 245 | "deploymentConfig": "${APPLICATION_NAME}" 246 | } 247 | }, 248 | "metadata": { 249 | "name": "secure-${APPLICATION_NAME}", 250 | "labels": { 251 | "application": "${APPLICATION_NAME}" 252 | }, 253 | "annotations": { 254 | "description": "The web server's https port." 255 | } 256 | } 257 | }, 258 | { 259 | "kind": "Service", 260 | "apiVersion": "v1", 261 | "spec": { 262 | "publishNotReadyAddresses": true, 263 | "clusterIP": "None", 264 | "ports": [ 265 | { 266 | "name": "ping", 267 | "port": 8888 268 | } 269 | ], 270 | "selector": { 271 | "deploymentConfig": "${APPLICATION_NAME}" 272 | } 273 | }, 274 | "metadata": { 275 | "name": "${APPLICATION_NAME}-ping", 276 | "labels": { 277 | "application": "${APPLICATION_NAME}" 278 | }, 279 | "annotations": { 280 | "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true", 281 | "description": "The JGroups ping port for clustering." 282 | } 283 | } 284 | }, 285 | { 286 | "kind": "Route", 287 | "apiVersion": "v1", 288 | "id": "${APPLICATION_NAME}-http", 289 | "metadata": { 290 | "name": "${APPLICATION_NAME}", 291 | "labels": { 292 | "application": "${APPLICATION_NAME}" 293 | }, 294 | "annotations": { 295 | "description": "Route for application's http service." 296 | } 297 | }, 298 | "spec": { 299 | "to": { 300 | "name": "${APPLICATION_NAME}" 301 | } 302 | } 303 | }, 304 | { 305 | "kind": "Route", 306 | "apiVersion": "v1", 307 | "id": "${APPLICATION_NAME}-https", 308 | "metadata": { 309 | "name": "secure-${APPLICATION_NAME}", 310 | "labels": { 311 | "application": "${APPLICATION_NAME}" 312 | }, 313 | "annotations": { 314 | "description": "Route for application's https service." 315 | } 316 | }, 317 | "spec": { 318 | "host": "${HOSTNAME_HTTPS}", 319 | "to": { 320 | "name": "secure-${APPLICATION_NAME}" 321 | }, 322 | "tls": { 323 | "termination": "passthrough" 324 | } 325 | } 326 | }, 327 | { 328 | "kind": "ImageStream", 329 | "apiVersion": "v1", 330 | "metadata": { 331 | "name": "${APPLICATION_NAME}", 332 | "labels": { 333 | "application": "${APPLICATION_NAME}" 334 | } 335 | } 336 | }, 337 | { 338 | "kind": "BuildConfig", 339 | "apiVersion": "v1", 340 | "metadata": { 341 | "name": "${APPLICATION_NAME}", 342 | "labels": { 343 | "application": "${APPLICATION_NAME}" 344 | } 345 | }, 346 | "spec": { 347 | "source": { 348 | "type": "Git", 349 | "git": { 350 | "uri": "${SOURCE_REPOSITORY_URL}", 351 | "ref": "${SOURCE_REPOSITORY_REF}" 352 | }, 353 | "contextDir": "${CONTEXT_DIR}" 354 | }, 355 | "strategy": { 356 | "type": "Source", 357 | "sourceStrategy": { 358 | "env": [ 359 | { 360 | "name": "MAVEN_MIRROR_URL", 361 | "value": "${MAVEN_MIRROR_URL}" 362 | }, 363 | { 364 | "name": "MAVEN_ARGS_APPEND", 365 | "value": "${MAVEN_ARGS_APPEND}" 366 | }, 367 | { 368 | "name": "ARTIFACT_DIR", 369 | "value": "${ARTIFACT_DIR}" 370 | } 371 | ], 372 | "forcePull": true, 373 | "incremental": true, 374 | "from": { 375 | "kind": "ImageStreamTag", 376 | "namespace": "${IMAGE_STREAM_NAMESPACE}", 377 | "name": "eap-cd-openshift:15" 378 | } 379 | } 380 | }, 381 | "output": { 382 | "to": { 383 | "kind": "ImageStreamTag", 384 | "name": "${APPLICATION_NAME}:latest" 385 | } 386 | }, 387 | "triggers": [ 388 | { 389 | "type": "GitHub", 390 | "github": { 391 | "secret": "${GITHUB_WEBHOOK_SECRET}" 392 | } 393 | }, 394 | { 395 | "type": "Generic", 396 | "generic": { 397 | "secret": "${GENERIC_WEBHOOK_SECRET}" 398 | } 399 | }, 400 | { 401 | "type": "ImageChange", 402 | "imageChange": {} 403 | }, 404 | { 405 | "type": "ConfigChange" 406 | } 407 | ] 408 | } 409 | }, 410 | { 411 | "kind": "DeploymentConfig", 412 | "apiVersion": "v1", 413 | "metadata": { 414 | "name": "${APPLICATION_NAME}", 415 | "labels": { 416 | "application": "${APPLICATION_NAME}" 417 | } 418 | }, 419 | "spec": { 420 | "strategy": { 421 | "type": "Recreate" 422 | }, 423 | "triggers": [ 424 | { 425 | "type": "ImageChange", 426 | "imageChangeParams": { 427 | "automatic": true, 428 | "containerNames": [ 429 | "${APPLICATION_NAME}" 430 | ], 431 | "from": { 432 | "kind": "ImageStreamTag", 433 | "name": "${APPLICATION_NAME}:latest" 434 | } 435 | } 436 | }, 437 | { 438 | "type": "ConfigChange" 439 | } 440 | ], 441 | "replicas": 1, 442 | "selector": { 443 | "deploymentConfig": "${APPLICATION_NAME}" 444 | }, 445 | "template": { 446 | "metadata": { 447 | "name": "${APPLICATION_NAME}", 448 | "labels": { 449 | "deploymentConfig": "${APPLICATION_NAME}", 450 | "application": "${APPLICATION_NAME}" 451 | } 452 | }, 453 | "spec": { 454 | "terminationGracePeriodSeconds": 75, 455 | "containers": [ 456 | { 457 | "name": "${APPLICATION_NAME}", 458 | "image": "${APPLICATION_NAME}", 459 | "imagePullPolicy": "Always", 460 | "resources": { 461 | "limits": { 462 | "memory": "${MEMORY_LIMIT}" 463 | } 464 | }, 465 | "volumeMounts": [ 466 | { 467 | "name": "eap-keystore-volume", 468 | "mountPath": "/etc/eap-secret-volume", 469 | "readOnly": true 470 | }, 471 | { 472 | "name": "eap-jgroups-keystore-volume", 473 | "mountPath": "/etc/jgroups-encrypt-secret-volume", 474 | "readOnly": true 475 | } 476 | ], 477 | "livenessProbe": { 478 | "exec": { 479 | "command": [ 480 | "/bin/bash", 481 | "-c", 482 | "/opt/eap/bin/livenessProbe.sh" 483 | ] 484 | }, 485 | "initialDelaySeconds": 60 486 | }, 487 | "readinessProbe": { 488 | "exec": { 489 | "command": [ 490 | "/bin/bash", 491 | "-c", 492 | "/opt/eap/bin/readinessProbe.sh" 493 | ] 494 | } 495 | }, 496 | "ports": [ 497 | { 498 | "name": "jolokia", 499 | "containerPort": 8778, 500 | "protocol": "TCP" 501 | }, 502 | { 503 | "name": "http", 504 | "containerPort": 8080, 505 | "protocol": "TCP" 506 | }, 507 | { 508 | "name": "https", 509 | "containerPort": 8443, 510 | "protocol": "TCP" 511 | }, 512 | { 513 | "name": "ping", 514 | "containerPort": 8888, 515 | "protocol": "TCP" 516 | } 517 | ], 518 | "env": [ 519 | { 520 | "name": "JGROUPS_PING_PROTOCOL", 521 | "value": "openshift.DNS_PING" 522 | }, 523 | { 524 | "name": "OPENSHIFT_DNS_PING_SERVICE_NAME", 525 | "value": "${APPLICATION_NAME}-ping" 526 | }, 527 | { 528 | "name": "OPENSHIFT_DNS_PING_SERVICE_PORT", 529 | "value": "8888" 530 | }, 531 | { 532 | "name": "HTTPS_KEYSTORE_DIR", 533 | "value": "/etc/eap-secret-volume" 534 | }, 535 | { 536 | "name": "HTTPS_KEYSTORE", 537 | "value": "${HTTPS_KEYSTORE}" 538 | }, 539 | { 540 | "name": "HTTPS_KEYSTORE_TYPE", 541 | "value": "${HTTPS_KEYSTORE_TYPE}" 542 | }, 543 | { 544 | "name": "HTTPS_NAME", 545 | "value": "${HTTPS_NAME}" 546 | }, 547 | { 548 | "name": "HTTPS_PASSWORD", 549 | "value": "${HTTPS_PASSWORD}" 550 | }, 551 | { 552 | "name": "MQ_CLUSTER_PASSWORD", 553 | "value": "${MQ_CLUSTER_PASSWORD}" 554 | }, 555 | { 556 | "name": "MQ_QUEUES", 557 | "value": "${MQ_QUEUES}" 558 | }, 559 | { 560 | "name": "MQ_TOPICS", 561 | "value": "${MQ_TOPICS}" 562 | }, 563 | { 564 | "name": "JGROUPS_ENCRYPT_SECRET", 565 | "value": "${JGROUPS_ENCRYPT_SECRET}" 566 | }, 567 | { 568 | "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR", 569 | "value": "/etc/jgroups-encrypt-secret-volume" 570 | }, 571 | { 572 | "name": "JGROUPS_ENCRYPT_KEYSTORE", 573 | "value": "${JGROUPS_ENCRYPT_KEYSTORE}" 574 | }, 575 | { 576 | "name": "JGROUPS_ENCRYPT_NAME", 577 | "value": "${JGROUPS_ENCRYPT_NAME}" 578 | }, 579 | { 580 | "name": "JGROUPS_ENCRYPT_PASSWORD", 581 | "value": "${JGROUPS_ENCRYPT_PASSWORD}" 582 | }, 583 | { 584 | "name": "JGROUPS_CLUSTER_PASSWORD", 585 | "value": "${JGROUPS_CLUSTER_PASSWORD}" 586 | }, 587 | { 588 | "name": "AUTO_DEPLOY_EXPLODED", 589 | "value": "${AUTO_DEPLOY_EXPLODED}" 590 | } 591 | ] 592 | } 593 | ], 594 | "volumes": [ 595 | { 596 | "name": "eap-keystore-volume", 597 | "secret": { 598 | "secretName": "${HTTPS_SECRET}" 599 | } 600 | }, 601 | { 602 | "name": "eap-jgroups-keystore-volume", 603 | "secret": { 604 | "secretName": "${JGROUPS_ENCRYPT_SECRET}" 605 | } 606 | } 607 | ] 608 | } 609 | } 610 | } 611 | } 612 | ] 613 | } 614 | -------------------------------------------------------------------------------- /add-ons/eap-cd/templates/eap-cd-starter-s2i.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Template", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "annotations": { 6 | "iconClass": "icon-eap", 7 | "tags": "eap,javaee,java,jboss", 8 | "version": "15.0", 9 | "openshift.io/display-name": "JBoss EAP CD 15 Starter", 10 | "openshift.io/provider-display-name": "Red Hat, Inc.", 11 | "description": "An example JBoss Enterprise Application Platform continuous delivery application. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc", 12 | "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery based application, including a build configuration, application deployment configuration and secure communication using edge TLS.", 13 | "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/", 14 | "template.openshift.io/support-url": "https://access.redhat.com" 15 | }, 16 | "name": "eap-cd-starter-s2i" 17 | }, 18 | "labels": { 19 | "template": "eap-cd-starter-s2i", 20 | "xpaas": "15.0" 21 | }, 22 | "message": "A new JBoss EAP CD based application has been created in your project.", 23 | "parameters": [ 24 | { 25 | "displayName": "Application Name", 26 | "description": "The name for the application.", 27 | "name": "APPLICATION_NAME", 28 | "value": "eap-app", 29 | "required": true 30 | }, 31 | { 32 | "displayName": "Git Repository URL", 33 | "description": "Git source URI for application", 34 | "name": "SOURCE_REPOSITORY_URL", 35 | "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", 36 | "required": true 37 | }, 38 | { 39 | "displayName": "Git Reference", 40 | "description": "Git branch/tag reference", 41 | "name": "SOURCE_REPOSITORY_REF", 42 | "value": "openshift", 43 | "required": false 44 | }, 45 | { 46 | "displayName": "Context Directory", 47 | "description": "Path within Git project to build; empty for root project directory.", 48 | "name": "CONTEXT_DIR", 49 | "value": "kitchensink", 50 | "required": false 51 | }, 52 | { 53 | "displayName": "Github Webhook Secret", 54 | "description": "GitHub trigger secret", 55 | "name": "GITHUB_WEBHOOK_SECRET", 56 | "from": "[a-zA-Z0-9]{8}", 57 | "generate": "expression", 58 | "required": true 59 | }, 60 | { 61 | "displayName": "Generic Webhook Secret", 62 | "description": "Generic build trigger secret", 63 | "name": "GENERIC_WEBHOOK_SECRET", 64 | "from": "[a-zA-Z0-9]{8}", 65 | "generate": "expression", 66 | "required": true 67 | }, 68 | { 69 | "displayName": "ImageStream Namespace", 70 | "description": "Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project.", 71 | "name": "IMAGE_STREAM_NAMESPACE", 72 | "value": "openshift", 73 | "required": true 74 | }, 75 | { 76 | "displayName": "Deploy Exploded Archives", 77 | "description": "Controls whether exploded deployment content should be automatically deployed", 78 | "name": "AUTO_DEPLOY_EXPLODED", 79 | "value": "false", 80 | "required": false 81 | }, 82 | { 83 | "displayName": "Maven mirror URL", 84 | "description": "Maven mirror to use for S2I builds", 85 | "name": "MAVEN_MIRROR_URL", 86 | "value": "", 87 | "required": false 88 | }, 89 | { 90 | "displayName": "Maven Additional Arguments", 91 | "description": "Maven additional arguments to use for S2I builds", 92 | "name": "MAVEN_ARGS_APPEND", 93 | "value": "-Dcom.redhat.xpaas.repo.jbossorg", 94 | "required": false 95 | }, 96 | { 97 | "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.", 98 | "name": "ARTIFACT_DIR", 99 | "value": "", 100 | "required": false 101 | }, 102 | { 103 | "description": "Container memory limit", 104 | "name": "MEMORY_LIMIT", 105 | "value": "1Gi", 106 | "required": false 107 | } 108 | ], 109 | "objects": [ 110 | { 111 | "kind": "Service", 112 | "apiVersion": "v1", 113 | "spec": { 114 | "ports": [ 115 | { 116 | "port": 8080, 117 | "targetPort": 8080 118 | } 119 | ], 120 | "selector": { 121 | "deploymentConfig": "${APPLICATION_NAME}" 122 | } 123 | }, 124 | "metadata": { 125 | "name": "${APPLICATION_NAME}", 126 | "labels": { 127 | "application": "${APPLICATION_NAME}" 128 | }, 129 | "annotations": { 130 | "description": "The web server's http port." 131 | } 132 | } 133 | }, 134 | { 135 | "kind": "Route", 136 | "apiVersion": "v1", 137 | "id": "${APPLICATION_NAME}-https", 138 | "metadata": { 139 | "name": "${APPLICATION_NAME}", 140 | "labels": { 141 | "application": "${APPLICATION_NAME}" 142 | }, 143 | "annotations": { 144 | "description": "Route for application's https service." 145 | } 146 | }, 147 | "spec": { 148 | "to": { 149 | "name": "${APPLICATION_NAME}" 150 | }, 151 | "tls": { 152 | "insecureEdgeTerminationPolicy": "Redirect", 153 | "termination": "edge" 154 | } 155 | } 156 | }, 157 | { 158 | "kind": "ImageStream", 159 | "apiVersion": "v1", 160 | "metadata": { 161 | "name": "${APPLICATION_NAME}", 162 | "labels": { 163 | "application": "${APPLICATION_NAME}" 164 | } 165 | } 166 | }, 167 | { 168 | "kind": "BuildConfig", 169 | "apiVersion": "v1", 170 | "metadata": { 171 | "name": "${APPLICATION_NAME}", 172 | "labels": { 173 | "application": "${APPLICATION_NAME}" 174 | } 175 | }, 176 | "spec": { 177 | "source": { 178 | "type": "Git", 179 | "git": { 180 | "uri": "${SOURCE_REPOSITORY_URL}", 181 | "ref": "${SOURCE_REPOSITORY_REF}" 182 | }, 183 | "contextDir": "${CONTEXT_DIR}" 184 | }, 185 | "strategy": { 186 | "type": "Source", 187 | "sourceStrategy": { 188 | "env": [ 189 | { 190 | "name": "MAVEN_MIRROR_URL", 191 | "value": "${MAVEN_MIRROR_URL}" 192 | }, 193 | { 194 | "name": "MAVEN_ARGS_APPEND", 195 | "value": "${MAVEN_ARGS_APPEND}" 196 | }, 197 | { 198 | "name": "ARTIFACT_DIR", 199 | "value": "${ARTIFACT_DIR}" 200 | } 201 | ], 202 | "forcePull": true, 203 | "incremental": true, 204 | "from": { 205 | "kind": "ImageStreamTag", 206 | "namespace": "${IMAGE_STREAM_NAMESPACE}", 207 | "name": "eap-cd-openshift:15" 208 | } 209 | } 210 | }, 211 | "output": { 212 | "to": { 213 | "kind": "ImageStreamTag", 214 | "name": "${APPLICATION_NAME}:latest" 215 | } 216 | }, 217 | "triggers": [ 218 | { 219 | "type": "GitHub", 220 | "github": { 221 | "secret": "${GITHUB_WEBHOOK_SECRET}" 222 | } 223 | }, 224 | { 225 | "type": "Generic", 226 | "generic": { 227 | "secret": "${GENERIC_WEBHOOK_SECRET}" 228 | } 229 | }, 230 | { 231 | "type": "ImageChange", 232 | "imageChange": {} 233 | }, 234 | { 235 | "type": "ConfigChange" 236 | } 237 | ] 238 | } 239 | }, 240 | { 241 | "kind": "DeploymentConfig", 242 | "apiVersion": "v1", 243 | "metadata": { 244 | "name": "${APPLICATION_NAME}", 245 | "labels": { 246 | "application": "${APPLICATION_NAME}" 247 | } 248 | }, 249 | "spec": { 250 | "strategy": { 251 | "type": "Recreate" 252 | }, 253 | "triggers": [ 254 | { 255 | "type": "ImageChange", 256 | "imageChangeParams": { 257 | "automatic": true, 258 | "containerNames": [ 259 | "${APPLICATION_NAME}" 260 | ], 261 | "from": { 262 | "kind": "ImageStreamTag", 263 | "name": "${APPLICATION_NAME}:latest" 264 | } 265 | } 266 | }, 267 | { 268 | "type": "ConfigChange" 269 | } 270 | ], 271 | "replicas": 1, 272 | "selector": { 273 | "deploymentConfig": "${APPLICATION_NAME}" 274 | }, 275 | "template": { 276 | "metadata": { 277 | "name": "${APPLICATION_NAME}", 278 | "labels": { 279 | "deploymentConfig": "${APPLICATION_NAME}", 280 | "application": "${APPLICATION_NAME}" 281 | } 282 | }, 283 | "spec": { 284 | "terminationGracePeriodSeconds": 75, 285 | "containers": [ 286 | { 287 | "name": "${APPLICATION_NAME}", 288 | "image": "${APPLICATION_NAME}", 289 | "imagePullPolicy": "Always", 290 | "resources": { 291 | "limits": { 292 | "memory": "${MEMORY_LIMIT}" 293 | } 294 | }, 295 | "livenessProbe": { 296 | "exec": { 297 | "command": [ 298 | "/bin/bash", 299 | "-c", 300 | "/opt/eap/bin/livenessProbe.sh" 301 | ] 302 | }, 303 | "initialDelaySeconds": 60 304 | }, 305 | "readinessProbe": { 306 | "exec": { 307 | "command": [ 308 | "/bin/bash", 309 | "-c", 310 | "/opt/eap/bin/readinessProbe.sh" 311 | ] 312 | } 313 | }, 314 | "ports": [ 315 | { 316 | "name": "jolokia", 317 | "containerPort": 8778, 318 | "protocol": "TCP" 319 | }, 320 | { 321 | "name": "http", 322 | "containerPort": 8080, 323 | "protocol": "TCP" 324 | } 325 | ], 326 | "env": [ 327 | { 328 | "name": "AUTO_DEPLOY_EXPLODED", 329 | "value": "${AUTO_DEPLOY_EXPLODED}" 330 | } 331 | ] 332 | } 333 | ] 334 | } 335 | } 336 | } 337 | } 338 | ] 339 | } 340 | -------------------------------------------------------------------------------- /add-ons/example/example.addon: -------------------------------------------------------------------------------- 1 | # Name: example 2 | # Description: Shows basic functionality of an add-on 3 | 4 | # Application of the add-on 5 | # several commands can be used: echo, sleep, ssh, docker, oc, openshift 6 | echo Setting up an example add-on 7 | 8 | # Addon successfully applied 9 | echo Example add-on successfully applied 10 | -------------------------------------------------------------------------------- /add-ons/example/example.addon.remove: -------------------------------------------------------------------------------- 1 | # Name: example 2 | # Description: Removes example add-on 3 | 4 | # Removing the add-on 5 | echo Removing example add-on 6 | 7 | # Removed 8 | echo Example add-on successfully removed 9 | -------------------------------------------------------------------------------- /add-ons/fabric8-launcher/README.md: -------------------------------------------------------------------------------- 1 | # Fabric8 Launcher Add-on 2 | 3 | This is an add-on to install Fabric8 Launcher 4 | 5 | Verify you have installed these addons, by following the general [readme](https://github.com/minishift/minishift-addons/blob/master/README.adoc#download-and-use-community-add-ons). 6 | 7 | As explained in the readme, clone the repository to get addons to your workstation. 8 | 9 | ## Start Minishift 10 | 11 | Start minishift with additional memory allocation. 12 | 13 | ``` 14 | $ minishift start --memory=4GB 15 | ``` 16 | 17 | Depending on the number of boosters you plan on running, the memory allocated to minishift will vary and should be more than the 2GB default. 18 | 19 | 20 | ## Install Add-on 21 | 22 | Run the following command after you start minishift. 23 | 24 | ``` 25 | $ minishift addon install 26 | ``` 27 | 28 | ## Deploy Add-on 29 | 30 | 1. You'll need a github account. 31 | 2. Navigate to [https://github.com/settings/tokens](https://github.com/settings/tokens) 32 | 3. Select Generate new token 33 | 4. Add a token description, for example Fabric8 Launcher tool on a Single-node OpenShift Cluster. 34 | 5. Select the check boxes of the following parent scopes and all their children: 35 | * public_repo 36 | * read:org 37 | * admin:repo_hook 38 | 6. Click `Generate Token` 39 | 7. Save the hex code of the personal access token. 40 | 8. To deploy launcher substituting the values for the variables. 41 | 42 | ``` 43 | $ minishift addons apply fabric8-launcher \ 44 | --addon-env GITHUB_USERNAME= \ 45 | --addon-env GITHUB_TOKEN= 46 | ``` 47 | 48 | This creates a project with name `rhoarpad` and spins up the launcher in that project. 49 | 50 | ## Remove Add-on 51 | 52 | To remove add-on simply run 53 | 54 | ``` 55 | $ minishift addons remove fabric8-launcher 56 | ``` 57 | 58 | ## Uninstall Add-on 59 | To uninstall add-on run 60 | 61 | ``` 62 | $ minishift addons uninstall fabric8-launcher 63 | ``` 64 | 65 | 66 | -------------------------------------------------------------------------------- /add-ons/fabric8-launcher/fabric8-launcher.addon: -------------------------------------------------------------------------------- 1 | ################################################################################################### 2 | # Name: fabric8-launcher 3 | # Description: Installs Fabric8 Launcher in a project named rhoarpad 4 | # Required-Vars: GITHUB_USERNAME, GITHUB_TOKEN,OPENSHIFT_USERNAME,OPENSHIFT_PASSWORD 5 | # OpenShift-Version: >=3.9.0 6 | # Var-Defaults: OPENSHIFT_USERNAME=developer,OPENSHIFT_PASSWORD=developer,CONSOLE_URL=https://#{ip}:8443,LAUNCHER_PROJ=rhoarpad 7 | # Url: Template from https://raw.githubusercontent.com/fabric8-launcher/launcher-openshift-templates/master/openshift/launcher-template.yaml 8 | ################################################################################################### 9 | 10 | # login 11 | oc login -u #{OPENSHIFT_USERNAME} -p #{OPENSHIFT_PASSWORD} 12 | 13 | # create project 14 | oc new-project #{LAUNCHER_PROJ} 15 | 16 | # add template 17 | oc create -n #{LAUNCHER_PROJ} -f https://raw.githubusercontent.com/fabric8-launcher/launcher-openshift-templates/master/openshift/launcher-template.yaml 18 | 19 | # instantiate launcher 20 | oc new-app fabric8-launcher --name=launcher -n #{LAUNCHER_PROJ} -p LAUNCHER_MISSIONCONTROL_GITHUB_USERNAME=#{GITHUB_USERNAME} -p LAUNCHER_MISSIONCONTROL_GITHUB_TOKEN=#{GITHUB_TOKEN} -p LAUNCHER_MISSIONCONTROL_OPENSHIFT_CONSOLE_URL=#{CONSOLE_URL} -p LAUNCHER_MISSIONCONTROL_OPENSHIFT_API_URL=#{CONSOLE_URL} -p LAUNCHER_MISSIONCONTROL_OPENSHIFT_USERNAME=#{OPENSHIFT_USERNAME} -p LAUNCHER_MISSIONCONTROL_OPENSHIFT_PASSWORD=#{OPENSHIFT_PASSWORD} -p LAUNCHER_KEYCLOAK_URL= -p LAUNCHER_KEYCLOAK_REALM= 21 | -------------------------------------------------------------------------------- /add-ons/fabric8-launcher/fabric8-launcher.addon.remove: -------------------------------------------------------------------------------- 1 | ################################################################################################### 2 | # Name: fabric8-launcher 3 | # Description: removes Fabric8 Launcher in a project named rhoarpad 4 | # OpenShift-Version: >3.9.0 5 | # Url: Template from https://raw.githubusercontent.com/fabric8-launcher/launcher-openshift-templates/master/openshift/launcher-template.yaml 6 | ################################################################################################### 7 | 8 | oc delete project rhoarpad 9 | -------------------------------------------------------------------------------- /add-ons/fabric8/README.md: -------------------------------------------------------------------------------- 1 | # Fabric8 Add-on 2 | 3 | 4 | 5 | - [Using the Fabric8 Add-on](#using-the-fabric8-add-on) 6 | - [Install add-on](#install-add-on) 7 | - [Start Minishift](#start-minishift) 8 | - [Setup GitHub OAuth client ID and secret](#setup-github-oauth-client-id-and-secret) 9 | - [Apply add-on](#apply-add-on) 10 | 11 | 12 | 13 | This addon provides an easy way to install Fabric8 on MiniShift. 14 | 15 | Fabric8 provides a complete developer platform for creating projects, editing them and performing full CI / CD for the entire developer life-cycle. 16 | 17 | 18 | ## Using the Fabric8 Add-on 19 | 20 | The best way of using this add-on is via the [`minishift add-ons apply`](https://docs.okd.io/latest/minishift/command-ref/minishift_addons_apply.html) command which is outlined in the following paragraphs. 21 | 22 | 23 | ### Install add-on 24 | 25 | Clone this repository onto your local machine and then install the add-on via: 26 | 27 | $ minishift addons install 28 | 29 | 30 | ### Start Minishift 31 | 32 | We currently recommend you use at least 5Gb of RAM in your minishift VM and today we recommend at least 5 CPUs. Though longer term we'll add much lower CPU limits so that folks can omit that. 33 | 34 | So start minishift using something like this: 35 | 36 | $ minishift start --memory=5GB --cpus=5 --disk-size=50GB 37 | 38 | 39 | ### Setup GitHub OAuth client ID and secret 40 | 41 | Fabric8 has GitHub integration letting you browse repositories, create new repositories, edit projects and setup automated CI / CD jobs with webhooks on GitHub. 42 | 43 | This requires an [OAuth application to be setup on your GitHub account](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/registering-oauth-apps/) for Fabric8 and you need to obtain the client ID and secret for the OAuth application. 44 | 45 | You will need to register the redirect URI in the OAuth application to point to the output of this command: 46 | 47 | $ echo http://keycloak-fabric8.$(minishift ip).nip.io/auth/realms/fabric8/broker/github/endpoint 48 | 49 | So please follow the following steps using the above redirect URL and `http://fabric8.io` as a sample homepage URL: 50 | 51 | ![Register OAuth App](https://raw.githubusercontent.com/fabric8io/fabric8-platform/master/images/register-oauth.png) 52 | 53 | Once you have created the OAuth application for Fabric8 in your GitHub settings and found your client ID and secret, set the following environment variables: 54 | 55 | $ export GITHUB_OAUTH_CLIENT_ID=TODO 56 | $ export GITHUB_OAUTH_CLIENT_SECRET=TODO 57 | 58 | where the above `TODO` text is replaced by the actual client id and secret from your GitHub settings page! 59 | 60 | 61 | ### Apply add-on 62 | 63 | Once you have the 2 GitHub environment variables defined you can apply the Fabric8 addon via: 64 | 65 | $ minishift addon apply --addon-env GITHUB_OAUTH_CLIENT_ID=$GITHUB_OAUTH_CLIENT_ID --addon-env GITHUB_OAUTH_CLIENT_SECRET=$GITHUB_OAUTH_CLIENT_SECRET fabric8 66 | -------------------------------------------------------------------------------- /add-ons/fabric8/fabric8.addon: -------------------------------------------------------------------------------- 1 | # Name: fabric8 2 | # Description: Installs fabric8 locally on Minishift 3 | # Required-Vars: GITHUB_OAUTH_CLIENT_ID,GITHUB_OAUTH_CLIENT_SECRET 4 | 5 | echo NOTE: To delete this addon, execute: 6 | echo oc delete project/fabric8 project/developer oauthclient/fabric8-online-platform 7 | 8 | echo "Enabling CORS" 9 | openshift ex config patch /var/lib/origin/openshift.local.config/master/master-config.yaml --patch='{"corsAllowedOrigins": [".*"]}' 10 | docker restart origin 11 | 12 | # TODO how best to wait for openshift to be back? 13 | sleep 10 14 | 15 | oc adm new-project developer 16 | oc adm new-project fabric8 17 | 18 | echo Installing the Fabric8 System using GitHub Client ID #{GITHUB_OAUTH_CLIENT_SECRET} 19 | oc new-app --param APISERVER_HOSTPORT="#{ip}:8443" --param GITHUB_OAUTH_CLIENT_SECRET=#{GITHUB_OAUTH_CLIENT_SECRET} --param GITHUB_OAUTH_CLIENT_ID=#{GITHUB_OAUTH_CLIENT_ID} --param HTTP=true https://raw.githubusercontent.com/fabric8io/fabric8-resources/master/fabric8-system-openshift.yml -n fabric8 20 | 21 | oc adm policy add-role-to-user admin developer -n developer 22 | oc adm policy add-role-to-user admin developer -n fabric8 23 | 24 | echo Adding the OAuthClient and cluster-admin role to the init-tenant service account 25 | oc --as system:admin new-app --param URL=keycloak-fabric8.#{routing-suffix}/auth/realms/fabric8/broker/openshift-v3/endpoint https://raw.githubusercontent.com/fabric8io/fabric8-resources/master/fabric8-oauthclient-template.yml 26 | oc --as system:admin adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:fabric8:init-tenant 27 | 28 | echo Please wait while the pods all startup! 29 | echo - 30 | echo To watch this happening you can type: 31 | echo oc get pod -l provider=fabric8 -n fabric8 -w 32 | echo - 33 | echo Or you can watch in the OpenShift console via: 34 | echo minishift console 35 | echo - 36 | echo Then you should be able the open the fabric8 console here: 37 | echo http://fabric8-fabric8.#{routing-suffix}/ 38 | -------------------------------------------------------------------------------- /add-ons/grafana/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Grafana Add-on 3 | 4 | This addon install grafana for metrics visualization 5 | 6 | ## Prerequisites 7 | 8 | Start minishift with --metrics option and memory 4 GB or more 9 | 10 | Run 'management-infra' addon as: 11 | 12 | ``` 13 | $ minishift addon install management-infra 14 | $ minishift addon apply management-infra 15 | ``` 16 | 17 | ## Deploy grafana 18 | 19 | To deploy grafana do: 20 | 21 | ``` 22 | $ minishift addon install grafana 23 | $ minishift addon apply grafana --addon-env namespace=grafana 24 | ``` 25 | 26 | _NOTE_: namespace is a required environment variable for the add-on to run. Refer [addon-dynamic-variables](https://docs.okd.io/latest/minishift/using/addons.html#addon-dynamic-variables) documentation. 27 | 28 | ## Use grafana 29 | grafana will be available at: 30 | 31 | ``` 32 | $ minishift openshift service hawkular-grafana -n grafana 33 | ``` 34 | 35 | After connecting to grafana, you should log as user: admin, password: admin 36 | 37 | Add a datasource with: 38 | * Type: Hawkular 39 | * Url: the url given by "oc get route hawkular-metrics -n openshift-infra -o jsonpath='https://{.spec.host}/hawkular/metrics'" 40 | * Access: proxy 41 | * Auth type: With Credentials 42 | * Tenant: _system (or any namespace) 43 | * Token: the result of "oc sa get-token management-admin -n management-infra --as=system:admin" 44 | 45 | Then, you can get any dashboard. 46 | 47 | An [example](cluster-metrics-per-namespace.json) is provided in this folder. When importing the dashboard, use the datasource created before. 48 | 49 | 50 | ## Delete grafana 51 | Delete grafana with: 52 | 53 | ``` 54 | $ oc delete project -n grafana --as=system:admin 55 | ``` 56 | -------------------------------------------------------------------------------- /add-ons/grafana/cluster-metrics-per-namespace.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_OPENSHIFT", 5 | "label": "Openshift", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "hawkular-datasource", 9 | "pluginName": "Hawkular" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.1.2" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "hawkular-datasource", 28 | "name": "Hawkular", 29 | "version": "1.0.10" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "editable": true, 36 | "gnetId": null, 37 | "graphTooltip": 0, 38 | "hideControls": false, 39 | "id": null, 40 | "links": [], 41 | "rows": [ 42 | { 43 | "collapse": false, 44 | "height": 386, 45 | "panels": [ 46 | { 47 | "aliasColors": {}, 48 | "bars": false, 49 | "datasource": "${DS_OPENSHIFT}", 50 | "fill": 1, 51 | "id": 1, 52 | "legend": { 53 | "alignAsTable": true, 54 | "avg": false, 55 | "current": true, 56 | "hideEmpty": false, 57 | "hideZero": false, 58 | "max": false, 59 | "min": false, 60 | "rightSide": true, 61 | "show": true, 62 | "total": false, 63 | "values": true 64 | }, 65 | "lines": true, 66 | "linewidth": 3, 67 | "links": [], 68 | "nullPointMode": "null", 69 | "percentage": false, 70 | "pointradius": 5, 71 | "points": false, 72 | "renderer": "flot", 73 | "repeat": null, 74 | "seriesOverrides": [], 75 | "span": 12, 76 | "stack": false, 77 | "steppedLine": false, 78 | "targets": [ 79 | { 80 | "hide": false, 81 | "id": "ns/$namespace/memory/usage", 82 | "rate": false, 83 | "raw": true, 84 | "rawTagsQuery": true, 85 | "refId": "A", 86 | "seriesAggFn": "none", 87 | "stats": [], 88 | "tags": [], 89 | "tagsQL": "", 90 | "type": "gauge" 91 | } 92 | ], 93 | "thresholds": [], 94 | "timeFrom": null, 95 | "timeShift": null, 96 | "title": "Memory Usage", 97 | "tooltip": { 98 | "shared": true, 99 | "sort": 2, 100 | "value_type": "individual" 101 | }, 102 | "transparent": true, 103 | "type": "graph", 104 | "xaxis": { 105 | "mode": "time", 106 | "name": null, 107 | "show": true, 108 | "values": [ 109 | "total" 110 | ] 111 | }, 112 | "yaxes": [ 113 | { 114 | "format": "decbytes", 115 | "label": "", 116 | "logBase": 2, 117 | "max": null, 118 | "min": "8388608", 119 | "show": true 120 | }, 121 | { 122 | "format": "short", 123 | "label": null, 124 | "logBase": 1, 125 | "max": null, 126 | "min": null, 127 | "show": true 128 | } 129 | ] 130 | } 131 | ], 132 | "repeat": null, 133 | "repeatIteration": null, 134 | "repeatRowId": null, 135 | "showTitle": false, 136 | "title": "Dashboard Row", 137 | "titleSize": "h6" 138 | }, 139 | { 140 | "collapse": false, 141 | "height": 250, 142 | "panels": [ 143 | { 144 | "aliasColors": {}, 145 | "bars": false, 146 | "datasource": "${DS_OPENSHIFT}", 147 | "fill": 1, 148 | "id": 2, 149 | "legend": { 150 | "alignAsTable": true, 151 | "avg": false, 152 | "current": true, 153 | "max": false, 154 | "min": false, 155 | "rightSide": true, 156 | "show": true, 157 | "total": false, 158 | "values": true 159 | }, 160 | "lines": true, 161 | "linewidth": 1, 162 | "links": [], 163 | "nullPointMode": "null", 164 | "percentage": false, 165 | "pointradius": 5, 166 | "points": false, 167 | "renderer": "flot", 168 | "seriesOverrides": [], 169 | "span": 12, 170 | "stack": false, 171 | "steppedLine": false, 172 | "targets": [ 173 | { 174 | "id": "ns/$namespace/cpu/usage_rate", 175 | "rate": false, 176 | "raw": true, 177 | "refId": "A", 178 | "seriesAggFn": "none", 179 | "stats": [], 180 | "tags": [], 181 | "tagsQL": "", 182 | "type": "gauge" 183 | } 184 | ], 185 | "thresholds": [], 186 | "timeFrom": null, 187 | "timeShift": null, 188 | "title": "CPU Usage", 189 | "tooltip": { 190 | "shared": true, 191 | "sort": 2, 192 | "value_type": "individual" 193 | }, 194 | "transparent": true, 195 | "type": "graph", 196 | "xaxis": { 197 | "mode": "time", 198 | "name": null, 199 | "show": true, 200 | "values": [] 201 | }, 202 | "yaxes": [ 203 | { 204 | "format": "short", 205 | "label": "millicores", 206 | "logBase": 1, 207 | "max": null, 208 | "min": null, 209 | "show": true 210 | }, 211 | { 212 | "format": "short", 213 | "label": null, 214 | "logBase": 1, 215 | "max": null, 216 | "min": null, 217 | "show": true 218 | } 219 | ] 220 | } 221 | ], 222 | "repeat": null, 223 | "repeatIteration": null, 224 | "repeatRowId": null, 225 | "showTitle": false, 226 | "title": "Dashboard Row", 227 | "titleSize": "h6" 228 | } 229 | ], 230 | "schemaVersion": 14, 231 | "style": "dark", 232 | "tags": [], 233 | "templating": { 234 | "list": [ 235 | { 236 | "allValue": null, 237 | "current": {}, 238 | "datasource": "${DS_OPENSHIFT}", 239 | "hide": 0, 240 | "includeAll": true, 241 | "label": null, 242 | "multi": true, 243 | "name": "namespace", 244 | "options": [], 245 | "query": "tags/namespace_name:*", 246 | "refresh": 1, 247 | "regex": "", 248 | "sort": 0, 249 | "tagValuesQuery": "", 250 | "tags": [], 251 | "tagsQuery": "", 252 | "type": "query", 253 | "useTags": false 254 | } 255 | ] 256 | }, 257 | "time": { 258 | "from": "now-6h", 259 | "to": "now" 260 | }, 261 | "timepicker": { 262 | "refresh_intervals": [ 263 | "5s", 264 | "10s", 265 | "30s", 266 | "1m", 267 | "5m", 268 | "15m", 269 | "30m", 270 | "1h", 271 | "2h", 272 | "1d" 273 | ], 274 | "time_options": [ 275 | "5m", 276 | "15m", 277 | "1h", 278 | "6h", 279 | "12h", 280 | "24h", 281 | "2d", 282 | "7d", 283 | "30d" 284 | ] 285 | }, 286 | "timezone": "browser", 287 | "title": "Cluster Metrics Per Namespace", 288 | "version": 8 289 | } -------------------------------------------------------------------------------- /add-ons/grafana/grafana.addon: -------------------------------------------------------------------------------- 1 | # Name: grafana 2 | # Description: This template adds grafana for displaying Openshift Metrics in its own namespace. If requires metrics and management-infra addon, to connect to hawkular-metrics on openshift. 3 | # Url: https://raw.githubusercontent.com/hawkular/hawkular-grafana-datasource/master/openshift/openshift-template-persistent.yml 4 | # Required-Vars: namespace 5 | 6 | # TODO: Once conditional commands are there, create the namespace if it does not exist 7 | oc adm new-project #{namespace} 8 | oc new-app -f openshift-template-persistent.yml -n #{namespace} 9 | 10 | echo You have installed #{addon-name} 11 | echo To access #{addon-name} go to http://hawkular-grafana-#{namespace}.#{routing-suffix} 12 | echo See http://www.hawkular.org/blog/2016/10/24/hawkular-metrics-openshift-and-grafana.html 13 | echo To get a permanent credential token, if management-infra addons is installed, use "oc sa get-token management-admin -n management-infra --as=system:admin" 14 | echo 15 | echo To delete: 16 | echo oc delete project -n #{namespace} --as=system:admin 17 | -------------------------------------------------------------------------------- /add-ons/grafana/openshift-template-persistent.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Template 4 | metadata: 5 | labels: 6 | app: hawkular-grafana-persistent 7 | group: org.hawkular 8 | name: hawkular-grafana-persistent 9 | objects: 10 | - apiVersion: v1 11 | kind: Service 12 | metadata: 13 | labels: 14 | app: hawkular-grafana-persistent 15 | group: org.hawkular 16 | name: hawkular-grafana 17 | spec: 18 | ports: 19 | - name: 3000-tcp 20 | port: 3000 21 | protocol: TCP 22 | selector: 23 | app: hawkular-grafana-persistent 24 | deploymentconfig: hawkular-grafana 25 | group: org.hawkular 26 | - apiVersion: v1 27 | kind: Route 28 | metadata: 29 | labels: 30 | app: hawkular-grafana-persistent 31 | group: org.hawkular 32 | name: hawkular-grafana 33 | spec: 34 | to: 35 | kind: Service 36 | name: hawkular-grafana 37 | - apiVersion: v1 38 | kind: ImageStream 39 | metadata: 40 | labels: 41 | app: hawkular-grafana-persistent 42 | group: org.hawkular 43 | name: hawkular-grafana 44 | - apiVersion: v1 45 | kind: BuildConfig 46 | metadata: 47 | labels: 48 | app: hawkular-grafana-persistent 49 | group: org.hawkular 50 | name: hawkular-grafana 51 | spec: 52 | output: 53 | to: 54 | kind: ImageStreamTag 55 | name: hawkular-grafana:latest 56 | source: 57 | contextDir: docker 58 | git: 59 | uri: https://github.com/hawkular/hawkular-grafana-datasource.git 60 | type: Git 61 | strategy: 62 | dockerStrategy: 63 | from: 64 | kind: DockerImage 65 | name: centos:7 66 | type: Docker 67 | triggers: 68 | - type: ConfigChange 69 | - apiVersion: v1 70 | kind: PersistentVolumeClaim 71 | metadata: 72 | labels: 73 | app: hawkular-grafana-persistent 74 | group: org.hawkular 75 | name: hawkular-grafana-data 76 | spec: 77 | accessModes: 78 | - ReadWriteOnce 79 | resources: 80 | requests: 81 | storage: 1Gi 82 | - apiVersion: v1 83 | kind: DeploymentConfig 84 | metadata: 85 | labels: 86 | app: hawkular-grafana-persistent 87 | group: org.hawkular 88 | name: hawkular-grafana 89 | spec: 90 | replicas: 1 91 | selector: 92 | app: hawkular-grafana-persistent 93 | deploymentconfig: hawkular-grafana 94 | strategy: 95 | rollingParams: 96 | timeoutSeconds: 10800 97 | type: Rolling 98 | template: 99 | metadata: 100 | annotations: 101 | openshift.io/container.hawkular-grafana.image.entrypoint: '["/run.sh"]' 102 | labels: 103 | app: hawkular-grafana-persistent 104 | deploymentconfig: hawkular-grafana 105 | group: org.hawkular 106 | spec: 107 | containers: 108 | - env: 109 | - name: KUBERNETES_NAMESPACE 110 | valueFrom: 111 | fieldRef: 112 | fieldPath: metadata.namespace 113 | image: hawkular-grafana:latest 114 | imagePullPolicy: Always 115 | name: hawkular-grafana 116 | ports: 117 | - containerPort: 3000 118 | name: http 119 | protocol: TCP 120 | readinessProbe: 121 | httpGet: 122 | path: / 123 | port: 3000 124 | livenessProbe: 125 | httpGet: 126 | path: / 127 | port: 3000 128 | volumeMounts: 129 | - mountPath: /var/lib/grafana/data 130 | name: hawkular-grafana-data 131 | restartPolicy: Always 132 | volumes: 133 | - name: hawkular-grafana-data 134 | persistentVolumeClaim: 135 | claimName: hawkular-grafana-data 136 | readOnly: false 137 | test: false 138 | triggers: 139 | - type: ConfigChange 140 | - imageChangeParams: 141 | automatic: true 142 | containerNames: 143 | - hawkular-grafana 144 | from: 145 | kind: ImageStreamTag 146 | name: hawkular-grafana:latest 147 | type: ImageChange 148 | -------------------------------------------------------------------------------- /add-ons/helm/README.md: -------------------------------------------------------------------------------- 1 | # Helm Add-on 2 | 3 | Don't forget to read the [general readme](../../README.adoc#download-and-use-community-add-ons). 4 | 5 | Tiller is the server side part of helm. You can check how to installs kubernetes helm in this [link](https://github.com/kubernetes/helm). 6 | 7 | **NOTE** Please check in the [version](version) file to confirm the current release is compatible with the helm client and tiller server. 8 | 9 | Before install helm into minishift please check if your minishift was started with defaults installed and admin-user enabled: 10 | 11 | ``` 12 | $ minishift addons install --defaults 13 | Default add-ons 'anyuid, admin-user, xpaas, registry-route' installed 14 | 15 | $ minishift addons enable admin-user 16 | Add-on 'admin-user' enabled 17 | ``` 18 | 19 | After configured your minishift you can start using, for example: 20 | 21 | ``` 22 | $ minishift start --profile minishift --disk-size 40gb --memory 4096mb 23 | ``` 24 | 25 | The options above are not mandatory but show how you can define memory and disk for your local deployments. 26 | 27 | 28 | ## Deploy and install helm tiller 29 | To deploy tiller on Minishift or OpenShift, apply this addon: 30 | 31 | ``` 32 | $ minishift addons install helm 33 | $ minishift addons apply helm 34 | ``` 35 | 36 | 37 | ## Discover tiller host 38 | Get `oc`, `helm_host`(tiller) and `minishift` by adding this new variable into ~/.bashrc 39 | 40 | ``` 41 | eval "$(minishift oc-env)" 42 | export HELM_HOST="$(minishift ip):$(oc get svc/tiller -o jsonpath='{.spec.ports[0].nodePort}' -n kube-system --as=system:admin)" 43 | export MINISHIFT_ADMIN_CONTEXT="default/$(oc config view -o jsonpath='{.contexts[?(@.name=="minishift")].context.cluster}')/system:admin" 44 | ``` 45 | 46 | After added these new variables into ~/.bashrc can read it: 47 | 48 | ``` 49 | $ source ~/.bashrc 50 | ``` 51 | 52 | 53 | ## Use helm with minishift 54 | 55 | Once helm tiller has been deployed into minishift, you should configure your local helm instance to talk to this host. 56 | 57 | To use helm, provide the minishift host to your helm config or to any helm command: 58 | 59 | ``` 60 | $ helm init -c 61 | ``` 62 | 63 | or 64 | 65 | ``` 66 | $ helm 67 | ``` 68 | 69 | Search for an application: 70 | 71 | ``` 72 | helm search 73 | ``` 74 | 75 | 76 | And now deploy an application 77 | 78 | ``` 79 | $ helm install 80 | ``` 81 | 82 | _NOTE_: Minishift admin context can be skipped if selected by default 83 | 84 | 85 | ## Delete tiller 86 | If you want to delete tiller, just do: 87 | 88 | ``` 89 | $ oc delete sa/helm deployment/tiller-deploy svc/tiller -n kube-system --as=system:admin 90 | ``` 91 | -------------------------------------------------------------------------------- /add-ons/helm/helm.addon: -------------------------------------------------------------------------------- 1 | # Name: helm 2 | # Description: Installs helm 3 | 4 | # Pull the image 5 | docker pull lachlanevenson/k8s-helm:v2.8.1 6 | 7 | # Deploy helm 8 | docker run --rm -v /home/docker:/root:z -v /var/lib/minishift/openshift.local.config:/var/lib/minishift/openshift.local.config:z --net=host --env KUBECONFIG=/var/lib/minishift/openshift.local.config/master/admin.kubeconfig --env HELM_HOST=localhost:8443 lachlanevenson/k8s-helm:v2.8.1 init 9 | 10 | # Create serviceaccounts and add the permissions to it. Then make the deployment use it 11 | oc create serviceaccount helm -n kube-system 12 | oc patch deployment/tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccountName":"helm"}}}}' -n kube-system 13 | oc adm policy add-cluster-role-to-user cluster-admin -z helm -n kube-system 14 | 15 | # Expose helm as nodePort 16 | oc expose deployment/tiller-deploy --target-port=tiller --type=NodePort --name=tiller -n kube-system 17 | 18 | # Output 19 | echo Add into your ~/.bashrc this lines: 20 | echo 21 | echo eval "$(minishift oc-env)" 22 | echo export HELM_HOST="$(minishift ip):$(oc get svc/tiller -o jsonpath='{.spec.ports[0].nodePort}' -n kube-system --as=system:admin)" 23 | echo export MINISHIFT_ADMIN_CONTEXT="default/$(oc config view -o jsonpath='{.contexts[?(@.name=="minishift")].context.cluster}')/system:admin" 24 | echo 25 | echo Initialize the helm client, if not done already 26 | echo 27 | echo e.g. 28 | echo helm init -c 29 | echo 30 | echo Search for an application: 31 | echo 32 | echo e.g. 33 | echo helm search 34 | echo 35 | echo And now deploy an application 36 | echo 37 | echo e.g. 38 | echo helm version 39 | echo 40 | echo To delete helm tiller 41 | echo oc delete sa/helm deployment/tiller-deploy svc/tiller -n kube-system --as=system:admin 42 | -------------------------------------------------------------------------------- /add-ons/helm/version: -------------------------------------------------------------------------------- 1 | 2.8.1 2 | -------------------------------------------------------------------------------- /add-ons/htpasswd-identity-provider/README.adoc: -------------------------------------------------------------------------------- 1 | :linkattrs: 2 | 3 | = htpasswd-identity-provider 4 | 5 | This add-on configures OpenShift to use HTPasswordIdentityProvider. For more info on the Identity Providers refer to https://docs.okd.io/3.9/install_config/configuring_authentication.html 6 | 7 | == Add-on Variables 8 | 9 | The following list of variables can be used while configuring the add-on: 10 | 11 | [%header,cols=3] 12 | |=== 13 | |Variable Name 14 | |Description 15 | |Default value 16 | 17 | |MINISHIFT_DATA_HOME 18 | |The minishift data directory within the vm instance 19 | |/var/lib/minishift 20 | 21 | |CONFIG_LOCATION 22 | |The openshift master configuration folder 23 | |openshift.local.config/master 24 | 25 | |MASTER_CONFIG_FILE 26 | |The openshift master configuration file name 27 | |master-config.yaml 28 | 29 | |USERNAME 30 | |The username that will be added to users.htpasswd file 31 | |developer 32 | 33 | |USER_PASSWORD^*^ 34 | |This **mandatory** variable sets password to the user specified via **USERNAME**. If the **USERNAME** variable is not specified this sets the password for the default username **developer** 35 | | 36 | |=== 37 | 38 | NOTE: Variables marked with * are required while applying the addon, please check the <> section for an example 39 | 40 | == Installing add-on 41 | 42 | Run the following command to install `htpasswd-identity-provider` add-on: 43 | 44 | [code,sh] 45 | ---- 46 | $ git clone https://github.com/minishift/minishift-addons 47 | $ minishift addon install ./minishift-addons/add-ons/htpasswd-identity-provider 48 | ---- 49 | 50 | [[apply-addon]] 51 | == Applying add-on 52 | 53 | To apply the addon run the following command, 54 | [code,sh] 55 | ---- 56 | $ minishift addon apply htpasswd-identity-provider --addon-env USER_PASSWORD=superS3cret 57 | ---- 58 | 59 | == Undeploy add-on 60 | 61 | Removing the `htpasswd-identity-provider` add-on will be reverting the authentication policy to what minishift configures by default: 62 | 63 | Run the following command to remove the `htpasswd-identity-provider` add-on: 64 | 65 | [code,sh] 66 | ---- 67 | $ minishift addon remove htpasswd-identity-provider 68 | ---- 69 | 70 | == Uninstall htpasswd-identity-provider add-on 71 | 72 | Run the following command to delete and remove the `htpasswd-identity-provider` add-on artifacts from the machine: 73 | 74 | [code,sh] 75 | ---- 76 | $ minishift addon uninstall htpasswd-identity-provider 77 | ---- 78 | 79 | == Check and Verify Configuration 80 | 81 | The tool https://github.com/mikefarah/yq/[yq] allows performing YAML operations via the command line, run the following command to check the configuration that was applied via this add-on: 82 | [code,sh] 83 | ---- 84 | $ minishift openshift config view | yq r - oauthConfig 85 | ---- 86 | -------------------------------------------------------------------------------- /add-ons/htpasswd-identity-provider/htpasswd-identity-provider.addon: -------------------------------------------------------------------------------- 1 | # Name: htpasswd-identity-provider 2 | # Description: Configures minishift to use HTPasswdIdentityProvider 3 | # Url: https://docs.okd.io/3.9/install_config/configuring_authentication.html#HTPasswdPasswordIdentityProvider 4 | # Var-Defaults: USERNAME=developer,MINISHIFT_DATA_HOME=/var/lib/minishift,CONFIG_LOCATION=openshift.local.config/master,MASTER_CONFIG_FILE=master-config.yaml,ORIGIN_DATA_HOME=/var/lib/origin 5 | # Required-Vars: USER_PASSWORD,USERNAME,CONFIG_LOCATION 6 | 7 | # Install htpasswd on the origin container 8 | docker exec -t origin /usr/bin/bash -c "which htpasswd || yum install -y httpd-tools" 9 | 10 | # backup the existing master-config.yaml 11 | ssh sudo cp -fp #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/#{MASTER_CONFIG_FILE} #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-htpasswd.yaml 12 | 13 | # create users.htpasswd file 14 | ssh sudo touch #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/users.htpasswd 15 | 16 | # add the default developer user to file 17 | docker exec -t origin /usr/bin/bash -c "htpasswd -b #{ORIGIN_DATA_HOME}/#{CONFIG_LOCATION}/users.htpasswd #{USERNAME} #{USER_PASSWORD}" 18 | 19 | # Patch the master configuration to use HTPasswdPasswordIdentityProvider 20 | ssh sudo grep "HTPasswdPasswordIdentityProvider" #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/#{MASTER_CONFIG_FILE} > /dev/null || sudo #{MINISHIFT_DATA_HOME}/bin/oc ex config patch #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-htpasswd.yaml --patch='{"oauthConfig": {"identityProviders": [ {"challenge": true,"login": true,"mappingMethod": "add","name": "htpasswd","provider": {"apiVersion": "v1","kind": "HTPasswdPasswordIdentityProvider","file": "users.htpasswd"}}]}}' > #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/#{MASTER_CONFIG_FILE} 21 | 22 | # restart openshift 23 | 24 | docker stop origin 25 | docker start origin 26 | 27 | # remove the prepatch file 28 | ssh sudo rm -f #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-htpasswd.yaml 29 | 30 | echo 'Successfully installed addon htpasswd identity provider' 31 | -------------------------------------------------------------------------------- /add-ons/htpasswd-identity-provider/htpasswd-identity-provider.addon.remove: -------------------------------------------------------------------------------- 1 | # Name: htpasswd-identity-provider 2 | # Description: Reverts to default minishift authentication configuration 3 | # Url: https://docs.okd.io/3.9/install_config/configuring_authentication.html#AllowAllPasswordIdentityProvider 4 | # Var-Defaults: MINISHIFT_DATA_HOME=/var/lib/minishift,CONFIG_LOCATION=openshift.local.config/master,MASTER_CONFIG_FILE=master-config.yaml 5 | # Required-Vars: CONFIG_LOCATION 6 | 7 | # backup existing configuration 8 | ssh sudo cp -fp #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/#{MASTER_CONFIG_FILE} #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-prepatch.yaml 9 | # revert to AllowAllPasswordIdentityProvider 10 | ssh sudo #{MINISHIFT_DATA_HOME}/bin/oc ex config patch #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-prepatch.yaml --patch='{"oauthConfig": {"identityProviders": [ {"challenge": true,"login": true,"mappingMethod": "claim","name": "anypassword","provider": {"apiVersion": "v1","kind": "AllowAllPasswordIdentityProvider"}}]}}' > #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config.yaml 11 | # remove the prepatch file 12 | ssh sudo rm -f #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/master-config-prepatch.yaml 13 | # remove users.htpasswd file 14 | ssh sudo rm -f #{MINISHIFT_DATA_HOME}/#{CONFIG_LOCATION}/users.htpasswd 15 | 16 | # restart openshift 17 | docker stop origin 18 | docker start origin 19 | 20 | echo 'Successfully removed addon htpasswd-identity-provider' -------------------------------------------------------------------------------- /add-ons/istio/README.adoc: -------------------------------------------------------------------------------- 1 | :linkattrs: 2 | :experimental: 3 | 4 | = Istio Add-on 5 | 6 | This add-on deploys the https://Istio.io/[Istio] **servicemesh** on to Minishift-provisioned OpenShift cluster. The Istio is provisioned using https://github.com/Maistra/openshift-ansible/blob/maistra-0.2.0/istio/Installation.md[Istio Operator]. 7 | 8 | [NOTE] 9 | ==== 10 | - The add-on was tested with Maistra (v0.2.0) 11 | - The add-on uses Istio Operator v0.2.0 12 | - This add-on depends on admin-user and anyuid Minishift addons 13 | ==== 14 | 15 | == Minishift profile setup 16 | 17 | As this Istio setup deploys applications like *istio-galley*,*istio-ingress*, *istio-egress*, *istio-pilot*,*elasticsearch*,*jaeger**,*kiali*, *grafana*, *prometheus* with their related resources 18 | such as https://kubernetes.io/docs/tasks/configure-pod-container/configmap/[configmaps], https://kubernetes.io/docs/concepts/configuration/secret/[secrets] 19 | and https://kubernetes.io/docs/concepts/api-extension/custom-resources/[Custom Resource Definitions], it is ideal to setup a Minishift profile with the following configuration: 20 | 21 | [sources,bash] 22 | ---- 23 | $ minishift profile set servicemesh <1> 24 | $ minishift config set memory 8GB <2> 25 | $ minishift config set cpus 4 <3> 26 | $ minishift config set image-caching true <4> 27 | $ minishift config set openshift-version v3.10.0 <5> 28 | $ minishift addon enable admin-user <6> 29 | $ minishift addon enable anyuid <7> 30 | $ minishift start <8> 31 | ---- 32 | 33 | <1> Create a new Minishift profile named **servicemesh** 34 | <2> Use 8GB of memory for Istio and apps that you might deploy later 35 | <3> 4 CPUs results in a maximum of 30 pods, since Istio deploys approximately 9 pods at minimum 36 | <4> Caches the downloaded container images for future use 37 | <5> Pinning OpenShift version to v3.10.0, so that upgrade of minishift does not recreate the OpenShift cluster 38 | <6> Creates a new user called **admin** with **cluster-admin** role 39 | <7> Allows containers within OpenShift to be run with any user id 40 | <8> Since we have set the profile to be **servicemesh**, this command starts Minishift with profile **servicemesh** 41 | 42 | == Install add-on 43 | 44 | Run the following command to install `istio` add-on: 45 | 46 | [source,bash] 47 | ---- 48 | $ git clone https://github.com/minishift/minishift-addons 49 | $ minishift addon install ./minishift-addons/add-ons/istio 50 | ---- 51 | 52 | == Deploy Istio 53 | 54 | Run the following command to apply `istio` add-on: 55 | 56 | [source,bash] 57 | ---- 58 | $ minishift addon enable istio <1> 59 | $ minishift addon apply istio <2> 60 | ---- 61 | <1> Enabling the **istio** addon allows the addon to be automatically applied during profile recreation i.e. minishift delete && minishift start 62 | <2> The command will take few minutes, you can watch the status with command `oc -n istio-system get pods -w --as system:admin`, you can terminate watch with kbd:[CTRL + C] 63 | 64 | == Undeploy Istio 65 | 66 | Removing the `istio` add-on will undeploy Istio from the Minishift-provisioned OpenShift cluster. 67 | 68 | Run the following command to remove the `istio` add-on: 69 | 70 | [source,bash] 71 | ---- 72 | $ minishift addon remove istio 73 | ---- 74 | 75 | == Uninstall Istio add-on 76 | 77 | Run the following command to delete and remove the `istio` add-on artifacts from the machine: 78 | 79 | [soource,bash] 80 | ---- 81 | $ minishift addon uninstall istio 82 | ---- 83 | -------------------------------------------------------------------------------- /add-ons/istio/installation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "istio.openshift.com/v1alpha1" 2 | kind: "Installation" 3 | metadata: 4 | name: "istio-installation" 5 | spec: 6 | istio: 7 | authentication: true 8 | community: true 9 | version: 0.2.0 10 | jaeger: 11 | version: 1.6.0 12 | elasticsearch_memory: 1Gi 13 | kiali: 14 | username: admin 15 | password: admin 16 | prefix: kiali/ 17 | version: v0.7.1 18 | -------------------------------------------------------------------------------- /add-ons/istio/istio.addon: -------------------------------------------------------------------------------- 1 | # Name: istio 2 | # Description: Deploys Latest Istio 3 | # Url: https://github.com/istio/istio 4 | # OpenShift-Version: >=3.10.0 5 | # Depends-On: anyuid, admin-user 6 | # From istio doc 7 | 8 | echo Prepare for install istio 9 | 10 | ssh sudo sysctl vm.max_map_count=262144 11 | ssh sudo sysctl -p 12 | ssh echo 'vm.max_map_count = 262144' | sudo tee /etc/sysctl.d/99-elasticsearch.conf > /dev/null 13 | 14 | echo Installing istio-operator 15 | 16 | !oc new-project istio-operator 17 | !oc new-app -f istio_community_operator_template.yaml -l 'minishift-addon=istio' --param=OPENSHIFT_ISTIO_MASTER_PUBLIC_URL=https://#{ip}:8443/ 18 | 19 | sleep 10 20 | 21 | echo Installing Istio 22 | 23 | oc apply -f installation.yaml 24 | 25 | oc project myproject 26 | 27 | # To Prepare the project for Istio Application deployment, run the following commands: 28 | echo 'minishift addons enable admin-user' 29 | echo 'minishift addons apply admin-user' 30 | echo 'minishift addons enable anyuid' 31 | echo 'minishift addons apply anyuid' 32 | echo 'oc adm policy add-scc-to-user anyuid -z default -n myproject' 33 | echo 'oc adm policy add-scc-to-user privileged -z default -n myproject' 34 | 35 | echo Please wait for few seconds before all pods are up! 36 | echo Watch the pods status via minishift console or oc get pods -w -n istio-system --as system:admin 37 | -------------------------------------------------------------------------------- /add-ons/istio/istio.addon.remove: -------------------------------------------------------------------------------- 1 | # Name: istio 2 | # Description: UnDeploys Istio 3 | # Url: https://github.com/istio/istio 4 | 5 | oc project istio-operator 6 | oc delete -n istio-operator installation istio-installation 7 | 8 | sleep 30 9 | 10 | oc delete all -l minishift-addon=istio 11 | oc delete project istio-operator 12 | oc delete project istio-system 13 | 14 | oc project myproject 15 | 16 | echo Istio add-on successfully removed 17 | -------------------------------------------------------------------------------- /add-ons/istio/istio_community_operator_template.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Template 3 | metadata: 4 | name: istio-removal-job 5 | parameters: 6 | - displayName: Master Public URL 7 | description: The public URL for master 8 | name: OPENSHIFT_ISTIO_MASTER_PUBLIC_URL 9 | value: https://127.0.0.1:8443 10 | - displayName: OpenShift Release 11 | description: The version of the OpenShift release. 12 | name: OPENSHIFT_RELEASE 13 | value: v3.10.0 14 | required: true 15 | - displayName: Istio Operator Namespace 16 | description: The namespace for the Istio operator 17 | name: OPENSHIFT_ISTIO_OPERATOR_NAMESPACE 18 | value: istio-operator 19 | required: true 20 | - displayName: Default Prefix 21 | description: The default image prefix for istio deployments 22 | name: OPENSHIFT_ISTIO_PREFIX 23 | value: maistra/ 24 | - displayName: Default Version 25 | description: The default image version for istio deployments 26 | name: OPENSHIFT_ISTIO_VERSION 27 | value: 0.2.0 28 | - displayName: Default Deployment Type 29 | description: The default deployment type for istio deployments 30 | name: OPENSHIFT_DEPLOYMENT_TYPE 31 | value: origin 32 | objects: 33 | - kind: CustomResourceDefinition 34 | apiVersion: apiextensions.k8s.io/v1beta1 35 | metadata: 36 | name: installations.istio.openshift.com 37 | spec: 38 | group: istio.openshift.com 39 | names: 40 | kind: Installation 41 | plural: installations 42 | singular: installation 43 | scope: Namespaced 44 | version: v1alpha1 45 | - kind: Role 46 | apiVersion: rbac.authorization.k8s.io/v1beta1 47 | metadata: 48 | name: istio-operator 49 | rules: 50 | - apiGroups: 51 | - istio.openshift.com 52 | resources: 53 | - "*" 54 | verbs: 55 | - "*" 56 | - apiGroups: 57 | - "" 58 | resources: 59 | - pods 60 | - services 61 | - endpoints 62 | - persistentvolumeclaims 63 | - events 64 | - configmaps 65 | - secrets 66 | - securitycontextconstraints 67 | verbs: 68 | - "*" 69 | - apiGroups: 70 | - apps 71 | resources: 72 | - deployments 73 | - daemonsets 74 | - replicasets 75 | - statefulsets 76 | verbs: 77 | - "*" 78 | - kind: RoleBinding 79 | apiVersion: rbac.authorization.k8s.io/v1beta1 80 | metadata: 81 | name: default-account-istio-operator 82 | subjects: 83 | - kind: ServiceAccount 84 | namespace: ${OPENSHIFT_ISTIO_OPERATOR_NAMESPACE} 85 | name: default 86 | roleRef: 87 | kind: Role 88 | name: istio-operator 89 | apiGroup: rbac.authorization.k8s.io 90 | - kind: ClusterRoleBinding 91 | apiVersion: rbac.authorization.k8s.io/v1 92 | metadata: 93 | name: default-account-istio-operator-cluster-role-binding 94 | subjects: 95 | - kind: ServiceAccount 96 | namespace: ${OPENSHIFT_ISTIO_OPERATOR_NAMESPACE} 97 | name: default 98 | roleRef: 99 | kind: ClusterRole 100 | name: cluster-admin 101 | apiGroup: rbac.authorization.k8s.io 102 | - kind: Deployment 103 | apiVersion: apps/v1 104 | metadata: 105 | name: istio-operator 106 | namespace: ${OPENSHIFT_ISTIO_OPERATOR_NAMESPACE} 107 | spec: 108 | replicas: 1 109 | selector: 110 | matchLabels: 111 | name: istio-operator 112 | template: 113 | metadata: 114 | labels: 115 | name: istio-operator 116 | spec: 117 | containers: 118 | - name: istio-operator 119 | image: ${OPENSHIFT_ISTIO_PREFIX}istio-operator-centos7:${OPENSHIFT_ISTIO_VERSION} 120 | ports: 121 | - containerPort: 60000 122 | name: metrics 123 | command: 124 | - istio-operator 125 | args: 126 | - "--release=${OPENSHIFT_RELEASE}" 127 | - "--masterPublicURL=${OPENSHIFT_ISTIO_MASTER_PUBLIC_URL}" 128 | - "--istioPrefix=${OPENSHIFT_ISTIO_PREFIX}" 129 | - "--istioVersion=${OPENSHIFT_ISTIO_VERSION}" 130 | - "--deploymentType=${OPENSHIFT_DEPLOYMENT_TYPE}" 131 | imagePullPolicy: IfNotPresent 132 | env: 133 | - name: WATCH_NAMESPACE 134 | valueFrom: 135 | fieldRef: 136 | fieldPath: metadata.namespace 137 | - name: OPERATOR_NAME 138 | value: "istio-operator" -------------------------------------------------------------------------------- /add-ons/kube-dashboard/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes dashboard Add-on 2 | An addon to install [kubernetes-dashboard](https://github.com/kubernetes/dashboard) 3 | 4 | Verify you have installed these addons, by following the [general readme](../../README.adoc#download-and-use-community-add-ons). 5 | 6 | ## Deploy kube-dashboard 7 | To deploy kube-dashboard do 8 | 9 | ``` 10 | $ minishift addon apply kube-dashboard 11 | ``` 12 | 13 | ## Use kube-dashboard 14 | To access it: 15 | 16 | ``` 17 | $ minishift openshift service dashboard -n kube-dashboard 18 | ``` 19 | 20 | _NOTE_: Kube-dashboard is deployed with cluster-admin pivileges, so if you use this addon, anyone accesing kube-dashboard will be able to do anything on this cluster 21 | 22 | ## Delete kube-dashboard 23 | To delete kube-dashboard do: 24 | 25 | ``` 26 | $ oc delete project/kube-dashboard --as=system:admin 27 | ``` 28 | -------------------------------------------------------------------------------- /add-ons/kube-dashboard/kube-dashboard.addon: -------------------------------------------------------------------------------- 1 | # Name: kube-dashboard 2 | # Description: Deploys the kubernetes dashboard 3 | # Url: https://github.com/kubernetes/dashboard 4 | 5 | # oc adm policy add-scc-to-user anyuid system:serviceaccount:kube-dashboard:default 6 | oc adm new-project kube-dashboard 7 | oc create deploymentconfig dashboard --image=gcr.io/google_containers/kubernetes-dashboard-amd64:v1.8.3 -n kube-dashboard 8 | oc label dc/dashboard app=kube-dashboard -n kube-dashboard 9 | oc set probe dc/dashboard --readiness --liveness --open-tcp=9090 --initial-delay-seconds=5 --timeout-seconds=1 -n kube-dashboard 10 | oc expose dc/dashboard --port=9090 -l app=kube-dashboard -n kube-dashboard 11 | oc expose svc/dashboard --hostname=dashboard.#{routing-suffix} -l app=kube-dashboard -n kube-dashboard 12 | oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:kube-dashboard:default 13 | oc deploy dashboard -n kube-dashboard 14 | oc rollout status dc/dashboard -n kube-dashboard 15 | 16 | echo You have installed #{addon-name} 17 | echo To access the #{addon-name} go to http://dashboard.#{routing-suffix} 18 | echo or 19 | echo Use minishift: 20 | echo minishift openshift service dashboard -n kube-dashboard 21 | echo 22 | echo To delete: 23 | echo oc delete project/kube-dashboard --as=system:admin 24 | -------------------------------------------------------------------------------- /add-ons/management-infra/README.md: -------------------------------------------------------------------------------- 1 | # management-infra Add-on 2 | An addon to create objects to support ManageIQ or CloudForms 3 | 4 | NOTE: Requires OCP >= 3.6.0 5 | 6 | ## Deploy management-infra 7 | To deploy management-infra do: 8 | 9 | ``` 10 | minishift addon apply management-infra 11 | ``` 12 | 13 | ## Delete management-infra 14 | Delete management-infra with: 15 | 16 | ``` 17 | oc delete project/management-infra clusterrole/management-infra-admin clusterrole/hawkular-metrics-admin --as=system:admin 18 | ``` 19 | -------------------------------------------------------------------------------- /add-ons/management-infra/hawkular-metrics-admin.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ClusterRole 3 | metadata: 4 | name: hawkular-metrics-admin 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - hawkular-alerts 10 | - hawkular-metrics 11 | verbs: 12 | - "*" 13 | 14 | -------------------------------------------------------------------------------- /add-ons/management-infra/management-infra-admin.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ClusterRole 3 | metadata: 4 | name: management-infra-admin 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - pods/log 10 | verbs: 11 | - "get" 12 | - apiGroups: 13 | - "" 14 | resources: 15 | - pods/proxy 16 | verbs: 17 | - "*" 18 | 19 | -------------------------------------------------------------------------------- /add-ons/management-infra/management-infra.addon: -------------------------------------------------------------------------------- 1 | # Name: management-infra 2 | # Description: Creates management objects for ManageIQ, Cloudforms, etc 3 | 4 | echo Creating management-infra project 5 | oc new-project management-infra --description="Management Infrastructure" --as=system:admin 6 | 7 | echo Creating Service Accounts: management-admin, inspector-admin 8 | oc create sa management-admin -n management-infra --as=system:admin 9 | oc create sa inspector-admin -n management-infra --as=system:admin 10 | 11 | echo Creating Cluster Roles: management-infra-admin, hawkular-metrics-admin 12 | # From 3.7 on, it can be done with oc create clusterrole. see https://bugzilla.redhat.com/show_bug.cgi?id=1476166 13 | oc create -f management-infra-admin.yaml 14 | oc create -f hawkular-metrics-admin.yaml 15 | 16 | echo Adding policies to users 17 | oc adm policy add-role-to-user admin management-admin -n management-infra --as=system:admin 18 | 19 | oc adm policy add-cluster-role-to-user management-infra-admin system:serviceaccount:management-infra:management-admin --as=system:admin 20 | oc adm policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin --as=system:admin 21 | oc adm policy add-scc-to-user privileged system:serviceaccount:management-infra:management-admin --as=system:admin 22 | oc adm policy add-cluster-role-to-user self-provisioner system:serviceaccount:management-infra:management-admin --as=system:admin 23 | oc adm policy add-cluster-role-to-user hawkular-metrics-admin system:serviceaccount:management-infra:management-admin --as=system:admin 24 | 25 | oc adm policy add-cluster-role-to-user system:image-puller system:serviceaccount:management-infra:inspector-admin --as=system:admin 26 | oc adm policy add-scc-to-user privileged system:serviceaccount:management-infra:inspector-admin --as=system:admin 27 | 28 | oc adm policy add-cluster-role-to-user system:image-auditor system:serviceaccount:management-infra:management-admin --as=system:admin 29 | 30 | echo Management infra resources provided. You can now enable ManageIQ or RedHat CloudForms plugins 31 | 32 | echo NOTE: To delete this addon, execute: 33 | echo oc delete project/management-infra clusterrole/management-infra-admin clusterrole/hawkular-metrics-admin --as=system:admin 34 | -------------------------------------------------------------------------------- /add-ons/openwhisk/README.md: -------------------------------------------------------------------------------- 1 | # OpenWhisk Add-on 2 | 3 | This is an add-on to install OpenWhisk FaaS 4 | 5 | Verify you have installed these addons, by following the general [readme](https://github.com/minishift/minishift-addons/blob/master/README.adoc#download-and-use-community-add-ons). 6 | 7 | As explained in the readme, clone the repository to get addons to your workstation. 8 | 9 | ## Prerequisites 10 | 11 | Set up minishift with the following configuration and start 12 | 13 | ``` 14 | minishift profile set openwhisk-test 15 | minishift config set memory 8GB 16 | minishift config set cpus 3 17 | minishift addon enable admin-user 18 | minishift addon enable anyuid 19 | minishift start 20 | ``` 21 | 22 | Once minishift starts up run the following command to turn on promiscous mode in the minishift VM. 23 | 24 | ``` 25 | minishift ssh -- sudo ip link set docker0 promisc on 26 | ``` 27 | 28 | Also patch the admin config policy. 29 | 30 | ``` 31 | minishift openshift config set --patch \ 32 | '{"admissionConfig": 33 | {"pluginConfig": 34 | {"openshift.io/ImagePolicy": 35 | {"configuration": 36 | {"apiVersion": "v1", 37 | "kind": "ImagePolicyConfig", 38 | "resolveImages": "AttemptRewrite"}}}}}' 39 | ``` 40 | 41 | 42 | ## Install Add-on 43 | 44 | Run the following command after you start minishift 45 | 46 | ``` 47 | $ minishift addon install 48 | ``` 49 | 50 | ## Deploy Add-on 51 | 52 | To deploy OpenWhisk 53 | 54 | ``` 55 | $ minishift addons apply openwhisk 56 | ``` 57 | 58 | This creates a project with name `openwhisk` and spins up all OpenWhisk components in that project. 59 | 60 | **NOTE:** It takes a long time to pull all these images and for the pods to come up. Be patient. 61 | 62 | Post deployment you can download and use [OpenWhisk CLI](https://github.com/apache/incubator-openwhisk-cli/releases/) and use `wsk` command line. 63 | 64 | Also you will need to configure auth secret to invoke `wsk` commands by running the following: 65 | 66 | ``` 67 | wsk property set --auth $(oc get secret whisk.auth -o yaml | grep "system:" | awk '{print $2}' | base64 --decode) --apihost $(oc get route/openwhisk --template="{{.spec.host}}") 68 | ``` 69 | 70 | ## Remove Add-on 71 | 72 | To remove add-on simply run 73 | 74 | ``` 75 | $ minishift addons remove openwhisk 76 | ``` 77 | 78 | ## Uninstall Add-on 79 | To uninstall add-on run 80 | 81 | ``` 82 | $ minishift addons uninstall openwhisk 83 | ``` 84 | 85 | 86 | -------------------------------------------------------------------------------- /add-ons/openwhisk/openwhisk.addon: -------------------------------------------------------------------------------- 1 | ################################################################################################### 2 | # Name: openwhisk 3 | # Description: Installs OpenWhisk FaaS 4 | # Required-Vars: OPENSHIFT_USERNAME 5 | # OpenShift-Version: >=3.9.0 6 | # Var-Defaults: OPENSHIFT_USERNAME=developer,CONSOLE_URL=https://#{ip}:8443,PROJECT_NAME=openwhisk 7 | # Url: Template from https://git.io/openwhisk-template 8 | ################################################################################################### 9 | 10 | # login 11 | oc login -u admin -p admin 12 | 13 | # create project 14 | oc new-project #{PROJECT_NAME} 15 | 16 | # Create OpenWhisk template 17 | oc create -n #{PROJECT_NAME} -f https://git.io/openwhisk-template 18 | 19 | # Install OpenWhisk 20 | oc new-app openwhisk-ephemeral -n #{PROJECT_NAME} 21 | 22 | # Assign OPENSHIFT_USERNAME as he administrator for the openwhisk project 23 | oc adm policy add-role-to-user admin #{OPENSHIFT_USERNAME} -n #{PROJECT_NAME} 24 | 25 | 26 | echo Please be patient it take several minutes for OpenWhisk pods to come up 27 | echo To configure auth secret for wsk, run the following: 28 | echo wsk property set --auth $(oc get secret whisk.auth -o yaml | grep "system:" | awk '{print $2}' | base64 --decode) --apihost $(oc get route/openwhisk --template="{{.spec.host}}") 29 | -------------------------------------------------------------------------------- /add-ons/openwhisk/openwhisk.addon.remove: -------------------------------------------------------------------------------- 1 | ################################################################################################### 2 | # Name: openwhisk 3 | # Description: removes openwhisk 4 | # Var-Defaults: OPENSHIFT_USERNAME=developer,CONSOLE_URL=https://#{ip}:8443,PROJECT_NAME=openwhisk 5 | # OpenShift-Version: >=3.9.0 6 | ################################################################################################### 7 | 8 | oc delete project #{PROJECT_NAME} 9 | -------------------------------------------------------------------------------- /add-ons/prometheus/README.md: -------------------------------------------------------------------------------- 1 | # Prometheus Add-on 2 | An add-on that will deploy [Prometheus](https://prometheus.io/) on the OpenShift cluster provided by [Minishift](https://github.com/minishift/minishift). 3 | 4 | ## Prerequisites 5 | 6 | - Origin version >= 3.6.0 7 | - A _cluster-admin_ user which is required to access Prometheus web UI. 8 | 9 | _NOTE_: [`admin-user`](https://github.com/minishift/minishift/tree/master/addons/admin-user) add-on provides a way to create _admin_ user with _cluster-admin_ role 10 | 11 | Verify that you have installed the add-on by following [general readme](../../README.adoc#download-use-community-addons). 12 | 13 | ## Deploy Prometheus 14 | To deploy Prometheus do: 15 | 16 | ``` 17 | minishift addon apply prometheus --addon-env namespace=kube-system 18 | ``` 19 | 20 | ## Use Prometheus 21 | 22 | - Prometheus will be available at: 23 | 24 | ``` 25 | $ minishift openshift service prometheus -n kube-system 26 | ``` 27 | 28 | _NOTE_: There service is exposed though SSL, so use _https_ to access it. 29 | 30 | - Login with cluster-admin user in OpenShift console during `Sign in with a Account` action. 31 | 32 | 33 | ## Delete Prometheus 34 | Delete Prometheus with: 35 | 36 | ``` 37 | oc delete sa,clusterrolebinding,route,svc,secret,deployment,configmap -l app=prometheus -n --as=system:admin 38 | ``` 39 | -------------------------------------------------------------------------------- /add-ons/prometheus/prometheus.addon: -------------------------------------------------------------------------------- 1 | # Name: prometheus 2 | # Description: This template creates a Prometheus instance preconfigured to gather OpenShift and Kubernetes platform and node metrics and report them to admins. It is protected by an OAuth proxy that only allows access for users who have view access to the prometheus namespace. You may customize where the images (built from openshift/prometheus and openshift/oauth-proxy) are pulled from via template parameters. 3 | # Url: https://raw.githubusercontent.com/openshift/origin/master/examples/prometheus/prometheus.yaml 4 | # Required-Vars: namespace 5 | 6 | # TODO: Once conditional commands are there, create the namespace if it does not exist 7 | # oc adm new-project prometheus 8 | oc new-app -f prometheus.yaml -p NAMESPACE=#{namespace} -n #{namespace} 9 | # 10 | # Add labels to things for easy removal 11 | oc label svc/prometheus app=prometheus -n #{namespace} 12 | oc label configmap/prometheus app=prometheus -n #{namespace} 13 | oc label secret/prometheus-proxy app=prometheus -n #{namespace} 14 | oc label secret/prometheus-tls app=prometheus -n #{namespace} 15 | oc label sa/prometheus app=prometheus -n #{namespace} 16 | oc label clusterrolebinding/prometheus-cluster-reader app=prometheus 17 | # Look maybe into modifying the route here 18 | # oc expose svc/prometheus --name=prometheus-2 --hostname=prometheus.#{routing-suffix} --tls=reencrypt --port=prometheus -l app=prometheus -n #{namespace} 19 | 20 | echo You have installed #{addon-name} 21 | echo To access #{addon-name} go to https://prometheus-#{namespace}.#{routing-suffix} 22 | echo 23 | echo To delete: 24 | echo oc delete sa,clusterrolebinding,route,svc,secret,deployment,configmap -l app=prometheus -n #{namespace} --as=system:admin 25 | -------------------------------------------------------------------------------- /add-ons/prometheus/prometheus.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: template.openshift.io/v1 2 | kind: Template 3 | metadata: 4 | name: prometheus 5 | annotations: 6 | "openshift.io/display-name": Prometheus 7 | description: | 8 | A monitoring solution for an OpenShift cluster - collect and gather metrics from nodes, services, and the infrastructure. This is a tech preview feature. 9 | iconClass: icon-cogs 10 | tags: "monitoring,prometheus,time-series" 11 | parameters: 12 | - description: The namespace to instantiate prometheus under. Defaults to 'kube-system'. 13 | name: NAMESPACE 14 | value: kube-system 15 | - description: The location of the proxy image 16 | name: IMAGE_PROXY 17 | value: openshift/oauth-proxy:v1.0.0 18 | - description: The location of the prometheus image 19 | name: IMAGE_PROMETHEUS 20 | value: openshift/prometheus:v2.0.0-dev 21 | - description: The session secret for the proxy 22 | name: SESSION_SECRET 23 | generate: expression 24 | from: "[a-zA-Z0-9]{43}" 25 | objects: 26 | # Authorize the prometheus service account to read data about the cluster 27 | - apiVersion: v1 28 | kind: ServiceAccount 29 | metadata: 30 | name: prometheus 31 | namespace: "${NAMESPACE}" 32 | annotations: 33 | serviceaccounts.openshift.io/oauth-redirectreference.primary: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"prometheus"}}' 34 | - apiVersion: authorization.openshift.io/v1 35 | kind: ClusterRoleBinding 36 | metadata: 37 | name: prometheus-cluster-reader 38 | roleRef: 39 | name: cluster-reader 40 | subjects: 41 | - kind: ServiceAccount 42 | name: prometheus 43 | namespace: "${NAMESPACE}" 44 | # Create a fully end-to-end TLS connection to the proxy 45 | - apiVersion: route.openshift.io/v1 46 | kind: Route 47 | metadata: 48 | name: prometheus 49 | namespace: "${NAMESPACE}" 50 | spec: 51 | to: 52 | name: prometheus 53 | tls: 54 | termination: Reencrypt 55 | - apiVersion: v1 56 | kind: Service 57 | metadata: 58 | annotations: 59 | prometheus.io/scrape: "true" 60 | prometheus.io/scheme: https 61 | service.alpha.openshift.io/serving-cert-secret-name: prometheus-tls 62 | labels: 63 | name: prometheus 64 | name: prometheus 65 | namespace: "${NAMESPACE}" 66 | spec: 67 | ports: 68 | - name: prometheus 69 | port: 443 70 | protocol: TCP 71 | targetPort: 8443 72 | selector: 73 | app: prometheus 74 | - apiVersion: v1 75 | kind: Secret 76 | metadata: 77 | name: prometheus-proxy 78 | namespace: "${NAMESPACE}" 79 | stringData: 80 | session_secret: "${SESSION_SECRET}=" 81 | # Deploy Prometheus behind an oauth proxy 82 | - apiVersion: extensions/v1beta1 83 | kind: Deployment 84 | metadata: 85 | labels: 86 | app: prometheus 87 | name: prometheus 88 | namespace: "${NAMESPACE}" 89 | spec: 90 | replicas: 1 91 | selector: 92 | matchLabels: 93 | app: prometheus 94 | template: 95 | metadata: 96 | labels: 97 | app: prometheus 98 | name: prometheus 99 | spec: 100 | serviceAccountName: prometheus 101 | containers: 102 | - name: oauth-proxy 103 | image: ${IMAGE_PROXY} 104 | imagePullPolicy: IfNotPresent 105 | ports: 106 | - containerPort: 8443 107 | name: web 108 | args: 109 | - -provider=openshift 110 | - -https-address=:8443 111 | - -email-domain=* 112 | - -upstream=http://localhost:9090 113 | - -client-id=system:serviceaccount:${NAMESPACE}:prometheus 114 | - '-openshift-sar={"namespace": "${NAMESPACE}", "verb": "list", "resource": "services"}' 115 | - -tls-cert=/etc/tls/private/tls.crt 116 | - -tls-key=/etc/tls/private/tls.key 117 | - -client-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token 118 | - -cookie-secret-file=/etc/proxy/secrets/session_secret 119 | - -skip-auth-regex=^/metrics 120 | volumeMounts: 121 | - mountPath: /etc/tls/private 122 | name: prometheus-tls 123 | - mountPath: /etc/proxy/secrets 124 | name: secrets 125 | 126 | - name: prometheus 127 | args: 128 | - --storage.tsdb.retention=6h 129 | - --config.file=/etc/prometheus/prometheus.yml 130 | - --web.listen-address=localhost:9090 131 | image: ${IMAGE_PROMETHEUS} 132 | imagePullPolicy: IfNotPresent 133 | volumeMounts: 134 | - mountPath: /etc/prometheus 135 | name: config-volume 136 | - mountPath: /prometheus 137 | name: data-volume 138 | 139 | restartPolicy: Always 140 | volumes: 141 | - configMap: 142 | defaultMode: 420 143 | name: prometheus 144 | name: config-volume 145 | - name: secrets 146 | secret: 147 | secretName: prometheus-proxy 148 | - name: prometheus-tls 149 | secret: 150 | secretName: prometheus-tls 151 | - emptyDir: {} 152 | name: data-volume 153 | - apiVersion: v1 154 | kind: ConfigMap 155 | metadata: 156 | name: prometheus 157 | namespace: "${NAMESPACE}" 158 | data: 159 | prometheus.yml: | 160 | # A scrape configuration for running Prometheus on a Kubernetes cluster. 161 | # This uses separate scrape configs for cluster components (i.e. API server, node) 162 | # and services to allow each to use different authentication configs. 163 | # 164 | # Kubernetes labels will be added as Prometheus labels on metrics via the 165 | # `labelmap` relabeling action. 166 | 167 | # Scrape config for API servers. 168 | # 169 | # Kubernetes exposes API servers as endpoints to the default/kubernetes 170 | # service so this uses `endpoints` role and uses relabelling to only keep 171 | # the endpoints associated with the default/kubernetes service using the 172 | # default named port `https`. This works for single API server deployments as 173 | # well as HA API server deployments. 174 | scrape_configs: 175 | - job_name: 'kubernetes-apiservers' 176 | 177 | kubernetes_sd_configs: 178 | - role: endpoints 179 | 180 | # Default to scraping over https. If required, just disable this or change to 181 | # `http`. 182 | scheme: https 183 | 184 | # This TLS & bearer token file config is used to connect to the actual scrape 185 | # endpoints for cluster components. This is separate to discovery auth 186 | # configuration because discovery & scraping are two separate concerns in 187 | # Prometheus. The discovery auth config is automatic if Prometheus runs inside 188 | # the cluster. Otherwise, more config options have to be provided within the 189 | # . 190 | tls_config: 191 | ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt 192 | # If your node certificates are self-signed or use a different CA to the 193 | # master CA, then disable certificate verification below. Note that 194 | # certificate verification is an integral part of a secure infrastructure 195 | # so this should only be disabled in a controlled environment. You can 196 | # disable certificate verification by uncommenting the line below. 197 | # 198 | # insecure_skip_verify: true 199 | bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token 200 | 201 | # Keep only the default/kubernetes service endpoints for the https port. This 202 | # will add targets for each API server which Kubernetes adds an endpoint to 203 | # the default/kubernetes service. 204 | relabel_configs: 205 | - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] 206 | action: keep 207 | regex: default;kubernetes;https 208 | 209 | - job_name: 'kubernetes-nodes' 210 | 211 | # Default to scraping over https. If required, just disable this or change to 212 | # `http`. 213 | scheme: https 214 | 215 | # This TLS & bearer token file config is used to connect to the actual scrape 216 | # endpoints for cluster components. This is separate to discovery auth 217 | # configuration because discovery & scraping are two separate concerns in 218 | # Prometheus. The discovery auth config is automatic if Prometheus runs inside 219 | # the cluster. Otherwise, more config options have to be provided within the 220 | # . 221 | tls_config: 222 | ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt 223 | # If your node certificates are self-signed or use a different CA to the 224 | # master CA, then disable certificate verification below. Note that 225 | # certificate verification is an integral part of a secure infrastructure 226 | # so this should only be disabled in a controlled environment. You can 227 | # disable certificate verification by uncommenting the line below. 228 | # 229 | # insecure_skip_verify: true 230 | bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token 231 | 232 | kubernetes_sd_configs: 233 | - role: node 234 | 235 | relabel_configs: 236 | - action: labelmap 237 | regex: __meta_kubernetes_node_label_(.+) 238 | 239 | # Scrape config for service endpoints. 240 | # 241 | # The relabeling allows the actual service scrape endpoint to be configured 242 | # via the following annotations: 243 | # 244 | # * `prometheus.io/scrape`: Only scrape services that have a value of `true` 245 | # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need 246 | # to set this to `https` & most likely set the `tls_config` of the scrape config. 247 | # * `prometheus.io/path`: If the metrics path is not `/metrics` override this. 248 | # * `prometheus.io/port`: If the metrics are exposed on a different port to the 249 | # service then set this appropriately. 250 | - job_name: 'kubernetes-service-endpoints' 251 | 252 | tls_config: 253 | ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt 254 | # TODO: this should be per target 255 | insecure_skip_verify: true 256 | 257 | kubernetes_sd_configs: 258 | - role: endpoints 259 | 260 | relabel_configs: 261 | - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] 262 | action: keep 263 | regex: true 264 | - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] 265 | action: replace 266 | target_label: __scheme__ 267 | regex: (https?) 268 | - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path] 269 | action: replace 270 | target_label: __metrics_path__ 271 | regex: (.+) 272 | - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port] 273 | action: replace 274 | target_label: __address__ 275 | regex: (.+)(?::\d+);(\d+) 276 | replacement: $1:$2 277 | - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_username] 278 | action: replace 279 | target_label: __basic_auth_username__ 280 | regex: (.+) 281 | - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_password] 282 | action: replace 283 | target_label: __basic_auth_password__ 284 | regex: (.+) 285 | - action: labelmap 286 | regex: __meta_kubernetes_service_label_(.+) 287 | - source_labels: [__meta_kubernetes_namespace] 288 | action: replace 289 | target_label: kubernetes_namespace 290 | - source_labels: [__meta_kubernetes_service_name] 291 | action: replace 292 | target_label: kubernetes_name 293 | -------------------------------------------------------------------------------- /add-ons/workshop/README.md: -------------------------------------------------------------------------------- 1 | # OpenShift Workshop Add-on 2 | An addon to install an [OpenShift Workshop](https://github.com/osevg/workshop-content) 3 | 4 | Verify you have installed these addons, by following the [general readme](../../README.adoc#download-and-use-community-add-ons). 5 | 6 | ## Deploy workshop 7 | To deploy this workshop do: 8 | 9 | ``` 10 | $ minishift addon apply workshop 11 | ``` 12 | 13 | ## Use workshop 14 | To access it: 15 | 16 | ```` 17 | $ minishift openshift service workshop -n workshop 18 | ```` 19 | 20 | ## Delete workshop 21 | To delete the workshop do: 22 | 23 | ``` 24 | $ oc delete project/workshop --as=system:admin 25 | ``` 26 | -------------------------------------------------------------------------------- /add-ons/workshop/workshop.addon: -------------------------------------------------------------------------------- 1 | # Name: workshop 2 | # Description: Deploys a basic OpenShift Workshop 3 | # Url: https://github.com/osevg/workshopper-content 4 | 5 | echo Installing this addon will take some time as it will pull down 5 docker images 6 | 7 | docker pull docker.io/openshiftroadshow/parksmap:1.2.0 8 | docker pull docker.io/openshiftroadshow/parksmap-py:1.0.0 9 | docker pull centos/python-35-centos7:latest 10 | docker pull centos/mongodb-32-centos7:latest 11 | docker pull osevg/workshopper 12 | 13 | echo Images have already been pulled. Now let's intall the workshop 14 | 15 | oc adm new-project workshop 16 | oc new-app osevg/workshopper -e WORKSHOPS_URLS=https://raw.githubusercontent.com/osevg/workshopper-content/master/_workshops/training.yml -e CONSOLE_ADDRESS=#{ip}:8443 -e ROUTER_ADDRESS=#{routing-suffix} -e USER_NAME=developer -e USER_PASSWORD=developer -e EXPLORE_PROJECT_NAME=myproject -e USER_SUFFIX= --name workshop -n workshop 17 | # Cancel is required as I want to add a probe 18 | sleep 2 19 | oc rollout cancel dc/workshop -n workshop 20 | oc set probe dc/workshop --readiness --liveness --get-url=http://:8080/ --initial-delay-seconds=5 --timeout-seconds=1 -n workshop 21 | oc expose service workshop --hostname workshop.#{routing-suffix} -n workshop 22 | oc rollout status dc/workshop -n workshop 23 | 24 | echo You have installed #{addon-name} 25 | echo To access the #{addon-name} go to http://workshop.#{routing-suffix} 26 | echo or 27 | echo Use minishift: 28 | echo minishift openshift service workshop -n workshop 29 | echo 30 | echo To delete: 31 | echo oc delete project/workshop --as=system:admin 32 | -------------------------------------------------------------------------------- /centos_ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Output command before executing 4 | set -x 5 | 6 | # Exit on error 7 | set -e 8 | 9 | # Source environment variables of the jenkins slave 10 | # that might interest this worker. 11 | function load_jenkins_vars() { 12 | if [ -e "jenkins-env" ]; then 13 | cat jenkins-env \ 14 | | grep -E "(JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId|CICO_API_KEY|GITHUB_TOKEN|JOB_NAME|RH_REGISTRY_USERNAME|RH_REGISTRY_PASSWORD)=" \ 15 | | sed 's/^/export /g' \ 16 | > ~/.jenkins-env 17 | source ~/.jenkins-env 18 | fi 19 | 20 | echo 'CICO: Jenkins ENVs loaded' 21 | } 22 | 23 | function install_core_deps() { 24 | # Enable extra packages 25 | yum --enablerepo=extras install -y epel-release 26 | # Get all the deps in 27 | yum -y install gcc \ 28 | golang \ 29 | make \ 30 | tar \ 31 | zip \ 32 | git \ 33 | curl \ 34 | python-requests 35 | 36 | echo 'CICO: Core dependencies installed' 37 | } 38 | 39 | # Create a CI user which has NOPASSWD sudoer role 40 | function prepare_ci_user() { 41 | groupadd -g 1001 -r minishift_ci && useradd -g minishift_ci -u 1001 minishift_ci 42 | chmod +w /etc/sudoers && echo "minishift_ci ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && chmod -w /etc/sudoers 43 | 44 | # Copy centos_ci.sh to newly created user home dir 45 | cp centos_ci.sh /home/minishift_ci/ 46 | mkdir /home/minishift_ci/payload 47 | # Copy minishift-addon repo content into minishift_ci user payload directory for later use 48 | cp -R . /home/minishift_ci/payload 49 | chown -R minishift_ci:minishift_ci /home/minishift_ci/payload 50 | 51 | # Copy the jenkins-env into minishift_ci home dir 52 | cp ~/.jenkins-env /home/minishift_ci/jenkins-env 53 | } 54 | 55 | function install_kvm_virt() { 56 | sudo yum -y install kvm \ 57 | qemu-kvm \ 58 | libvirt 59 | # Start Libvirt 60 | sudo systemctl start libvirtd 61 | echo 'CICO: KVM hypervisor installed and started' 62 | 63 | # Add minishift_ci to libvirt group 64 | gpasswd -a minishift_ci libvirt && systemctl restart libvirtd 65 | } 66 | 67 | function setup_build_environment() { 68 | load_jenkins_vars; 69 | prepare_ci_user; 70 | install_core_deps; 71 | install_kvm_virt; 72 | runuser -l minishift_ci -c "/bin/bash centos_ci.sh" 73 | } 74 | 75 | #### Below functions are executed by minishift_ci user 76 | function setup_kvm_docker_machine_driver() { 77 | curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm > docker-machine-driver-kvm && \ 78 | chmod +x docker-machine-driver-kvm && sudo mv docker-machine-driver-kvm /usr/local/bin/docker-machine-driver-kvm 79 | echo 'CICO: Setup KVM docker-machine driver setup successfully' 80 | } 81 | 82 | function setup_golang() { 83 | # Show which version of golang in the offical repo. 84 | go version 85 | # Setup GOPATH 86 | mkdir $HOME/gopath $HOME/gopath/src $HOME/gopath/bin $HOME/gopath/pkg 87 | export GOPATH=$HOME/gopath 88 | export PATH=$GOROOT/bin:$GOPATH/bin:$PATH 89 | } 90 | 91 | function setup_repo() { 92 | # Setup minishift repo 93 | mkdir -p $GOPATH/src/github.com/minishift 94 | cp -r /home/minishift_ci/payload $GOPATH/src/github.com/minishift/minishift-addons 95 | } 96 | 97 | function setup_godep() { 98 | GODEP_OS_ARCH=`go env GOHOSTOS`-`go env GOHOSTARCH` 99 | GODEP_TAG=v0.3.2 100 | GODEP_LATEST_RELEASE_URL="https://github.com/golang/dep/releases/download/${GODEP_TAG}/dep-${GODEP_OS_ARCH}" 101 | mkdir /tmp/godep 102 | curl -L ${GODEP_LATEST_RELEASE_URL} -o /tmp/godep/dep 103 | chmod +x /tmp/godep/dep 104 | export PATH=$PATH:/tmp/godep/ 105 | } 106 | 107 | function prepare_repo() { 108 | setup_golang; 109 | setup_repo; 110 | setup_godep; 111 | echo "CICO: Preparation complete" 112 | } 113 | 114 | function perform_nightly() { 115 | MINISHIFT_ISO_URL=$1 MINISHIFT_VM_DRIVER=kvm make integration 116 | } 117 | 118 | # Join the array element by specified delimited character 119 | function join_by() { 120 | local IFS="$1"; shift; echo "$*"; 121 | } 122 | 123 | function perform_pr() { 124 | # Get name of addons which are changed in the PR 125 | updated_addons=$(git show --pretty="" --name-only HEAD | grep ".feature" | sed 's/.*\///' | sed 's/\.feature//') 126 | 127 | if [[ ${#updated_addons} -gt 0 ]]; then 128 | tags=$(join_by , ${updated_addons[@]}) 129 | echo "Performing integration test with tags - $tags" 130 | MINISHIFT_ISO_URL=$1 MINISHIFT_VM_DRIVER=kvm make integration GODOG_OPTS="--tags $tags" 131 | else 132 | echo "No changes in test/integration/features files." 133 | fi 134 | } 135 | 136 | if [[ "$UID" = 0 ]]; then 137 | setup_build_environment; 138 | else 139 | source ~/jenkins-env # Source environment variables for minishift_ci user 140 | # Export GITHUB_ACCESS_TOKEN 141 | export GITHUB_ACCESS_TOKEN=$GITHUB_TOKEN 142 | 143 | prepare_repo; 144 | setup_kvm_docker_machine_driver; 145 | # Navigate to the repo 146 | cd $GOPATH/src/github.com/minishift/minishift-addons 147 | 148 | if [[ "$JOB_NAME" = "minishift-addons-nightly-centos" ]]; then 149 | perform_nightly "centos" 150 | elif [[ "$JOB_NAME" = "minishift-addons-pr" ]]; then 151 | perform_pr "centos" 152 | fi 153 | fi 154 | -------------------------------------------------------------------------------- /test/integration/features/addon-eap-cd.feature: -------------------------------------------------------------------------------- 1 | @eap-cd @addon-eap-cd @addon 2 | Feature: eap-cd add-on 3 | Eap-cd add-on imports eap-cd imagestreams and templates, which are then available in OpenShift to the user. 4 | NOTE: This feature requires valid username and password into "registry.redhat.io" to be set as RH_REGISTRY_USERNAME 5 | and RH_REGISTRY_PASSWORD environment variables in order to run successfully. 6 | 7 | @minishift-only 8 | Scenario: User enables redhat-registry-login addon 9 | When executing "minishift addons enable redhat-registry-login" succeeds 10 | Then exitcode should equal "0" 11 | 12 | @minishift-only 13 | Scenario: User sets registry username and password 14 | When executing "minishift config set addon-env REGISTRY_USERNAME=env.RH_REGISTRY_USERNAME,REGISTRY_PASSWORD=env.RH_REGISTRY_PASSWORD" succeeds 15 | Then executing "minishift config view" succeeds 16 | And stdout should match 17 | """ 18 | - addon-env\s+: \[REGISTRY_USERNAME=env\.RH_REGISTRY_USERNAME REGISTRY_PASSWORD=env\.RH_REGISTRY_PASSWORD\] 19 | """ 20 | 21 | @minishift-only 22 | Scenario: Installing the add-on 23 | When executing "minishift addons install ../../add-ons/eap-cd" succeeds 24 | Then stdout should contain "Addon 'eap-cd' installed" 25 | 26 | Scenario: Minishift starts 27 | Given Minishift has state "Does Not Exist" 28 | When executing "minishift start" succeeds 29 | Then Minishift should have state "Running" 30 | 31 | Scenario: Applying the add-on 32 | When executing "minishift addons apply eap-cd" succeeds 33 | Then stdout should contain "EAP CD 15 imagestreams and templates installed" 34 | 35 | Scenario: Deployment of eap-cd-basic application 36 | Given Minishift has state "Running" 37 | When executing "oc new-app eap-cd-basic-s2i" retrying 10 times with wait period of 2 seconds 38 | And executing "oc set probe dc/eap-app --readiness --get-url=http://:8080/index.jsf" succeeds 39 | And service "eap-app" rollout successfully within "1200" seconds 40 | Then with up to "10" retries with wait period of "500ms" the "body" of HTTP request to "/index.jsf" of service "eap-app" in namespace "myproject" contains "Welcome to JBoss!" 41 | And with up to "10" retries with wait period of "500ms" the "status code" of HTTP request to "/index.jsf" of service "eap-app" in namespace "myproject" is equal to "200" 42 | 43 | Scenario: Application pod is using correct version of EAP-CD 44 | Given setting scenario variable "POD_NAME" to the stdout from executing "oc get pod --selector app=eap-cd-basic-s2i -o name" 45 | When executing "oc rsh $(POD_NAME) /opt/eap/bin/jboss-cli.sh -c version" succeeds 46 | Then stdout should contain "Product: JBoss EAP CD 7.3.0.CD15" 47 | 48 | Scenario: User deletes Minishift 49 | Given Minishift has state "Running" 50 | When executing "minishift delete --force" succeeds 51 | Then Minishift should have state "Does Not Exist" 52 | -------------------------------------------------------------------------------- /test/integration/features/cors.feature: -------------------------------------------------------------------------------- 1 | @cors 2 | Feature: Cors add-on 3 | As Minishift user I can install and apply Cors add-on from minishift-addons repository. 4 | 5 | Scenario: Installing the add-on 6 | Given stdout of command "minishift addons list" does not contain "cors" 7 | When executing "minishift addons install ../../add-ons/cors" succeeds 8 | Then stdout should contain "Addon 'cors' installed" 9 | 10 | Scenario: Minishift starts 11 | Given Minishift has state "Does Not Exist" 12 | When executing "minishift start" succeeds 13 | Then Minishift should have state "Running" 14 | 15 | Scenario: Applying the add-on 16 | When executing "minishift addons apply cors" succeeds 17 | Then stdout should contain "CORS is now allowed from any address" 18 | 19 | Scenario: Deleting Minishift 20 | Given Minishift has state "Running" 21 | When executing "minishift delete --force" succeeds 22 | Then Minishift should have state "Does Not Exist" 23 | -------------------------------------------------------------------------------- /test/integration/features/dynamic-admission-controllers.feature: -------------------------------------------------------------------------------- 1 | @dynamic-admission-controllers 2 | 3 | Feature: Feature for dynamic-admission-controllers 4 | 5 | @minishift-only 6 | Scenario: User installs dynamic-admission-controllers add-on 7 | When executing "minishift addons install ../../add-ons/dynamic-admission-controllers" succeeds 8 | Then stdout should contain "Addon 'dynamic-admission-controllers' installed" 9 | 10 | Scenario: User can apply the dynamic-admission-controllers add-on 11 | Given executing "minishift start" succeeds 12 | When executing "minishift addons apply dynamic-admission-controllers" succeeds 13 | Then stdout should contain "Dynamic admission controllers add-on successfully applied" 14 | 15 | Scenario: User can remove the dynamic-admission-controllers add-on 16 | When executing "minishift addons remove dynamic-admission-controllers" succeeds 17 | Then stdout should contain "Dynamic admission controllers add-on successfully removed" 18 | 19 | Scenario: User can uninstall dynamic-admission-controllers add-on 20 | When executing "minishift addons uninstall dynamic-admission-controllers" succeeds 21 | Then stdout should contain "Add-on 'dynamic-admission-controllers' uninstalled" 22 | And stdout of command "minishift addons list" does not contain "dynamic-admission-controllers" 23 | 24 | Scenario: Deleting Minishift 25 | When executing "minishift delete --force" succeeds 26 | Then Minishift should have state "Does Not Exist" 27 | -------------------------------------------------------------------------------- /test/integration/features/example.feature: -------------------------------------------------------------------------------- 1 | @example 2 | # tag @example is used to make this test executable by running `make integration ADDON=example` 3 | # You can use this feature as an example of basic add-on test. 4 | 5 | Feature: Example feature for example.addon 6 | 7 | Scenario: User can install example add-on 8 | Given stdout of command "minishift addons list" does not contain "example" 9 | When executing "minishift addons install ../../add-ons/example" succeeds 10 | Then stdout of command "minishift addons list" contains "example" 11 | 12 | Scenario: User can apply the example add-on 13 | Given executing "minishift start" succeeds 14 | When executing "minishift addons apply example" succeeds 15 | Then stdout should contain "Example add-on successfully applied" 16 | 17 | Scenario: User can remove the example add-on 18 | When executing "minishift addons remove example" succeeds 19 | Then stdout should contain "Example add-on successfully removed" 20 | 21 | Scenario: User can uninstall example add-on 22 | When executing "minishift addons uninstall example" succeeds 23 | Then stdout should contain "Add-on 'example' uninstalled" 24 | And stdout of command "minishift addons list" does not contain "example" 25 | 26 | Scenario: Deleting Minishift 27 | When executing "minishift delete --force" succeeds 28 | Then Minishift should have state "Does Not Exist" 29 | -------------------------------------------------------------------------------- /test/integration/features/istio.feature: -------------------------------------------------------------------------------- 1 | @istio 2 | Feature: Feature for istio 3 | 4 | @minishift-only 5 | Scenario: User installs istio add-on 6 | When executing "minishift addons install ../../add-ons/dynamic-admission-controllers" succeeds 7 | When executing "minishift addons install ../../add-ons/istio" succeeds 8 | Then stdout should contain "Addon 'istio' installed" 9 | 10 | # Scenario: Minishift starts 11 | # Given Minishift has state "Does Not Exist" 12 | # When executing "minishift start --memory=4GB" succeeds 13 | # Then Minishift should have state "Running" 14 | # 15 | # Scenario: User can apply the istio add-on 16 | # Given Minishift has state "Running" 17 | # When executing "minishift addons apply dynamic-admission-controllers" succeeds 18 | # And executing "minishift addons apply istio" succeeds 19 | # And executing "oc get pods -n istio-system --as system:admin" succeeds 20 | # Then stdout should contain "istio-pilot-" 21 | # 22 | # Scenario: User can remove the istio add-on 23 | # When executing "minishift addons remove istio" succeeds 24 | # Then stdout should contain "Istio add-on successfully removed" 25 | 26 | Scenario: User can uninstall istio add-on 27 | When executing "minishift addons uninstall istio" succeeds 28 | Then stdout should contain "Add-on 'istio' uninstalled" 29 | And stdout of command "minishift addons list" does not contain "istio" 30 | 31 | Scenario: Deleting Minishift 32 | When executing "minishift delete --force" succeeds 33 | Then Minishift should have state "Does Not Exist" 34 | -------------------------------------------------------------------------------- /test/integration/integration_test.go: -------------------------------------------------------------------------------- 1 | // +build integration 2 | 3 | package integration 4 | 5 | import ( 6 | "os" 7 | "strings" 8 | "testing" 9 | 10 | "github.com/DATA-DOG/godog" 11 | "github.com/minishift/minishift/test/integration/testsuite" 12 | ) 13 | 14 | func TestMain(m *testing.M) { 15 | parseFlags() 16 | testsuite.HandleISOVersion() 17 | 18 | status := godog.RunWithOptions("minishift", func(s *godog.Suite) { 19 | getFeatureContext(s) 20 | }, godog.Options{ 21 | Format: testsuite.GodogFormat, 22 | Paths: strings.Split(testsuite.GodogPaths, ","), 23 | Tags: testsuite.GodogTags, 24 | ShowStepDefinitions: testsuite.GodogShowStepDefinitions, 25 | StopOnFailure: testsuite.GodogStopOnFailure, 26 | NoColors: testsuite.GodogNoColors, 27 | }) 28 | 29 | if st := m.Run(); st > status { 30 | status = st 31 | } 32 | os.Exit(status) 33 | } 34 | 35 | func getFeatureContext(s *godog.Suite) { 36 | // loads step definitions from the Minishift integration testsuite 37 | testsuite.FeatureContext(s) 38 | 39 | // loads additional step definitions for minishift-addons 40 | // mypackage.FeatureContext(s) 41 | } 42 | 43 | func parseFlags() { 44 | // gets flag values used by Minishift intefration testsuite 45 | testsuite.ParseFlags() 46 | // here you can get additional flag values if needed, for example: 47 | // mypackage.ParseFlags() 48 | } 49 | -------------------------------------------------------------------------------- /test/utils/minishift_latest_version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import requests 4 | import re 5 | import os 6 | import platform 7 | 8 | distributionInfo = platform.platform() 9 | 10 | matchObj = re.match( r'linux|darwin', distributionInfo, re.I) 11 | OS= matchObj.group().lower() 12 | 13 | def main(): 14 | pattern = re.compile(".*%s-amd64.tgz$" % OS) 15 | r = requests.get('https://api.github.com/repos/minishift/minishift/releases/latest') 16 | for asset in r.json()['assets']: 17 | if pattern.match(asset['name']): 18 | print asset['browser_download_url'] 19 | 20 | if __name__ == "__main__": 21 | main() 22 | --------------------------------------------------------------------------------