This commit is contained in:
commit
e4c7b319e2
44
.gitea/workflows/build-chart.yml
Normal file
44
.gitea/workflows/build-chart.yml
Normal file
@ -0,0 +1,44 @@
|
||||
name: "Build Helm Chart"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
paths:
|
||||
- "artemis-broker/Chart.yaml"
|
||||
|
||||
jobs:
|
||||
helm-package:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
APP: artemis-broker
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Helm Chart App Name and Version
|
||||
id: get_version
|
||||
run: |
|
||||
APP_NAME=$(grep -oP '(?<=^name: ).*' ${{ env.APP }}/Chart.yaml)
|
||||
echo "Helm Chart App Name: $APP_NAME"
|
||||
echo "::set-output name=app::$APP_NAME"
|
||||
|
||||
CHART_VERSION=$(grep -oP '(?<=^version: ).*' ${{ env.APP }}/Chart.yaml)
|
||||
echo "Helm Chart version: $CHART_VERSION"
|
||||
echo "::set-output name=tag::$CHART_VERSION"
|
||||
|
||||
- name: Setup Helm
|
||||
run: |
|
||||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
helm version
|
||||
|
||||
- name: Package Helm Chart
|
||||
run: |
|
||||
helm dependency update ${{ env.APP }}
|
||||
helm lint ${{ env.APP }}
|
||||
helm package ${{ env.APP }}
|
||||
|
||||
- name: Upload Helm Package to repo
|
||||
run: |
|
||||
curl --user ${{ secrets.USER }}:${{ secrets.TOKEN }} -X POST --upload-file ./${{ steps.get_version.outputs.app }}-${{ steps.get_version.outputs.tag }}.tgz ${{ vars.HELMREGISTRY }}/api/packages/${{ vars.OWNER }}/helm/api/charts
|
||||
echo "--user ${{ secrets.USER }}:${{ secrets.TOKEN }} -X POST --upload-file ./${{ steps.get_version.outputs.app }}-${{ steps.get_version.outputs.tag }}.tgz ${{ vars.HELMREGISTRY }}/api/packages/${{ vars.OWNER }}/helm/api/charts"
|
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
392
README.md
Normal file
392
README.md
Normal file
@ -0,0 +1,392 @@
|
||||
# RED HAT AMQ BROKER HELM CHART
|
||||
|
||||
This chart handles the deployment of RedHat AMQ broker instances on both OCP and generic k8s distributions. These deployment flavors are supported:
|
||||
|
||||
1. Standalone AMQ Broker
|
||||
2. Choice between `Deployment` and `StatefulSet`
|
||||
3. TLS optional
|
||||
4. Persistence is optional. (Needs a supported StorageClass)
|
||||
5. NodePorts and Passthrough Routes
|
||||
6. Optional Prometheus monitoring
|
||||
7. Optional Clustering (WIP)
|
||||
8. Deployment compatibility with both Openshift and base Kubernetes
|
||||
|
||||
|NAME | DESCRIPTION | DEFAULT VALUE |
|
||||
|----------------------------------|----------------------------------------------------------|----------------|
|
||||
| kind | Deploy broker as Deployment or StatefulSet | `Deployment` |
|
||||
| clustered | Deploy a clustered broker | `False` |
|
||||
| platform | Choose platform type (openshift or kubernetes) | `openshift` |
|
||||
| application.name | The name for the application. | `amq-broker-persistence` |
|
||||
| application.amq_broker_version | Broker Image tag | `7.7` |
|
||||
| application.amq_broker_image | Broker Image name | `registry.redhat.io/amq7/amq-broker` |
|
||||
| application.pullPolicy | Pull policy | `IfNotPresent` |
|
||||
| application.replicas | Number of replicas for a clustered broker | `2` |
|
||||
| application.volume_capacity | Size of persistent volume | `1G` |
|
||||
| service.console | Jolokia console port and configuration | See values.yaml |
|
||||
| service.acceptors | Array of acceptors. Only the multiplex is exposed by default | See values.yaml |
|
||||
| ingress | Ingress configuration (only applies to kubernetes platform | See values.yaml |
|
||||
| ingress.passthrough | Passthrough ingress rule options (k8s only) | See values.yaml |
|
||||
| ingress.console | Artemis console ingress rule options (k8s only) | See values.yaml |
|
||||
| tls.keystore | Name of the keystore file | See values.yaml |
|
||||
| tls.truststore | Name of the truststoreile | See values.yaml |
|
||||
| tls.keystore_password | Password to unlock the keystore on container boot | See values.yaml |
|
||||
| tls.truststore_password | Password to unlock the truststore on container boot | See values.yaml |
|
||||
| nodeport.enabled | Create node port to expose AMQ to clients outside of the cluster | `30002` |
|
||||
| nodeport.port | Node port number used when enabled | `30002` |
|
||||
| passthrough_route.enabled | Create a passthrough route to allow inbound TCP/SNI connections to a TLS-enabled broker | `False` |
|
||||
| passthrough_route.hostname | Host name to use when building the route. the openshift_appdomain parameter gets appended to this value. | None |
|
||||
| parameters.append_ns | Append the namespace string to hostnames before building route manifests. This is useful to keep the URL unique. | `False` |
|
||||
| parameters.tls_enabled | Enable or disable TLS support for acceptors | `false` |
|
||||
| parameters.jolokia_passthrough | Configure TLS for the jolokia console as a passthrough route or an edge terminated route if tls_enabled is set to true | `false` |
|
||||
| parameters.amq_protocols | Protocols to configure, separated by commas. Allowed values are: `openwire`, `amqp`, `stomp`, `mqtt` and `hornetq`. | `openwire,amqp,stomp,mqtt,hornetq` |
|
||||
| parameters.amq_broker_name | Broker name (TODO is this used? Same as application.name ) | `broker` |
|
||||
| parameters.amq_global_max_size | Maximum amount of memory which message data may consume ( TODO: 100 gb as default is a bit high for most systems) | `"100 gb"` |
|
||||
| parameters.amq_require_login | Determines whether or not the broker will allow anonymous access, or require login | `False` |
|
||||
| parameters.amq_extra_args | Extra arguments for broker creation | `` |
|
||||
| parameters.amq_anycast_prefix | Anycast prefix applied to the multiplexed protocol port 61616 | `jmx.queue.` |
|
||||
| parameters.amq_multicast_prefix | Multicast prefix applied to the multiplexed protocol port 61616 | `jmx.topic.` |
|
||||
| parameters.amq_enable_metrics_plugin | Whether to enable artemis metrics plugin | `False` |
|
||||
| parameters.amq_journal_type | Journal type to use; aio or nio supported | `nio` |
|
||||
| parameters.amq_data_dir | Directory for storing data | `/opt/amq/data` |
|
||||
| templates.service | Template for service name | See values.yaml |
|
||||
| templates.deployment | Template for deployment name | See values.yaml |
|
||||
| templates.route | Template for route name | See values.yaml |
|
||||
| templates.broker_image | Template for image name | See values.yaml |
|
||||
| templates.override_cm | Template for ConfigMap name containing overrides | See values.yaml |
|
||||
| templates.config_cm | Template for ConfigMap nggame | See values.yaml |
|
||||
| templates.app_secret | Template for name of a secret containing credential data such as users and passwords | See values.yaml |
|
||||
| templates.pvc_name | Template for persistent volume name | See values.yaml |
|
||||
| security.enabled | Enabled security | `true` |
|
||||
| security.secrets | Array of names of additional secrets to mount into /opt/amq/conf | [] |
|
||||
| security.createSecret | Create secret with users and passwords. Disable when secrets is created outside of this chart. For example by ExternalSecret | `true` |
|
||||
| security.jaasUsers.key | Specify the key (filename) of the user/password file in the secret | `artemis-users.properties` |
|
||||
| admin.user | Admin user. Mandatory even if security.createSecret is `false`) | `admin` |
|
||||
| admin.password | Admin password. Optional. Only used if security.createSecret is `true` | `password` |
|
||||
| admin.role | Admin role name | `admin` |
|
||||
| users | Array of additional users. Only used if security.createSecret is `true` else users are expected to be defined in secret. | [] |
|
||||
| queue.defaults | Default values for queues parameters | [] |
|
||||
| queue.addresses | Array of queues to create. | [] |
|
||||
| metrics.enabled | Enable metrics in AMQ and let Prometheus collect metrics using ServiceMonitor | `false` |
|
||||
| metrics.jvm_memory | Enable JVM memory metrics | `true` |
|
||||
| metrics.jvm_gc | Enable JVM garbage collection statistics in metrics | `false` |
|
||||
| metrics.jvm_threads | Enable JVM Thread statistics | `false` |
|
||||
| metrics.servicemonitor.port | Collect metrics from this port. Default is the management port. | `8161` |
|
||||
| metrics.servicemonitor.interval | Metrics are collected with fixed interval. | `20s` |
|
||||
| resources | Kubernetes limits and resources to attach to pod templates | See values.yaml |
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
The most basic deployment can be performed by following these steps:
|
||||
|
||||
### Disk Persistence:
|
||||
|
||||
Every deployment flavor (TLS and Non-TLS) can be made persistent by setting the `persitent` flag to `true`:
|
||||
|
||||
```
|
||||
application:
|
||||
[...]
|
||||
volume_capacity: "1G"
|
||||
persistent: true
|
||||
```
|
||||
|
||||
### Non-TLS AMQ Brokers
|
||||
|
||||
- Customize the application name in `values.yaml`:
|
||||
|
||||
```
|
||||
application:
|
||||
name: amq-broker-persistence-ssl
|
||||
[...]
|
||||
volume_capacity: "1G"
|
||||
```
|
||||
|
||||
```
|
||||
parameters:
|
||||
[...]
|
||||
amq_data_dir: "/opt/amq/data"
|
||||
tls_enabled: false
|
||||
[...]
|
||||
```
|
||||
|
||||
If needed, the broker can be consumed by clients running outside OCP by deploying a NodePort resource:
|
||||
|
||||
```
|
||||
nodeport:
|
||||
[...]
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Since no TLS passthrough is possible without proper tls support, the passthrough_route should be disabled:
|
||||
|
||||
```
|
||||
passthrough_route:
|
||||
enabled: false
|
||||
[...]
|
||||
```
|
||||
|
||||
### TLS-enabled AMQ Brokers
|
||||
|
||||
- Create (or import) a keystore/truststore pair for this broker. Put the files under `tls/` and update the tls section in `values.yaml`:
|
||||
|
||||
```
|
||||
tls:
|
||||
keystore: keystore.ks
|
||||
truststore: keystore.ts
|
||||
keystore_password: kspwd
|
||||
truststore_password: tspwd
|
||||
```
|
||||
|
||||
- Customize the application name in `values.yaml`:
|
||||
|
||||
```
|
||||
application:
|
||||
name: amq-broker-artemis
|
||||
[...]
|
||||
volume_capacity: "1G"
|
||||
```
|
||||
|
||||
```
|
||||
parameters:
|
||||
[...]
|
||||
tls_enabled: true
|
||||
jolokia_passthrough: false # set this to true if you want to use the same keystore for the jolokia console too. in this case the route will be created as passthrough
|
||||
amq_data_dir: "/opt/amq/data"
|
||||
[...]
|
||||
```
|
||||
|
||||
For TLS-enabled brokers, both the NodePort and the Passthrough route options are working. Both can be enabled at the same time.
|
||||
|
||||
### Common Setup
|
||||
|
||||
The application name will be used as a prefix for most of the objects deployed by the Chart itself.
|
||||
|
||||
- Update the Admin user name and password in `values.yaml`
|
||||
|
||||
```
|
||||
admin:
|
||||
user: admin
|
||||
password: password
|
||||
role: admin
|
||||
```
|
||||
|
||||
- If needed, enable and choose a node port TCP value and corresponding service for the external service in `values.yaml`:
|
||||
|
||||
```
|
||||
nodeport:
|
||||
port: 30003
|
||||
service: multiplex
|
||||
enabled: true
|
||||
```
|
||||
this port needs to be in the allowed NodePort range set up in the kubelet (typically in the range 30000-32768)
|
||||
|
||||
- Install the Chart under your preferred project
|
||||
|
||||
```
|
||||
$ oc new-project amq-demo-artemis
|
||||
$ helm install amq-broker-artemis .
|
||||
```
|
||||
|
||||
After a while and depending on what options are enabled in the values file, the broker should be up and running:
|
||||
|
||||
```
|
||||
$ oc get all
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
pod/amq-broker-artemis-dc-6f7658dbc7-xgxll 1/1 Running 0 86s
|
||||
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
service/amq-broker-artemis-nodeport-svc NodePort 172.30.208.78 <none> 61616:30003/TCP 87s
|
||||
service/amq-broker-artemis-svc ClusterIP 172.30.194.187 <none> 61616/TCP,8161/TCP 87s
|
||||
|
||||
NAME READY UP-TO-DATE AVAILABLE AGE
|
||||
deployment.apps/amq-broker-artemis-dc 1/1 1 1 87s
|
||||
|
||||
NAME DESIRED CURRENT READY AGE
|
||||
replicaset.apps/amq-broker-artemis-dc-6f7658dbc7 1 1 1 87s
|
||||
|
||||
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
|
||||
route.route.openshift.io/amq-broker-artemis-route-console amq-broker-artemis-route-console-amq-helm-test.apps.lab01.gpslab.club amq-broker-artemis-svc 8161 edge/Redirect None
|
||||
```
|
||||
|
||||
## ADDING QUEUES, USERS AND ROLES
|
||||
|
||||
To add multiple users to the broker edit the `users` section in `values.yaml`. For example, this setup here:
|
||||
|
||||
```
|
||||
users:
|
||||
- name: demouser
|
||||
password: "demo"
|
||||
role: user
|
||||
- name: anotheruser
|
||||
password: "demo1"
|
||||
role: user
|
||||
```
|
||||
|
||||
would be rendered by the Helm Chart into these two files:
|
||||
|
||||
- `artemis-users.properties`
|
||||
|
||||
```
|
||||
## CUSTOMCONFIG
|
||||
|
||||
# ADMIN USER
|
||||
admin = password
|
||||
|
||||
# ADDITIONAL USERS
|
||||
demouser = demo
|
||||
anotheruser = demo1
|
||||
```
|
||||
|
||||
- `artemis-roles.properties`
|
||||
|
||||
```
|
||||
## CUSTOMCONFIG
|
||||
# ADMIN ROLE MAPPING
|
||||
admin = admin
|
||||
|
||||
# ADDITIONAL ROLE MAPPING
|
||||
user = demouser
|
||||
user = anotheruser
|
||||
```
|
||||
|
||||
Users and passwords may be stored in an existing secret instead of as clear text in the values.yaml: disable the creation of the built-in user secret and specify the name of an existing secret.
|
||||
|
||||
Set the `jaasUsers.key` to the filename used in the secret. Note that the filename have to be something different from `artemis-users.properties` as the default file will be mounted in the same directory in the container.
|
||||
|
||||
For example:
|
||||
```
|
||||
security:
|
||||
secrets:
|
||||
- broker-external-secret
|
||||
createSecret: false
|
||||
jaasUsers:
|
||||
key: my-secured-artemis-users.properties
|
||||
|
||||
```
|
||||
|
||||
*Note*, that the AMQ_USER and AMQ_PASSWORD *must* be set, as the broker still uses these environment parameters:
|
||||
|
||||
```
|
||||
stringData:
|
||||
AMQ_USER: broker-admin
|
||||
AMQ_PASSWORD: mySecretPassword
|
||||
my-secured-artimis-users.properties: |
|
||||
# ADMIN USER
|
||||
broker-admin = mySecretPassword
|
||||
# ADDITIONAL USERS
|
||||
consumer-user = otherSecretPassword
|
||||
type: Opaque
|
||||
```
|
||||
|
||||
The `queues` section in `values.yaml` allows to add custom queues to the broker at install time. For example, this setup:
|
||||
|
||||
```
|
||||
queues:
|
||||
defaults:
|
||||
[...]
|
||||
addresses:
|
||||
- name: demoQueue
|
||||
permissions:
|
||||
- grant: consume
|
||||
roles:
|
||||
- admin
|
||||
- user
|
||||
- grant: browse
|
||||
roles:
|
||||
- admin
|
||||
- user
|
||||
- grant: send
|
||||
roles:
|
||||
- admin
|
||||
- user
|
||||
- grant: manage
|
||||
roles:
|
||||
- admin
|
||||
```
|
||||
|
||||
would result in this rendered section inside `broker.xml`:
|
||||
|
||||
```
|
||||
<security-setting match="demoQueue">
|
||||
<permission type="consume" roles="admin,user," />
|
||||
<permission type="browse" roles="admin,user," />
|
||||
<permission type="send" roles="admin,user," />
|
||||
<permission type="manage" roles="admin," />
|
||||
</security-setting>
|
||||
```
|
||||
|
||||
the defaults section under the queues stanza contains the values set for every queue if not overridden on a per queue basis.
|
||||
|
||||
## Metering
|
||||
|
||||
An optional prometheus ServiceMonitor is shipped with the chart. See values.yaml (metering stanza) for configuration.
|
||||
|
||||
## Clustering
|
||||
|
||||
Optional clustering is somewhat supported, but it is still considered WIP.
|
||||
|
||||
## Kubernetes support
|
||||
|
||||
AMQ Broker can be deployed also on standard Kubernetes clusters:
|
||||
|
||||
1. Ingress Rules are deployed instead of Openshift Routes for both the console and the passthrough route
|
||||
2. A valid RedHat pull secret needs to be explicitly created in order to pull the AMQ broker images from registry.redhat.io:
|
||||
|
||||
```
|
||||
$ kubectl create secret docker-registry <PULL SECRET NAME> \
|
||||
--docker-server=registry.redhat.io \
|
||||
--docker-username=<CUSTOMER PORTAL USERNAME> \
|
||||
--docker-password=<CUSTOMER PORTAL PASSWORD> \
|
||||
--docker-email=<email address>
|
||||
```
|
||||
|
||||
The secret created with the command shown above needs to be set up in the _values.yaml_ file:
|
||||
|
||||
```
|
||||
[...]
|
||||
application:
|
||||
[...]
|
||||
pullSecretName: <PULL SECRET NAME>
|
||||
[...]
|
||||
```
|
||||
|
||||
## KEYSTORE CREATION MINI-HOWTO
|
||||
|
||||
In order to deploy SSL-enabled templates, a secret with valid Java Truststore and Keystore files must be created.
|
||||
To create a keystore:
|
||||
|
||||
1. Generate a self-signed certificate for the broker keystore:
|
||||
```
|
||||
$ keytool -genkey -alias broker -keyalg RSA -keystore broker.ks
|
||||
```
|
||||
|
||||
2. Export the certificate so that it can be shared with clients:
|
||||
```
|
||||
$ keytool -export -alias broker -keystore broker.ks -file broker_cert
|
||||
```
|
||||
|
||||
3. Generate a self-signed certificate for the client keystore:
|
||||
```
|
||||
$ keytool -genkey -alias client -keyalg RSA -keystore client.ks
|
||||
```
|
||||
|
||||
4. Create a client truststore that imports the broker certificate:
|
||||
```
|
||||
$ keytool -import -alias broker -keystore client.ts -file broker_cert
|
||||
```
|
||||
|
||||
5. Export the client’s certificate from the keystore:
|
||||
```
|
||||
$ keytool -export -alias client -keystore client.ks -file client_cert
|
||||
```
|
||||
|
||||
6. Import the client’s exported certificate into a broker SERVER truststore:
|
||||
```
|
||||
$ keytool -import -alias client -keystore broker.ts -file client_cert
|
||||
```
|
||||
|
||||
## DISCLAIMER
|
||||
|
||||
This chart is distributed as-is under the GPLv3 license and it's currently being developed as a private project to experiment alternative installation methods to the default AMQ Operator supported by RedHat.
|
||||
This repo and the code it contains is not by any means endorsed or supported by RedHat or by any of the software subscriptions RedHat offers.
|
||||
|
||||
|
3
artemis-broker/.gitignore
vendored
Normal file
3
artemis-broker/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
values.test
|
||||
tls/broker*
|
||||
tls/client*
|
14
artemis-broker/Chart.yaml
Normal file
14
artemis-broker/Chart.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: v2
|
||||
name: artemis-broker
|
||||
version: 7.12.3-test1
|
||||
description: An unified Helm Chart that deploys an Artemis MQ Broker with optional SSL support and Optional Disk Persistence. Clustered setups are also supported.
|
||||
type: application
|
||||
keywords:
|
||||
- activemq
|
||||
- artemismq
|
||||
- amq-broker
|
||||
- ssl-endpoint
|
||||
- amq-cluster
|
||||
home: https://access.redhat.com/products/red-hat-amq/
|
||||
sources:
|
||||
- https://git.cooltux.net/marko/amq-broker-helm
|
49
artemis-broker/conf/artemis-roles.properties
Normal file
49
artemis-broker/conf/artemis-roles.properties
Normal file
@ -0,0 +1,49 @@
|
||||
## ---------------------------------------------------------------------------
|
||||
## Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
## contributor license agreements. See the NOTICE file distributed with
|
||||
## this work for additional information regarding copyright ownership.
|
||||
## The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
## (the "License"); you may not use this file except in compliance with
|
||||
## the License. You may obtain a copy of the License at
|
||||
##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0
|
||||
##
|
||||
## Unless required by applicable law or agreed to in writing, software
|
||||
## distributed under the License is distributed on an "AS IS" BASIS,
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
## See the License for the specific language governing permissions and
|
||||
## limitations under the License.
|
||||
## ---------------------------------------------------------------------------
|
||||
## CUSTOMCONFIG
|
||||
|
||||
# syntax is role = list of users
|
||||
|
||||
# ADMIN ROLE MAPPING
|
||||
{{- $admins := list -}}
|
||||
{{- $admins = printf "%s" $.Values.admin.user | append $admins -}}
|
||||
{{- range $currentUser := $.Values.users }}
|
||||
{{- if has ($.Values.admin.role) $currentUser.roles }}
|
||||
{{- $admins = printf "%s" (toString $currentUser.name) | append $admins -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ $.Values.admin.role }} = {{ $admins | join "," }}
|
||||
|
||||
{{- $declared_roles := list }}
|
||||
{{- range .Values.users }}
|
||||
{{- range .roles }}
|
||||
{{- if and (not (has (toString .) $declared_roles)) (not (eq (toString .) ($.Values.admin.role))) }}
|
||||
{{- $declared_roles = printf "%s" (toString .) | append $declared_roles }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
# ADDITIONAL ROLE MAPPING
|
||||
{{- range $current_role := $declared_roles }}
|
||||
{{- $users_in_role := list -}}
|
||||
{{- range $currentUser := $.Values.users }}
|
||||
{{- if has $current_role $currentUser.roles }}
|
||||
{{- $users_in_role = printf "%s" (toString $currentUser.name) | append $users_in_role -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ $current_role }} = {{ $users_in_role | join "," }}
|
||||
{{- end }}
|
28
artemis-broker/conf/artemis-users.properties
Normal file
28
artemis-broker/conf/artemis-users.properties
Normal file
@ -0,0 +1,28 @@
|
||||
{{- if .Values.security.createSecret }}
|
||||
## ---------------------------------------------------------------------------
|
||||
## Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
## contributor license agreements. See the NOTICE file distributed with
|
||||
## this work for additional information regarding copyright ownership.
|
||||
## The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
## (the "License"); you may not use this file except in compliance with
|
||||
## the License. You may obtain a copy of the License at
|
||||
##
|
||||
## http://www.apache.org/licenses/LICENSE-2.0
|
||||
##
|
||||
## Unless required by applicable law or agreed to in writing, software
|
||||
## distributed under the License is distributed on an "AS IS" BASIS,
|
||||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
## See the License for the specific language governing permissions and
|
||||
## limitations under the License.
|
||||
## ---------------------------------------------------------------------------
|
||||
## CUSTOMCONFIG
|
||||
|
||||
# ADMIN USER
|
||||
{{ .Values.admin.user }} = {{ .Values.admin.password }}
|
||||
|
||||
# ADDITIONAL USERS
|
||||
{{- range .Values.users }}
|
||||
{{ .name }} = {{ .password }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
43
artemis-broker/conf/bootstrap.xml
Normal file
43
artemis-broker/conf/bootstrap.xml
Normal file
@ -0,0 +1,43 @@
|
||||
{{- $jolokia_ssl := and (.Values.parameters.tls_enabled) (.Values.parameters.jolokia_passthrough) }}
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
~ contributor license agreements. See the NOTICE file distributed with
|
||||
~ this work for additional information regarding copyright ownership.
|
||||
~ The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
~ (the "License"); you may not use this file except in compliance with
|
||||
~ the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<broker xmlns="http://activemq.apache.org/schema">
|
||||
|
||||
<jaas-security domain="activemq"/>
|
||||
|
||||
|
||||
<!-- artemis.URI.instance is parsed from artemis.instance by the CLI startup.
|
||||
This is to avoid situations where you could have spaces or special characters on this URI -->
|
||||
<server configuration="file:${HOME}/${AMQ_NAME}/etc//broker.xml"/>
|
||||
|
||||
<!-- The web server is only bound to localhost by default -->
|
||||
{{- if $jolokia_ssl }}
|
||||
<web bind="https://0.0.0.0:8161" path="web" keyStorePath="{{ .Values.tls.secret_mount_path }}/{{ .Values.tls.keystore }}" keyStorePassword="{{ .Values.tls.keystore_password }}">
|
||||
{{- else }}
|
||||
<web bind="http://0.0.0.0:8161" path="web">
|
||||
{{- end }}
|
||||
<app url="redhat-branding" war="redhat-branding.war"/>
|
||||
<app url="artemis-plugin" war="artemis-plugin.war"/>
|
||||
<app url="console" war="hawtio.war"/>
|
||||
<app url="metrics" war="metrics.war"/>
|
||||
</web>
|
||||
|
||||
|
||||
</broker>
|
||||
|
258
artemis-broker/conf/broker.xml
Normal file
258
artemis-broker/conf/broker.xml
Normal file
@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership. The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied. See the License for thespecific language governing permissions and limitationsunder the License.-->
|
||||
<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
|
||||
<core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core ">
|
||||
<name>${AMQ_NAME}</name>
|
||||
{{- if and .Values.application.persistent (or .Values.clustered .Values.ha_ap) }}
|
||||
<persistence-enabled>true</persistence-enabled>
|
||||
<!-- this could be ASYNCIO, MAPPED, NIO ASYNCIO: Linux Libaio MAPPED: mmap files NIO: Plain Java Files -->
|
||||
<journal-type>{{ .Values.application.journal_type }}</journal-type>
|
||||
<paging-directory>${AMQ_DATA_DIR}/paging</paging-directory>
|
||||
<bindings-directory>${AMQ_DATA_DIR}/bindings</bindings-directory>
|
||||
<journal-directory>${AMQ_DATA_DIR}/journal</journal-directory>
|
||||
<large-messages-directory>${AMQ_DATA_DIR}/large-messages</large-messages-directory>
|
||||
{{- else }}
|
||||
<persistence-enabled>false</persistence-enabled>
|
||||
<!-- this could be ASYNCIO, MAPPED, NIO ASYNCIO: Linux Libaio MAPPED: mmap files NIO: Plain Java Files -->
|
||||
<journal-type>NIO</journal-type>
|
||||
<paging-directory>./data/paging</paging-directory>
|
||||
<bindings-directory>./data/bindings</bindings-directory>
|
||||
<journal-directory>./data/journal</journal-directory>
|
||||
<large-messages-directory>./data/large-messages</large-messages-directory>
|
||||
{{- end }}
|
||||
<journal-datasync>true</journal-datasync>
|
||||
<journal-min-files>2</journal-min-files>
|
||||
<journal-pool-files>10</journal-pool-files>
|
||||
<journal-file-size>10M</journal-file-size>
|
||||
<!-- This value was determined through a calculation. Your system could perform 0.26 writes per millisecond on the current journal configuration. That translates as a sync write every 3800000 nanoseconds. Note: If you specify 0 the system will perform writes directly to the disk. We recommend this to be 0 if you are using journalType=MAPPED and ournal-datasync=false. -->
|
||||
<journal-buffer-timeout>9524000</journal-buffer-timeout>
|
||||
<!-- When using ASYNCIO, this will determine the writing queue depth for libaio. -->
|
||||
<journal-max-io>4096</journal-max-io>
|
||||
<!-- You can verify the network health of a particular NIC by specifying the <network-check-NIC> element. <network-check-NIC>theNicName</network-check-NIC> -->
|
||||
<!-- Use this to use an HTTP server to validate the network <network-check-URL-list>http://www.apache.org</network-check-URL-list> -->
|
||||
<!-- <network-check-period>10000</network-check-period> -->
|
||||
<!-- <network-check-timeout>1000</network-check-timeout> -->
|
||||
<!-- this is a comma separated list, no spaces, just DNS or IPs it should accept IPV6 Warning: Make sure you understand your network topology as this is meant to validate if your network is valid. Using IPs that could eventually disappear or be partially visible may defeat the purpose. You can use a list of multiple IPs, and if any successful ping will make the server OK to continue running -->
|
||||
<!-- <network-check-list>10.0.0.1</network-check-list> -->
|
||||
<!-- use this to customize the ping used for ipv4 addresses -->
|
||||
<!-- <network-check-ping-command>ping -c 1 -t %d %s</network-check-ping-command> -->
|
||||
<!-- use this to customize the ping used for ipv6 addresses -->
|
||||
<!-- <network-check-ping6-command>ping6 -c 1 %2$s</network-check-ping6-command> -->
|
||||
<!-- how often we are looking for how many bytes are being used on the disk in ms -->
|
||||
<disk-scan-period>5000</disk-scan-period>
|
||||
<!-- once the disk hits this limit the system will block, or close the connection in certain protocols that won't support flow control. -->
|
||||
<max-disk-usage>90</max-disk-usage>
|
||||
<!-- should the broker detect dead locks and other issues -->
|
||||
<critical-analyzer>true</critical-analyzer>
|
||||
<critical-analyzer-timeout>120000</critical-analyzer-timeout>
|
||||
<critical-analyzer-check-period>60000</critical-analyzer-check-period>
|
||||
<critical-analyzer-policy>HALT</critical-analyzer-policy>
|
||||
<!-- the system will enter into page mode once you hit this limit. This is an estimate in bytes of how much the messages are using in memory The system will use half of the available memory (-Xmx) by default for the global-max-size. You may specify a different value here if you need to customize it to your needs. <global-max-size>${AMQ_STORAGE_USAGE_LIMIT}</global-max-size> -->
|
||||
<acceptors>
|
||||
<!-- useEpoll means: it will use Netty epoll if you are on a system (Linux) that supports it -->
|
||||
<!-- amqpCredits: The number of credits sent to AMQP producers -->
|
||||
<!-- amqpLowCredits: The server will send the # credits specified at amqpCredits at this low mark -->
|
||||
<!-- Acceptor for every supported protocol -->
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
{{- range .Values.service.acceptors }}
|
||||
{{- $extra_args := list -}}
|
||||
{{- range .acceptor_params }}
|
||||
{{- $extra_args = printf "%s=%s" (toString .key) (toString .value) | append $extra_args }}
|
||||
{{- end }}
|
||||
{{- if or (.use_tls) (eq (.use_tls | toString) "<nil>") }}
|
||||
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};connectionsAllowed={{ .max_connections }};sslEnabled=true;keyStorePath=${AMQ_KEYSTORE_TRUSTSTORE_DIR}/{{ $.Values.tls.keystore }};keyStorePassword=${AMQ_KEYSTORE_PASSWORD};trustStorePath=${AMQ_KEYSTORE_TRUSTSTORE_DIR}/{{ $.Values.tls.truststore }};trustStorePassword=${AMQ_TRUSTSTORE_PASSWORD};sslProvider={{ $.Values.parameters.ssl_provider }};{{ $extra_args | join ";" }}</acceptor>
|
||||
{{- else }}
|
||||
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};{{ $extra_args | join ";" }}</acceptor>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- range .Values.service.acceptors }}
|
||||
{{- $extra_args := list -}}
|
||||
{{- range .acceptor_params }}
|
||||
{{- $extra_args = printf "%s=%s" (toString .key) (toString .value) | append $extra_args }}
|
||||
{{- end }}
|
||||
<acceptor name="{{ .name }}">tcp://${BROKER_IP}:{{ .port }}?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols={{ default $.Values.parameters.amq_protocols .amq_protocols }};useEpoll=true;amqpCredits=1000;amqpLowCredits=300;anycastPrefix=${AMQ_ANYCAST_PREFIX};multicastPrefix=${AMQ_MULTICAST_PREFIX};{{ $extra_args | join ";" }}</acceptor>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</acceptors>
|
||||
<security-enabled>{{ .Values.security.enabled }}</security-enabled>
|
||||
<security-settings>
|
||||
{{- range .Values.queues.addresses }}
|
||||
<security-setting match="{{ .name }}">
|
||||
{{- range .permissions }}
|
||||
<permission type="{{ .grant }}" roles="{{- range $i, $el := .roles }}{{if $i}},{{end}}{{$el}}{{- end -}}" />
|
||||
{{- end }}
|
||||
</security-setting>
|
||||
{{- end }}
|
||||
<security-setting match="#">
|
||||
<permission type="createNonDurableQueue" roles="${AMQ_ROLE}" />
|
||||
<permission type="deleteNonDurableQueue" roles="${AMQ_ROLE}" />
|
||||
<permission type="createDurableQueue" roles="${AMQ_ROLE}" />
|
||||
<permission type="deleteDurableQueue" roles="${AMQ_ROLE}" />
|
||||
<permission type="createAddress" roles="${AMQ_ROLE}" />
|
||||
<permission type="deleteAddress" roles="${AMQ_ROLE}" />
|
||||
<permission type="consume" roles="${AMQ_ROLE}" />
|
||||
<permission type="browse" roles="${AMQ_ROLE}" />
|
||||
<permission type="send" roles="${AMQ_ROLE}" />
|
||||
<!-- we need this otherwise ./artemis data imp wouldn't work -->
|
||||
<permission type="manage" roles="${AMQ_ROLE}" />
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
<address-settings>
|
||||
<!-- if you define auto-create on certain queues, management has to be auto-create -->
|
||||
<address-setting match="activemq.management#">
|
||||
<dead-letter-address>DLQ</dead-letter-address>
|
||||
<expiry-address>ExpiryQueue</expiry-address>
|
||||
<redelivery-delay>0</redelivery-delay>
|
||||
<!-- with -1 only the global-max-size is in use for limiting -->
|
||||
<max-size-bytes>-1</max-size-bytes>
|
||||
<message-counter-history-day-limit>10</message-counter-history-day-limit>
|
||||
<address-full-policy>PAGE</address-full-policy>
|
||||
</address-setting>
|
||||
<!--default for catch all-->
|
||||
<address-setting match="#">
|
||||
<dead-letter-address>DLQ</dead-letter-address>
|
||||
<expiry-address>ExpiryQueue</expiry-address>
|
||||
<max-delivery-attempts>{{ .Values.queues.defaults.maxDeliveryAttempts }}</max-delivery-attempts>
|
||||
<redelivery-delay>{{ .Values.queues.defaults.redeliveryDelay }}</redelivery-delay>
|
||||
<redelivery-delay-multiplier>{{ .Values.queues.defaults.redeliveryDelayMultiplier }}</redelivery-delay-multiplier>
|
||||
<max-redelivery-delay>{{ .Values.queues.defaults.maxRedeliveryDelay }}</max-redelivery-delay>
|
||||
<!-- with -1 only the global-max-size is in use for limiting -->
|
||||
<max-size-bytes>{{ .Values.queues.defaults.maxSizeBytes }}</max-size-bytes>
|
||||
<message-counter-history-day-limit>{{ .Values.queues.defaults.messageCounterHistoryDayLimit }}</message-counter-history-day-limit>
|
||||
<address-full-policy>{{ .Values.queues.defaults.addressFullPolicy }}</address-full-policy>
|
||||
{{- if .Values.parameters.amq_force_addresses_cleanup }}
|
||||
<config-delete-addresses>FORCE</config-delete-addresses>
|
||||
<config-delete-queues>FORCE</config-delete-queues>
|
||||
{{- end }}
|
||||
</address-setting>
|
||||
{{- range .Values.queues.addresses }}
|
||||
<address-setting match="{{ .name }}">
|
||||
{{- if .dlq_address }}
|
||||
<dead-letter-address>{{ .dlq_address }}</dead-letter-address>
|
||||
{{- end }}
|
||||
{{- if .expiry_address }}
|
||||
<expiry-address>{{ .expiry_address }}</expiry-address>
|
||||
{{- end }}
|
||||
<max-delivery-attempts>{{ default $.Values.queues.defaults.maxDeliveryAttempts .maxDeliveryAttempts }}</max-delivery-attempts>
|
||||
<redelivery-delay>{{ default $.Values.queues.defaults.redeliveryDelay .redeliveryDelay }}</redelivery-delay>
|
||||
<redelivery-delay-multiplier>{{ default $.Values.queues.defaults.redeliveryDelayMultiplier .redeliveryDelayMultiplier }}</redelivery-delay-multiplier>
|
||||
<max-redelivery-delay>{{ default $.Values.queues.defaults.maxRedeliveryDelay .maxRedeliveryDelay }}</max-redelivery-delay>
|
||||
<max-size-bytes>{{ default $.Values.queues.defaults.maxSizeBytes .maxSizeBytes }}</max-size-bytes>
|
||||
<message-counter-history-day-limit>{{ default $.Values.queues.defaults.messageCounterHistoryDayLimit .messageCounterHistoryDayLimit }}</message-counter-history-day-limit>
|
||||
<address-full-policy>{{ default $.Values.queues.defaults.addressFullPolicy .addressFullPolicy }}</address-full-policy>
|
||||
</address-setting>
|
||||
{{- end }}
|
||||
</address-settings>
|
||||
<addresses>
|
||||
<address name="DLQ">
|
||||
<anycast>
|
||||
<queue name="DLQ" />
|
||||
</anycast>
|
||||
</address>
|
||||
<address name="ExpiryQueue">
|
||||
<anycast>
|
||||
<queue name="ExpiryQueue" />
|
||||
</anycast>
|
||||
</address>
|
||||
{{- range .Values.queues.addresses }}
|
||||
<address name="{{ .name }}">
|
||||
{{- $isMulticast := "" }}
|
||||
{{- if ( .type ) }}{{- if eq .type "multicast" }}
|
||||
{{- $isMulticast = print "true" }}
|
||||
{{- end }}{{- end }}
|
||||
{{- if $isMulticast }}
|
||||
<multicast/>
|
||||
{{- else }}
|
||||
<anycast>
|
||||
<queue name="{{ .name }}" />
|
||||
</anycast>
|
||||
{{- end }}
|
||||
</address>
|
||||
{{- if .dlq_address }}
|
||||
<address name="{{ .dlq_address }}">
|
||||
<anycast>
|
||||
<queue name="{{ .dlq_address }}" />
|
||||
</anycast>
|
||||
</address>
|
||||
{{- end }}
|
||||
{{- if .expiry_address }}
|
||||
<address name="{{ .expiry_address }}">
|
||||
<anycast>
|
||||
<queue name="{{ .expiry_address }}" />
|
||||
</anycast>
|
||||
</address>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</addresses>
|
||||
{{- if .Values.metrics.enabled }}
|
||||
<metrics>
|
||||
<jvm-memory>{{ .Values.metrics.jvm_memory }}</jvm-memory>
|
||||
<jvm-gc>{{ .Values.metrics.jvm_gc }}</jvm-gc>
|
||||
<jvm-threads>{{ .Values.metrics.jvm_threads }}</jvm-threads>
|
||||
<plugin class-name="com.redhat.amq.broker.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"/>
|
||||
</metrics>
|
||||
{{- end }}
|
||||
{{- if .Values.clustered }}
|
||||
{{- if .Values.cluster.ha_ap_mode }}
|
||||
<connectors>
|
||||
<connector name="{{ .Values.ha_ap.connector.ref }}">tcp://${BROKER_IP}:{{ .Values.ha_ap.connector.port }}</connector>
|
||||
<connector name="{{ .Values.ha_ap.connector.static.ref }}">tcp://{{ .Values.ha_ap.connector.static.ref }}-svc:{{ .Values.ha_ap.connector.static.port }}</connector>
|
||||
</connectors>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<connector-ref>{{ .Values.ha_ap.connector.ref }}</connector-ref>
|
||||
<static-connectors>
|
||||
<connector-ref>{{ .Values.ha_ap.connector.static.ref }}</connector-ref>
|
||||
</static-connectors>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
<ha-policy>
|
||||
<shared-store>
|
||||
{{- if eq .Values.ha_ap.mode "primary" }}
|
||||
<primary>
|
||||
<failover-on-shutdown>true</failover-on-shutdown>
|
||||
</primary>
|
||||
{{- else }}
|
||||
<backup>
|
||||
<failover-on-shutdown>true</failover-on-shutdown>
|
||||
</backup>
|
||||
{{- end }}
|
||||
</shared-store>
|
||||
</ha-policy>
|
||||
{{- else }}
|
||||
<connectors>
|
||||
<connector name="{{ .Values.cluster.connector.ref }}">tcp://${BROKER_IP}:{{ .Values.cluster.connector.port }}</connector>
|
||||
</connectors>
|
||||
<discovery-groups>
|
||||
<discovery-group name="my-discovery-group">
|
||||
<jgroups-file>{{ .Values.cluster.jgroupsCfg }}</jgroups-file>
|
||||
<jgroups-channel>activemq_broadcast_channel</jgroups-channel>
|
||||
<refresh-timeout>{{ .Values.cluster.refreshTimeout }}</refresh-timeout>
|
||||
</discovery-group>
|
||||
</discovery-groups>
|
||||
<broadcast-groups>
|
||||
<broadcast-group name="my-broadcast-group">
|
||||
<jgroups-file>{{ .Values.cluster.jgroupsCfg }}</jgroups-file>
|
||||
<jgroups-channel>activemq_broadcast_channel</jgroups-channel>
|
||||
<connector-ref>{{ .Values.cluster.connector.ref }}</connector-ref>
|
||||
</broadcast-group>
|
||||
</broadcast-groups>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<connector-ref>{{ .Values.cluster.connector.ref }}</connector-ref>
|
||||
<retry-interval>1000</retry-interval>
|
||||
<retry-interval-multiplier>2</retry-interval-multiplier>
|
||||
<max-retry-interval>32000</max-retry-interval>
|
||||
<initial-connect-attempts>20</initial-connect-attempts>
|
||||
<reconnect-attempts>10</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>ON_DEMAND</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
</cluster-connections>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</core>
|
||||
</configuration>
|
34
artemis-broker/conf/jgroups-ping.xml
Normal file
34
artemis-broker/conf/jgroups-ping.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="urn:org:jgroups"
|
||||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd">
|
||||
<TCP bind_addr="${jgroups.bind_addr:site_local}"
|
||||
bind_port="${jgroups.bind_port:{{ .Values.ping_service.jgroups.bind_port }}}"
|
||||
external_addr="${jgroups.external_addr}"
|
||||
external_port="${jgroups.external_port}"
|
||||
thread_pool.min_threads="0"
|
||||
thread_pool.max_threads="200"
|
||||
thread_pool.keep_alive_time="30000"/>
|
||||
<RED/>
|
||||
|
||||
<dns.DNS_PING
|
||||
dns_query="{{ tpl .Values.ping_service.name . }}"
|
||||
dns_record_type="${DNS_RECORD_TYPE:A}"
|
||||
/>
|
||||
|
||||
<MERGE3 min_interval="10000"
|
||||
max_interval="30000" />
|
||||
<FD_SOCK2/>
|
||||
<FD_ALL3 timeout="40000" interval="5000" />
|
||||
<VERIFY_SUSPECT2 timeout="1500" />
|
||||
<pbcast.NAKACK2 use_mcast_xmit="false" />
|
||||
<UNICAST3 />
|
||||
<pbcast.STABLE desired_avg_gossip="50000"
|
||||
max_bytes="4M"/>
|
||||
<pbcast.GMS print_local_addr="true" join_timeout="2000"/>
|
||||
<UFC max_credits="2M"
|
||||
min_threshold="0.4"/>
|
||||
<MFC max_credits="2M"
|
||||
min_threshold="0.4"/>
|
||||
<FRAG2 frag_size="60K" />
|
||||
</config>
|
||||
|
23
artemis-broker/conf/login.config
Normal file
23
artemis-broker/conf/login.config
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
activemq {
|
||||
org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule requisite
|
||||
reload=true
|
||||
org.apache.activemq.jaas.properties.user="{{ .Values.security.jaasUsers.key }}"
|
||||
org.apache.activemq.jaas.properties.role="artemis-roles.properties";
|
||||
};
|
37
artemis-broker/scripts-override/configure_custom_config.sh
Executable file
37
artemis-broker/scripts-override/configure_custom_config.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
INSTANCE_DIR=$1
|
||||
|
||||
declare -a CONFIG_FILES=("bootstrap.xml" "broker.xml" "logging.properties")
|
||||
|
||||
function swapVars() {
|
||||
# Requires bash v4+
|
||||
declare -A SUBSTITUTIONS
|
||||
|
||||
while read -r SUBVAR
|
||||
do
|
||||
SUBSTITUTIONS[$SUBVAR]=1
|
||||
done < <( awk '{
|
||||
while( match($0, /\$\{[a-zA-Z_0-9][a-zA-Z_0-9]*\}/) ) {
|
||||
print substr($0, RSTART, RLENGTH)
|
||||
sub(/\$\{[a-zA-Z_0-9][a-zA-Z_0-9]*\}/, "matched", $0)
|
||||
}
|
||||
}' $1 )
|
||||
|
||||
echo "Found placeholder variables: \"${!SUBSTITUTIONS[@]}\". Customizing configuration.."
|
||||
|
||||
for var in "${!SUBSTITUTIONS[@]}"; do
|
||||
sed -i "s#$var#$(eval echo \"$var\")#g" $1
|
||||
done
|
||||
}
|
||||
|
||||
for config_file in ${CONFIG_FILES[@]};
|
||||
do
|
||||
# Swap env vars into configuration file
|
||||
if [[ -e $INSTANCE_DIR/etc/$config_file ]]; then
|
||||
echo "Patching Custom Configuration file '$config_file'"
|
||||
swapVars $INSTANCE_DIR/etc/$config_file
|
||||
fi
|
||||
done
|
||||
|
75
artemis-broker/scripts-override/drain.sh
Executable file
75
artemis-broker/scripts-override/drain.sh
Executable file
@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
|
||||
export BROKER_IP=`hostname -f`
|
||||
|
||||
instanceDir="${HOME}/${AMQ_NAME}"
|
||||
|
||||
ENDPOINT_NAME="${HEADLESS_ENDPOINT}"
|
||||
if [ "$HEADLESS_SVC_NAME" ]; then
|
||||
ENDPOINT_NAME=$HEADLESS_SVC_NAME
|
||||
fi
|
||||
|
||||
endpointsUrl="https://${KUBERNETES_SERVICE_HOST:-kubernetes.default.svc}:${KUBERNETES_SERVICE_PORT:-443}/api/v1/namespaces/${POD_NAMESPACE}/"
|
||||
endpointsAuth="Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
|
||||
|
||||
function waitForJolokia() {
|
||||
while : ;
|
||||
do
|
||||
sleep 5
|
||||
curl -s -o /dev/null -G -k http://${AMQ_USER}:${AMQ_PASSWORD}@${BROKER_IP}:8161/console/jolokia
|
||||
if [ $? -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
endpointsCode=$(curl -s -o /dev/null -w "%{http_code}" -G -k -H "${endpointsAuth}" ${endpointsUrl})
|
||||
if [ $endpointsCode -ne 200 ]; then
|
||||
echo "Can't find endpoints with ips status <${endpointsCode}>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ENDPOINTS=$(curl -s -X GET -G -k -H "${endpointsAuth}" ${endpointsUrl}"endpoints/${ENDPOINT_NAME}")
|
||||
echo $ENDPOINTS
|
||||
count=0
|
||||
while [ 1 ]; do
|
||||
ip=$(echo $ENDPOINTS | python -c "import sys, json; print json.load(sys.stdin)['subsets'][0]['addresses'][${count}]['ip']")
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Can't find ip to scale down to tried ${count} ips"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "got ip ${ip} broker ip is ${BROKER_IP}"
|
||||
if [ "$ip" != "$BROKER_IP" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
count=$(( count + 1 ))
|
||||
done
|
||||
|
||||
source /opt/amq/bin/launch.sh nostart
|
||||
|
||||
SCALE_TO_BROKER_IP=$ip
|
||||
|
||||
# Add connector to the pod to scale down to
|
||||
connector="<connector name=\"scaledownconnector\">tcp:\/\/${SCALE_TO_BROKER_IP}:61616<\/connector>"
|
||||
sed -i "/<\/connectors>/ s/.*/${connector}\n&/" ${instanceDir}/etc/broker.xml
|
||||
|
||||
# Remove the acceptors
|
||||
#sed -i -ne "/<acceptors>/ {p; " -e ":a; n; /<\/acceptors>/ {p; b}; ba}; p" ${instanceDir}/etc/broker.xml
|
||||
acceptor="<acceptor name=\"artemis\">tcp:\/\/${BROKER_IP}:61616?protocols=CORE<\/acceptor>"
|
||||
sed -i -ne "/<acceptors>/ {p; i $acceptor" -e ":a; n; /<\/acceptors>/ {p; b}; ba}; p" ${instanceDir}/etc/broker.xml
|
||||
|
||||
#start the broker and issue the scaledown command to drain the messages.
|
||||
${instanceDir}/bin/artemis-service start
|
||||
|
||||
if [ "$AMQ_DATA_DIR_LOGGING" = "true" ]; then
|
||||
tail -n 100 -f ${AMQ_DATA_DIR}/log/artemis.log &
|
||||
else
|
||||
tail -n 100 -f ${AMQ_NAME}/log/artemis.log &
|
||||
fi
|
||||
|
||||
waitForJolokia
|
||||
curl -s -o /dev/null -G -k http://${AMQ_USER}:${AMQ_PASSWORD}@${BROKER_IP}:8161/console/jolokia/exec/org.apache.activemq.artemis:broker=%22${AMQ_NAME}%22/scaleDown/scaledownconnector
|
||||
|
444
artemis-broker/scripts-override/launch.sh
Executable file
444
artemis-broker/scripts-override/launch.sh
Executable file
@ -0,0 +1,444 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "${SCRIPT_DEBUG}" = "true" ] ; then
|
||||
set -x
|
||||
echo "Script debugging is enabled, allowing bash commands and their arguments to be printed as they are executed"
|
||||
fi
|
||||
|
||||
|
||||
export BROKER_IP=`hostname -I`
|
||||
CONFIG_TEMPLATES=/config_templates
|
||||
|
||||
#GC Option conflicts with the one already configured.
|
||||
echo "Removing provided -XX:+UseParallelOldGC in favour of artemis.profile provided option"
|
||||
JAVA_OPTS=$(echo $JAVA_OPTS | sed -e "s/-XX:+UseParallelOldGC/ /")
|
||||
PLATFORM=`uname -m`
|
||||
echo "Platform is ${PLATFORM}"
|
||||
if [ "${PLATFORM}" = "s390x" ] ; then
|
||||
#GC Option found to be a problem on s390x
|
||||
echo "Removing -XX:+UseG1GC as per recommendation to use default GC"
|
||||
JAVA_OPTS=$(echo $JAVA_OPTS | sed -e "s/-XX:+UseG1GC/ /")
|
||||
#JDK11 related warnings removal
|
||||
echo "Adding -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true as per ENTMQBR-1932"
|
||||
JAVA_OPTS="-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true ${JAVA_OPTS}"
|
||||
fi
|
||||
JAVA_OPTS="-Djava.net.preferIPv4Stack=true ${JAVA_OPTS}"
|
||||
|
||||
if [ "$AMQ_ENABLE_JOLOKIA_AGENT" = "true" ]; then
|
||||
echo "Define jolokia jvm agent options"
|
||||
|
||||
if [ -z ${AMQ_JOLOKIA_AGENT_OPTS} ]; then
|
||||
if [ -f "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt" ]; then
|
||||
AMQ_JOLOKIA_AGENT_OPTS='realm=activemq,caCert=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt,clientPrincipal.1=cn=system:master-proxy,clientPrincipal.2=cn=hawtio-online.hawtio.svc,clientPrincipal.3=cn=fuse-console.fuse.svc'
|
||||
else
|
||||
AMQ_JOLOKIA_AGENT_OPTS='realm=activemq,clientPrincipal.1=cn=system:master-proxy,clientPrincipal.2=cn=hawtio-online.hawtio.svc,clientPrincipal.3=cn=fuse-console.fuse.svc'
|
||||
fi
|
||||
fi
|
||||
|
||||
export AB_JOLOKIA_USER=$AMQ_JOLOKIA_AGENT_USER
|
||||
export AB_JOLOKIA_PASSWORD_RANDOM=false
|
||||
export AB_JOLOKIA_PASSWORD=$AMQ_JOLOKIA_AGENT_PASSWORD
|
||||
export AB_JOLOKIA_OPTS="${AMQ_JOLOKIA_AGENT_OPTS}"
|
||||
JOLOKIA_OPTS="$(/opt/jolokia/jolokia-opts)"
|
||||
echo "JOLOKIA_OPTS: $JOLOKIA_OPTS"
|
||||
fi
|
||||
|
||||
function sslPartial() {
|
||||
[ -n "$AMQ_KEYSTORE_TRUSTSTORE_DIR" -o -n "$AMQ_KEYSTORE" -o -n "$AMQ_TRUSTSTORE" -o -n "$AMQ_KEYSTORE_PASSWORD" -o -n "$AMQ_TRUSTSTORE_PASSWORD" ]
|
||||
}
|
||||
|
||||
function sslEnabled() {
|
||||
[ -n "$AMQ_KEYSTORE_TRUSTSTORE_DIR" -a -n "$AMQ_KEYSTORE" -a -n "$AMQ_TRUSTSTORE" -a -n "$AMQ_KEYSTORE_PASSWORD" -a -n "$AMQ_TRUSTSTORE_PASSWORD" ]
|
||||
}
|
||||
|
||||
# Finds the environment variable and returns its value if found.
|
||||
# Otherwise returns the default value if provided.
|
||||
#
|
||||
# Arguments:
|
||||
# $1 env variable name to check
|
||||
# $2 default value if environemnt variable was not set
|
||||
function find_env() {
|
||||
var=${!1}
|
||||
echo "${var:-$2}"
|
||||
}
|
||||
|
||||
function configureUserAuthentication() {
|
||||
if [ -n "${AMQ_USER}" -a -n "${AMQ_PASSWORD}" ] ; then
|
||||
AMQ_ARGS="$AMQ_ARGS --user $AMQ_USER --password $AMQ_PASSWORD "
|
||||
else
|
||||
echo "Required variable missing: both AMQ_USER and AMQ_PASSWORD are required."
|
||||
exit 1
|
||||
fi
|
||||
if [ "$AMQ_REQUIRE_LOGIN" = "true" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --require-login"
|
||||
else
|
||||
AMQ_ARGS="$AMQ_ARGS --allow-anonymous"
|
||||
fi
|
||||
}
|
||||
|
||||
function configureLogging() {
|
||||
instanceDir=$1
|
||||
if [ "$AMQ_DATA_DIR_LOGGING" = "true" ]; then
|
||||
echo "Configuring logging directory to be ${AMQ_DATA_DIR}/log"
|
||||
sed -i 's@${artemis.instance}@'"$AMQ_DATA_DIR"'@' ${instanceDir}/etc/logging.properties
|
||||
fi
|
||||
}
|
||||
|
||||
function configureNetworking() {
|
||||
if [ "$AMQ_CLUSTERED" = "true" ]; then
|
||||
echo "Broker will be clustered"
|
||||
AMQ_ARGS="$AMQ_ARGS --clustered --cluster-user $AMQ_CLUSTER_USER --cluster-password $AMQ_CLUSTER_PASSWORD --host $BROKER_IP"
|
||||
ACCEPTOR_IP=$BROKER_IP
|
||||
else
|
||||
AMQ_ARGS="$AMQ_ARGS --host 0.0.0.0"
|
||||
ACCEPTOR_IP="0.0.0.0"
|
||||
fi
|
||||
}
|
||||
|
||||
function configureRedistributionDelay() {
|
||||
instanceDir=$1
|
||||
echo "Setting redistribution-delay to zero."
|
||||
sed -i "s/<address-setting match=\"#\">/&\n <redistribution-delay>0<\/redistribution-delay>/g" ${instanceDir}/etc/broker.xml
|
||||
}
|
||||
|
||||
function configureSSL() {
|
||||
sslDir=$(find_env "AMQ_KEYSTORE_TRUSTSTORE_DIR" "")
|
||||
keyStoreFile=$(find_env "AMQ_KEYSTORE" "")
|
||||
trustStoreFile=$(find_env "AMQ_TRUSTSTORE" "")
|
||||
|
||||
if sslEnabled ; then
|
||||
keyStorePassword=$(find_env "AMQ_KEYSTORE_PASSWORD" "")
|
||||
trustStorePassword=$(find_env "AMQ_TRUSTSTORE_PASSWORD" "")
|
||||
|
||||
keyStorePath="$sslDir/$keyStoreFile"
|
||||
trustStorePath="$sslDir/$trustStoreFile"
|
||||
|
||||
AMQ_ARGS="$AMQ_ARGS --ssl-key $keyStorePath"
|
||||
AMQ_ARGS="$AMQ_ARGS --ssl-key-password $keyStorePassword"
|
||||
|
||||
AMQ_ARGS="$AMQ_ARGS --ssl-trust $trustStorePath"
|
||||
AMQ_ARGS="$AMQ_ARGS --ssl-trust-password $trustStorePassword"
|
||||
elif sslPartial ; then
|
||||
log_warning "Partial ssl configuration, the ssl context WILL NOT be configured."
|
||||
fi
|
||||
}
|
||||
|
||||
function updateAcceptorsForSSL() {
|
||||
instanceDir=$1
|
||||
|
||||
if sslEnabled ; then
|
||||
|
||||
echo "keystore filepath: $keyStorePath"
|
||||
|
||||
IFS=',' read -a protocols <<< $(find_env "AMQ_TRANSPORTS" "openwire,amqp,stomp,mqtt,hornetq")
|
||||
connectionsAllowed=$(find_env "AMQ_MAX_CONNECTIONS" "1000")
|
||||
|
||||
sslProvider=$(find_env "AMQ_SSL_PROVIDER" "")
|
||||
|
||||
if [ -z "${sslProvider}" ] ; then
|
||||
SSL_OPS="sslEnabled=true;keyStorePath=${keyStorePath};keyStorePassword=${keyStorePassword}"
|
||||
else
|
||||
SSL_OPS="sslEnabled=true;keyStorePath=${keyStorePath};keyStorePassword=${keyStorePassword};sslProvider=${sslProvider}"
|
||||
fi
|
||||
|
||||
if [ "${#protocols[@]}" -ne "0" ]; then
|
||||
acceptors=""
|
||||
for protocol in ${protocols[@]}; do
|
||||
case "${protocol}" in
|
||||
"openwire")
|
||||
acceptors="${acceptors} <acceptor name=\"artemis-ssl\">tcp://${ACCEPTOR_IP}:61617?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;connectionsAllowed=${connectionsAllowed};${SSL_OPS}</acceptor>\n"
|
||||
;;
|
||||
"mqtt")
|
||||
acceptors="${acceptors} <acceptor name=\"mqtt-ssl\">tcp://${ACCEPTOR_IP}:8883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true;connectionsAllowed=${connectionsAllowed};${SSL_OPS}</acceptor>\n"
|
||||
;;
|
||||
"amqp")
|
||||
acceptors="${acceptors} <acceptor name=\"amqp-ssl\">tcp://${ACCEPTOR_IP}:5671?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300;connectionsAllowed=${connectionsAllowed};${SSL_OPS}</acceptor>\n"
|
||||
;;
|
||||
"stomp")
|
||||
acceptors="${acceptors} <acceptor name=\"stomp-ssl\">tcp://${ACCEPTOR_IP}:61612?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true;connectionsAllowed=${connectionsAllowed};${SSL_OPS}</acceptor>\n"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
safeAcceptors=$(echo "${acceptors}" | sed 's/\//\\\//g')
|
||||
sed -i "/<\/acceptors>/ s/.*/${safeAcceptors}\n&/" ${instanceDir}/etc/broker.xml
|
||||
fi
|
||||
}
|
||||
|
||||
function updateAcceptorsForPrefixing() {
|
||||
instanceDir=$1
|
||||
|
||||
if [ -n "$AMQ_MULTICAST_PREFIX" ]; then
|
||||
echo "Setting multicastPrefix to ${AMQ_MULTICAST_PREFIX}"
|
||||
sed -i "s/:61616?/&multicastPrefix=${AMQ_MULTICAST_PREFIX};/g" ${instanceDir}/etc/broker.xml
|
||||
sed -i "s/:61617?/&multicastPrefix=${AMQ_MULTICAST_PREFIX};/g" ${instanceDir}/etc/broker.xml
|
||||
fi
|
||||
|
||||
if [ -n "$AMQ_ANYCAST_PREFIX" ]; then
|
||||
echo "Setting anycastPrefix to ${AMQ_ANYCAST_PREFIX}"
|
||||
sed -i "s/:61616?/&anycastPrefix=${AMQ_ANYCAST_PREFIX};/g" ${instanceDir}/etc/broker.xml
|
||||
sed -i "s/:61617?/&anycastPrefix=${AMQ_ANYCAST_PREFIX};/g" ${instanceDir}/etc/broker.xml
|
||||
fi
|
||||
}
|
||||
|
||||
function appendAcceptorsFromEnv() {
|
||||
instanceDir=$1
|
||||
|
||||
if [ -n "$AMQ_ACCEPTORS" ]; then
|
||||
echo "Using acceptors from environment and removing existing entries"
|
||||
sed -i "/acceptor name=/d" ${instanceDir}/etc/broker.xml
|
||||
acceptorsFromEnv=$(find_env "AMQ_ACCEPTORS" "")
|
||||
# As AMQ_ACCEPTORS was introduced from the operator, the operator makes a safe string for here
|
||||
safeAcceptorsFromEnv=$(echo "${acceptorsFromEnv}")
|
||||
sed -i "/<\/acceptors>/ s/.*/${safeAcceptorsFromEnv}\n&/g" ${instanceDir}/etc/broker.xml
|
||||
sed -i "s/ACCEPTOR_IP/${ACCEPTOR_IP}/g" ${instanceDir}/etc/broker.xml
|
||||
fi
|
||||
}
|
||||
|
||||
function appendConnectorsFromEnv() {
|
||||
instanceDir=$1
|
||||
|
||||
if [ -n "$AMQ_CONNECTORS" ]; then
|
||||
echo "Appending connectors from environment"
|
||||
connectorsFromEnv=$(find_env "AMQ_CONNECTORS" "")
|
||||
# As AMQ_CONNECTORS was introduced from the operator, the operator makes a safe string for here
|
||||
safeConnectorsFromEnv=$(echo "${connectorsFromEnv}")
|
||||
endConnectorsCount=`grep -c '</connectors>' ${instanceDir}/etc/broker.xml`
|
||||
if [ ${endConnectorsCount} -ne 0 ]; then
|
||||
sed -i "/<\/connectors>/ s/.*/\t\t${safeConnectorsFromEnv}\n&/" ${instanceDir}/etc/broker.xml
|
||||
else
|
||||
sed -i "/<\/acceptors>/ s/.*/&\n\t<connectors>\n\t\t${safeConnectorsFromEnv}\n\t<\/connectors>\n/" ${instanceDir}/etc/broker.xml
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function appendJournalType() {
|
||||
instanceDir=$1
|
||||
|
||||
if [ -n "$AMQ_JOURNAL_TYPE" ]; then
|
||||
echo "Setting journal type to ${AMQ_JOURNAL_TYPE}"
|
||||
if [[ $(removeWhiteSpace ${AMQ_JOURNAL_TYPE}) != *"nio"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --aio"
|
||||
fi
|
||||
if [[ $(removeWhiteSpace ${AMQ_JOURNAL_TYPE}) != *"aio"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --nio"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function modifyDiscovery() {
|
||||
discoverygroup=""
|
||||
discoverygroup="${discoverygroup} <discovery-group name=\"my-discovery-group\">"
|
||||
discoverygroup="${discoverygroup} <jgroups-file>jgroups-ping.xml</jgroups-file>"
|
||||
discoverygroup="${discoverygroup} <jgroups-channel>activemq_broadcast_channel</jgroups-channel>"
|
||||
discoverygroup="${discoverygroup} <refresh-timeout>10000</refresh-timeout>"
|
||||
discoverygroup="${discoverygroup} </discovery-group> "
|
||||
sed -i -ne "/<discovery-groups>/ {p; i $discoverygroup" -e ":a; n; /<\/discovery-groups>/ {p; b}; ba}; p" ${instanceDir}/etc/broker.xml
|
||||
|
||||
#generate jgroups-ping.xml
|
||||
echo "Generating jgroups-ping.xml, current dir is: $PWD, AMQHOME: $AMQ_HOME"
|
||||
|
||||
if [ -z "${PING_SVC_NAME+x}" ]; then
|
||||
echo "PING_SERVICE is not set"
|
||||
PING_SVC_NAME=ping
|
||||
fi
|
||||
|
||||
if [ -z "${APPLICATION_NAME+x}" ]; then
|
||||
echo "APPLICATION_NAME is not set"
|
||||
sed -i -e "s/\${APPLICATION_NAME}-\${PING_SVC_NAME}/${PING_SVC_NAME}/" $AMQ_HOME/conf/jgroups-ping.xml
|
||||
else
|
||||
echo "APPLICATION_NAME is set"
|
||||
sed -i -e "s/\${APPLICATION_NAME}-\${PING_SVC_NAME}/${APPLICATION_NAME}-${PING_SVC_NAME}/" $AMQ_HOME/conf/jgroups-ping.xml
|
||||
fi
|
||||
|
||||
broadcastgroup=""
|
||||
broadcastgroup="${broadcastgroup} <broadcast-group name=\"my-broadcast-group\">"
|
||||
broadcastgroup="${broadcastgroup} <jgroups-file>jgroups-ping.xml</jgroups-file>"
|
||||
broadcastgroup="${broadcastgroup} <jgroups-channel>activemq_broadcast_channel</jgroups-channel>"
|
||||
broadcastgroup="${broadcastgroup} <connector-ref>artemis</connector-ref>"
|
||||
broadcastgroup="${broadcastgroup} </broadcast-group> "
|
||||
sed -i -ne "/<broadcast-groups>/ {p; i $broadcastgroup" -e ":a; n; /<\/broadcast-groups>/ {p; b}; ba}; p" ${instanceDir}/etc/broker.xml
|
||||
|
||||
clusterconnections=""
|
||||
clusterconnections="${clusterconnections} <cluster-connection name=\"my-cluster\">"
|
||||
clusterconnections="${clusterconnections} <connector-ref>artemis</connector-ref>"
|
||||
clusterconnections="${clusterconnections} <retry-interval>1000</retry-interval>"
|
||||
clusterconnections="${clusterconnections} <retry-interval-multiplier>2</retry-interval-multiplier>"
|
||||
clusterconnections="${clusterconnections} <max-retry-interval>32000</max-retry-interval>"
|
||||
clusterconnections="${clusterconnections} <initial-connect-attempts>20</initial-connect-attempts>"
|
||||
clusterconnections="${clusterconnections} <reconnect-attempts>10</reconnect-attempts>"
|
||||
clusterconnections="${clusterconnections} <use-duplicate-detection>true</use-duplicate-detection>"
|
||||
clusterconnections="${clusterconnections} <message-load-balancing>ON_DEMAND</message-load-balancing>"
|
||||
clusterconnections="${clusterconnections} <max-hops>1</max-hops>"
|
||||
clusterconnections="${clusterconnections} <discovery-group-ref discovery-group-name=\"my-discovery-group\"/>"
|
||||
clusterconnections="${clusterconnections} </cluster-connection> "
|
||||
sed -i -ne "/<cluster-connections>/ {p; i $clusterconnections" -e ":a; n; /<\/cluster-connections>/ {p; b}; ba}; p" ${instanceDir}/etc/broker.xml
|
||||
}
|
||||
|
||||
function configureJAVA_ARGSMemory() {
|
||||
instanceDir=$1
|
||||
echo "Removing hardcoded -Xms -Xmx from artemis.profile in favour of JAVA_OPTS in log above"
|
||||
sed -i "s/\-Xms[0-9]*[mMgG] \-Xmx[0-9]*[mMgG] \-Dhawtio/\ -Dhawtio/g" ${instanceDir}/etc/artemis.profile
|
||||
}
|
||||
|
||||
function configureJolokiaJVMAgent() {
|
||||
instanceDir=$1
|
||||
if [ "$AMQ_ENABLE_JOLOKIA_AGENT" = "true" ]; then
|
||||
echo "Configure jolokia jvm agent"
|
||||
echo "JOLOKIA_OPTS: $JOLOKIA_OPTS"
|
||||
echo '' >> ${instanceDir}/etc/artemis.profile
|
||||
echo "if [ \"\$1\" = \"run\" ]; then JAVA_ARGS=\"\$JAVA_ARGS $JOLOKIA_OPTS\"; fi" >> ${instanceDir}/etc/artemis.profile
|
||||
echo '' >> ${instanceDir}/etc/artemis.profile
|
||||
fi
|
||||
}
|
||||
|
||||
function injectMetricsPlugin() {
|
||||
instanceDir=$1
|
||||
echo "Adding artemis metrics plugin"
|
||||
sed -i "s/^\([[:blank:]]*\)<\\/core>/\1\1<metrics-plugin class-name=\"org.apache.activemq.artemis.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin\"\\/>\\n\1<\\/core>/" $instanceDir/etc/broker.xml
|
||||
|
||||
if ! grep -q 'metrics' $instanceDir/etc/bootstrap.xml; then
|
||||
sed -i 's~</binding>~<app url="metrics" war="metrics.war"/></binding>~' $instanceDir/etc/bootstrap.xml
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function checkBeforeRun() {
|
||||
instanceDir=$1
|
||||
if [ "$AMQ_ENABLE_METRICS_PLUGIN" = "true" ]; then
|
||||
pluginStr="com.redhat.amq.broker.core.server.metrics.plugins.ArtemisPrometheusMetricsPlugin"
|
||||
grep -q "$pluginStr" ${instanceDir}/etc/broker.xml
|
||||
result=$?
|
||||
if [[ $result == 0 ]]; then
|
||||
echo "The Prometheus plugin already configured."
|
||||
else
|
||||
echo "Need to inject Prometheus plugin"
|
||||
injectMetricsPlugin ${instanceDir}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${JAVA_ARGS_APPEND}" == *"-Dlog4j2.configurationFile"* ]]; then
|
||||
echo "There is a custom logger configuration defined in JAVA_ARGS_APPEND: ${JAVA_ARGS_APPEND}"
|
||||
else
|
||||
echo "Using default logging configuration(console only)"
|
||||
defaultLoggingConfigFile=${instanceDir}/etc/log4j2.properties
|
||||
sed -i "s/rootLogger = INFO, console, log_file/rootLogger = INFO, console/g" $defaultLoggingConfigFile
|
||||
fi
|
||||
}
|
||||
|
||||
function configure() {
|
||||
instanceDir=$1
|
||||
|
||||
export CONTAINER_ID=$HOSTNAME
|
||||
if [ ! -d ${instanceDir} -o "$AMQ_RESET_CONFIG" = "true" -o ! -f ${instanceDir}/bin/artemis ]; then
|
||||
AMQ_ARGS="--silent --role $AMQ_ROLE --name $AMQ_NAME --http-host $BROKER_IP --java-options=-Djava.net.preferIPv4Stack=true "
|
||||
configureUserAuthentication
|
||||
if [ -n "$AMQ_DATA_DIR" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --data ${AMQ_DATA_DIR}"
|
||||
fi
|
||||
if [ -n "$AMQ_QUEUES" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --queues $(removeWhiteSpace $AMQ_QUEUES)"
|
||||
fi
|
||||
if [ -n "$AMQ_ADDRESSES" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --addresses $(removeWhiteSpace $AMQ_ADDRESSES)"
|
||||
fi
|
||||
if [ -n "$AMQ_ACCEPTORS" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --no-amqp-acceptor --no-hornetq-acceptor --no-mqtt-acceptor --no-stomp-acceptor"
|
||||
else
|
||||
if [ -n "$AMQ_TRANSPORTS" ]; then
|
||||
if [[ $(removeWhiteSpace ${AMQ_TRANSPORTS}) != *"hornetq"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --no-hornetq-acceptor"
|
||||
fi
|
||||
if [[ $(removeWhiteSpace ${AMQ_TRANSPORTS}) != *"amqp"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --no-amqp-acceptor"
|
||||
fi
|
||||
if [[ $(removeWhiteSpace ${AMQ_TRANSPORTS}) != *"mqtt"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --no-mqtt-acceptor"
|
||||
fi
|
||||
if [[ $(removeWhiteSpace ${AMQ_TRANSPORTS}) != *"stomp"* ]]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --no-stomp-acceptor"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "$GLOBAL_MAX_SIZE" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --global-max-size $(removeWhiteSpace $GLOBAL_MAX_SIZE)"
|
||||
fi
|
||||
if [ "$AMQ_RESET_CONFIG" = "true" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS --force"
|
||||
fi
|
||||
if [ "$AMQ_EXTRA_ARGS" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS $AMQ_EXTRA_ARGS"
|
||||
fi
|
||||
configureNetworking
|
||||
configureSSL
|
||||
appendJournalType ${instanceDir}
|
||||
|
||||
# mask sensitive values
|
||||
PRINT_ARGS="${AMQ_ARGS/--password $AMQ_PASSWORD/--password XXXXX}"
|
||||
PRINT_ARGS="${PRINT_ARGS/--user $AMQ_USER/--user XXXXX}"
|
||||
PRINT_ARGS="${PRINT_ARGS/--cluster-user $AMQ_CLUSTER_USER/--cluster-user XXXXX}"
|
||||
PRINT_ARGS="${PRINT_ARGS/--cluster-password $AMQ_CLUSTER_PASSWORD/--cluster-password XXXXX}"
|
||||
PRINT_ARGS="${PRINT_ARGS/--ssl-key-password $AMQ_KEYSTORE_PASSWORD/--ssl-key-password XXXXX}"
|
||||
PRINT_ARGS="${PRINT_ARGS/--ssl-trust-password $AMQ_TRUSTSTORE_PASSWORD/--ssl-trust-password XXXXX}"
|
||||
|
||||
if [ "$AMQ_CONSOLE_ARGS" ]; then
|
||||
AMQ_ARGS="$AMQ_ARGS $AMQ_CONSOLE_ARGS"
|
||||
keypat='(.*)(--ssl-key-password).([[:alnum:]]*)(.*)'
|
||||
[[ "$AMQ_CONSOLE_ARGS" =~ $keypat ]]
|
||||
CONSOLE_ARGS_NO_KEYPASS="${BASH_REMATCH[1]} ${BASH_REMATCH[2]} XXXXX ${BASH_REMATCH[4]}"
|
||||
trustpat='(.*)(--ssl-trust-password).([[:alnum:]]*)(.*)'
|
||||
[[ "$CONSOLE_ARGS_NO_KEYPASS" =~ $trustpat ]]
|
||||
CONSOLE_ARGS_NO_TRUSTPASS="${BASH_REMATCH[1]} ${BASH_REMATCH[2]} XXXXX ${BASH_REMATCH[4]}"
|
||||
PRINT_ARGS="${PRINT_ARGS} ${CONSOLE_ARGS_NO_TRUSTPASS}"
|
||||
fi
|
||||
|
||||
|
||||
echo "Creating Broker with args $PRINT_ARGS"
|
||||
$AMQ_HOME/bin/artemis create ${instanceDir} $AMQ_ARGS --java-options "$JAVA_OPTS"
|
||||
|
||||
if [ "$AMQ_CLUSTERED" = "true" ]; then
|
||||
modifyDiscovery
|
||||
configureRedistributionDelay ${instanceDir}
|
||||
fi
|
||||
$AMQ_HOME/bin/configure_jolokia_access.sh ${instanceDir}/etc/jolokia-access.xml
|
||||
if [ "$AMQ_KEYSTORE_TRUSTSTORE_DIR" ]; then
|
||||
echo "Updating acceptors for SSL"
|
||||
updateAcceptorsForSSL ${instanceDir}
|
||||
fi
|
||||
updateAcceptorsForPrefixing ${instanceDir}
|
||||
appendAcceptorsFromEnv ${instanceDir}
|
||||
appendConnectorsFromEnv ${instanceDir}
|
||||
configureLogging ${instanceDir}
|
||||
configureJAVA_ARGSMemory ${instanceDir}
|
||||
configureJolokiaJVMAgent ${instanceDir}
|
||||
|
||||
if [ "$AMQ_ENABLE_METRICS_PLUGIN" = "true" ]; then
|
||||
echo "Enable artemis metrics plugin"
|
||||
injectMetricsPlugin ${instanceDir}
|
||||
fi
|
||||
|
||||
$AMQ_HOME/bin/configure_s2i_files.sh ${instanceDir}
|
||||
$AMQ_HOME/bin/configure_custom_config.sh ${instanceDir}
|
||||
fi
|
||||
}
|
||||
|
||||
function removeWhiteSpace() {
|
||||
echo $*|tr -s ''| tr -d [[:space:]]
|
||||
}
|
||||
|
||||
function runServer() {
|
||||
|
||||
echo "Configuring Broker"
|
||||
instanceDir="${HOME}/${AMQ_NAME}"
|
||||
|
||||
configure $instanceDir
|
||||
|
||||
if [ "$1" != "nostart" ]; then
|
||||
echo "Running Broker in ${instanceDir}"
|
||||
checkBeforeRun ${instanceDir}
|
||||
exec ${instanceDir}/bin/artemis run
|
||||
fi
|
||||
}
|
||||
|
||||
runServer $1
|
||||
|
132
artemis-broker/templates/_drain.tpl
Normal file
132
artemis-broker/templates/_drain.tpl
Normal file
@ -0,0 +1,132 @@
|
||||
{{- define "drainer.pod" -}}
|
||||
alpha.image.policy.openshift.io/resolve-names: "*"
|
||||
statefulsets.kubernetes.io/drainer-pod-template: |
|
||||
{
|
||||
"metadata": {
|
||||
"labels": {
|
||||
"app": "{{ .Values.application.name }}-amq-drainer"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"serviceAccount": "{{ tpl .Values.templates.service_account .}}",
|
||||
"serviceAccountName": "{{ tpl .Values.templates.service_account .}}",
|
||||
"terminationGracePeriodSeconds": 5,
|
||||
"containers": [
|
||||
{
|
||||
"env": [
|
||||
{
|
||||
"name": "APPLICATION_NAME",
|
||||
"value": "{{ .Values.application.name }}"
|
||||
},
|
||||
{
|
||||
"name": "HEADLESS_ENDPOINT",
|
||||
"value": "{{ tpl .Values.templates.service . }}"
|
||||
},
|
||||
{
|
||||
"name": "PING_SVC_NAME",
|
||||
"value": "{{ tpl .Values.ping_service.name . }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_EXTRA_ARGS",
|
||||
"value": "--no-autotune"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_USER",
|
||||
"valueFrom": {
|
||||
"secretKeyRef": {
|
||||
"name": "{{ tpl .Values.templates.app_secret . }}",
|
||||
"key": "AMQ_USER"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "AMQ_PASSWORD",
|
||||
"valueFrom": {
|
||||
"secretKeyRef": {
|
||||
"name": "{{ tpl .Values.templates.app_secret . }}",
|
||||
"key": "AMQ_PASSWORD"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "AMQ_ROLE",
|
||||
"value": "{{ .Values.admin.role }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_NAME",
|
||||
"value": "{{ .Values.parameters.amq_broker_name }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_TRANSPORTS",
|
||||
"value": "{{ .Values.parameters.amq_protocols }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_GLOBAL_MAX_SIZE",
|
||||
"value": "{{ .Values.parameters.amq_global_max_size }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_ALLOW_ANONYMOUS",
|
||||
"value": "{{ .Values.parameters.allow_anonymous }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_DATA_DIR",
|
||||
"value": "{{ .Values.parameters.amq_data_dir }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_DATA_DIR_LOGGING",
|
||||
"value": "{{ .Values.parameters.amq_data_dir_logging }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_CLUSTERED",
|
||||
"value": "{{ .Values.parameters.amq_clustered }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_REPLICAS",
|
||||
"value": "{{ .Values.application.replicas }}"
|
||||
},
|
||||
{
|
||||
"name": "AMQ_CLUSTER_USER",
|
||||
"valueFrom": {
|
||||
"secretKeyRef": {
|
||||
"name": "{{ tpl .Values.templates.app_secret .}}",
|
||||
"key": "AMQ_CLUSTER_USER"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "AMQ_CLUSTER_PASSWORD",
|
||||
"valueFrom": {
|
||||
"secretKeyRef": {
|
||||
"name": "{{ tpl .Values.templates.app_secret .}}",
|
||||
"key": "AMQ_CLUSTER_PASSWORD"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "POD_NAMESPACE",
|
||||
"valueFrom": {
|
||||
"fieldRef": {
|
||||
"fieldPath": "metadata.namespace"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
|
||||
"value": "{{ .Values.ping_service.jgroups.bind_port }}"
|
||||
}
|
||||
],
|
||||
"image": "{{ tpl .Values.templates.broker_image .}}",
|
||||
"name": "{{ .Values.application.name }}-amq-drainer-pod",
|
||||
|
||||
"command": ["/bin/sh", "-c", "echo \"Starting the drainer\" ; /opt/amq/bin/drain.sh; echo \"Drain completed! Exit code $?\""],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "{{ tpl .Values.templates.pvc_name . }}",
|
||||
"mountPath": "{{ .Values.parameters.amq_data_dir }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{{- end -}}
|
179
artemis-broker/templates/_pod.tpl
Normal file
179
artemis-broker/templates/_pod.tpl
Normal file
@ -0,0 +1,179 @@
|
||||
{{- define "amq.pod" -}}
|
||||
{{- if eq .Values.platform "kubernetes" -}}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.application.pullSecretName }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- env:
|
||||
{{- if .Values.clustered }}
|
||||
- name: APPLICATION_NAME
|
||||
value: "{{ .Values.application.name }}"
|
||||
- name: PING_SVC_NAME
|
||||
value: "{{ tpl .Values.ping_service.name . }}"
|
||||
- name: AMQ_CLUSTERED
|
||||
value: "{{ .Values.clustered }}"
|
||||
- name: AMQ_REPLICAS
|
||||
value: "{{ .Values.application.replicas }}"
|
||||
- name: AMQ_CLUSTER_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_secret . }}
|
||||
key: AMQ_CLUSTER_USER
|
||||
- name: AMQ_CLUSTER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_secret . }}
|
||||
key: AMQ_CLUSTER_PASSWORD
|
||||
- name: OPENSHIFT_DNS_PING_SERVICE_PORT
|
||||
value: "{{ .Values.ping_service.jgroups.bind_port }}"
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
{{- end }}
|
||||
- name: AMQ_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_secret . }}
|
||||
key: AMQ_USER
|
||||
- name: AMQ_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_secret . }}
|
||||
key: AMQ_PASSWORD
|
||||
- name: AMQ_ROLE
|
||||
value: "{{ .Values.admin.role }}"
|
||||
- name: AMQ_NAME
|
||||
value: "{{ .Values.parameters.amq_broker_name }}"
|
||||
- name: AMQ_TRANSPORTS
|
||||
value: "{{ .Values.parameters.amq_protocols }}"
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
- name: AB_JOLOKIA_HTTPS
|
||||
value: "{{ .Values.parameters.jolokia_passthrough }}"
|
||||
- name: AMQ_KEYSTORE_TRUSTSTORE_DIR
|
||||
value: {{ .Values.tls.secret_mount_path }}
|
||||
- name: AMQ_TRUSTSTORE
|
||||
value: {{ .Values.tls.truststore }}
|
||||
- name: AMQ_TRUSTSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_certificates . }}
|
||||
key: AMQ_TRUSTSTORE_PASSWORD
|
||||
- name: AMQ_KEYSTORE
|
||||
value: {{ .Values.tls.keystore }}
|
||||
- name: AMQ_KEYSTORE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ tpl .Values.templates.app_certificates . }}
|
||||
key: AMQ_KEYSTORE_PASSWORD
|
||||
- name: AMQ_SSL_PROVIDER
|
||||
value: {{ tpl .Values.parameters.ssl_provider . }}
|
||||
{{- end }}
|
||||
- name: AMQ_GLOBAL_MAX_SIZE
|
||||
value: "{{ .Values.parameters.amq_global_max_size }}"
|
||||
- name: AMQ_REQUIRE_LOGIN
|
||||
value: "{{ .Values.parameters.amq_require_login }}"
|
||||
{{- if .Values.application.persistent }}
|
||||
- name: AMQ_DATA_DIR
|
||||
value: "{{ .Values.parameters.amq_data_dir }}"
|
||||
{{- end }}
|
||||
- name: AMQ_EXTRA_ARGS
|
||||
value: {{ if .Values.parameters.amq_extra_args }} "{{ .Values.parameters.amq_extra_args }}" {{ else }} "" {{ end }}
|
||||
- name: AMQ_ANYCAST_PREFIX
|
||||
value: {{ if .Values.parameters.amq_anycast_prefix }} "{{ .Values.parameters.amq_anycast_prefix }}" {{ else }} "jms.queue." {{ end }}
|
||||
- name: AMQ_MULTICAST_PREFIX
|
||||
value: {{ if .Values.parameters.amq_multicast_prefix }} "{{ .Values.parameters.amq_multicast_prefix }}" {{ else }} "jms.topic." {{ end }}
|
||||
- name: AMQ_ENABLE_METRICS_PLUGIN
|
||||
value: {{ .Values.metrics.enabled | quote }}
|
||||
- name: AMQ_JOURNAL_TYPE
|
||||
value: "{{ .Values.parameters.amq_journal_type }}"
|
||||
image: {{ tpl .Values.templates.broker_image . }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.application.pullPolicy }}
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- "/bin/bash"
|
||||
- "-c"
|
||||
- "/opt/amq/bin/readinessProbe.sh"
|
||||
name: {{ tpl .Values.templates.deployment . }}
|
||||
ports:
|
||||
{{- range .Values.service.acceptors }}
|
||||
- containerPort: {{ .port }}
|
||||
name: {{ .name }}
|
||||
protocol: {{ .protocol }}
|
||||
{{- end }}
|
||||
{{- range .Values.service.console }}
|
||||
- containerPort: {{ .port }}
|
||||
name: {{ .name }}
|
||||
protocol: {{ .protocol }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.application.persistent }}
|
||||
- name: {{ tpl .Values.templates.pvc_name . }}
|
||||
mountPath: {{ .Values.parameters.amq_data_dir }}
|
||||
{{- end }}
|
||||
- name: broker-config-script-custom
|
||||
mountPath: /opt/amq/bin/configure_custom_config.sh
|
||||
subPath: configure_custom_config.sh
|
||||
readOnly: true
|
||||
- name: broker-config-script-custom
|
||||
mountPath: /opt/amq/bin/launch.sh
|
||||
subPath: launch.sh
|
||||
readOnly: true
|
||||
{{- if .Values.clustered }}
|
||||
- name: broker-config-script-custom
|
||||
mountPath: /opt/amq/bin/drain.sh
|
||||
subPath: drain.sh
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
- name: broker-config-volume
|
||||
mountPath: "/opt/amq/conf"
|
||||
readOnly: true
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
- mountPath: {{ .Values.tls.secret_mount_path }}
|
||||
name: broker-secret-volume
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: 60
|
||||
volumes:
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
- name: broker-secret-volume
|
||||
secret:
|
||||
secretName: {{ tpl .Values.templates.app_certificates . }}
|
||||
{{- end }}
|
||||
- name: broker-config-script-custom
|
||||
configMap:
|
||||
name: {{ tpl .Values.templates.override_cm . }}
|
||||
items:
|
||||
- key: configure_custom_config.sh
|
||||
path: configure_custom_config.sh
|
||||
- key: launch.sh
|
||||
path: launch.sh
|
||||
{{- if .Values.clustered }}
|
||||
- key: drain.sh
|
||||
path: drain.sh
|
||||
{{- end }}
|
||||
defaultMode: 0550
|
||||
- name: broker-config-volume
|
||||
projected:
|
||||
sources:
|
||||
- configMap:
|
||||
name: {{ tpl .Values.templates.config_cm . }}
|
||||
{{- range .Values.security.secrets }}
|
||||
- secret:
|
||||
name: {{ . }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.kind "Deployment") (.Values.application.persistent) }}
|
||||
- name: {{ tpl .Values.templates.pvc_name . }}
|
||||
persistentVolumeClaim:
|
||||
{{- if eq .Values.ha_ap.mode "primary" }}
|
||||
claimName: {{ tpl .Values.templates.pvc_name . }}
|
||||
{{- else }}
|
||||
claimName: {{ .Values.ha_ap.connector.static.ref }}-persistent-volume
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
14
artemis-broker/templates/configmap.yaml
Normal file
14
artemis-broker/templates/configmap.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.override_cm . }}
|
||||
data:
|
||||
{{- (.Files.Glob "scripts-override/**.sh").AsConfig | nindent 2 }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.config_cm . }}
|
||||
data:
|
||||
{{ tpl (.Files.Glob "conf/**").AsConfig . | nindent 2 }}
|
35
artemis-broker/templates/deployment.yaml
Normal file
35
artemis-broker/templates/deployment.yaml
Normal file
@ -0,0 +1,35 @@
|
||||
{{- if eq .Values.kind "Deployment" }}
|
||||
{{- if and .Values.clustered (not .Values.cluster.ha_ap_mode) }}
|
||||
{{- fail ".Values.kind is set to Deployment but this is unsupported in a clustered environment. Use a StatefulSet" }}
|
||||
{{- else }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
application: {{ .Values.application.name }}
|
||||
name: {{ tpl .Values.templates.deployment . }}
|
||||
{{- if .Values.clustered }}
|
||||
annotations:
|
||||
{{- include "drainer.pod" . | nindent 6 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
application: {{ .Values.application.name }}
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
# trigger deployments on config map changes
|
||||
annotations:
|
||||
configmap/checksum: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
labels:
|
||||
application: {{ .Values.application.name }}
|
||||
deployment: {{ tpl .Values.templates.deployment . }}
|
||||
name: {{ tpl .Values.templates.deployment . }}
|
||||
spec:
|
||||
{{- include "amq.pod" . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
64
artemis-broker/templates/ingress.yaml
Normal file
64
artemis-broker/templates/ingress.yaml
Normal file
@ -0,0 +1,64 @@
|
||||
{{- if eq .Values.platform "kubernetes" }}
|
||||
{{- $route_name := tpl .Values.templates.route . }}
|
||||
{{- $svc_name := tpl .Values.templates.service . }}
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
{{- if not .Values.clustered }}
|
||||
{{- if .Values.ingress.passthrough.enabled }}
|
||||
{{- range .Values.service.acceptors }}
|
||||
{{- $nm := toString .name }}
|
||||
{{- if eq $nm $.Values.ingress.passthrough.service }}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: "{{ $route_name }}-passthrough"
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
spec:
|
||||
ingressClassName: {{ $.Values.ingress.className }}
|
||||
rules:
|
||||
- host: "{{ $route_name }}-passthrough.{{ $.Values.ingress.domain }}"
|
||||
http:
|
||||
paths:
|
||||
- path: "{{ $.Values.ingress.passthrough.path }}"
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $svc_name }}
|
||||
port:
|
||||
number: {{ .port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.console.enabled }}
|
||||
{{- range .Values.service.console }}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: "{{ $route_name }}-console"
|
||||
spec:
|
||||
{{- if $.Values.ingress.console.tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
- "{{ $route_name }}-console.{{ $.Values.ingress.domain }}"
|
||||
secretName: {{ $.Values.ingress.console.tlsSecretName }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: "{{ $route_name }}-console.{{ $.Values.ingress.domain }}"
|
||||
http:
|
||||
paths:
|
||||
- path: "{{ $.Values.ingress.console.path }}"
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $svc_name }}
|
||||
port:
|
||||
number: {{ .port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
26
artemis-broker/templates/nodeport.yaml
Normal file
26
artemis-broker/templates/nodeport.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
{{- if .Values.nodeport.enabled }}
|
||||
{{- $np_svc := .Values.nodeport }}
|
||||
{{- range .Values.service.acceptors }}
|
||||
{{- if eq .name $np_svc.service }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
application: {{ $.Values.application.name }}
|
||||
name: {{ $.Values.application.name }}-nodeport-svc
|
||||
spec:
|
||||
ports:
|
||||
- name: {{ quote .name }}
|
||||
port: {{ .port }}
|
||||
protocol: {{ quote .protocol }}
|
||||
targetPort: {{ .port }}
|
||||
nodePort: {{ $np_svc.port }}
|
||||
publishNotReadyAddresses: true
|
||||
selector:
|
||||
application: {{ $.Values.application.name }}
|
||||
sessionAffinity: None
|
||||
type: NodePort
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
13
artemis-broker/templates/persistentvolume.yaml
Normal file
13
artemis-broker/templates/persistentvolume.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
{{- if and (eq .Values.kind "Deployment") (eq .Values.ha_ap.mode "primary") (.Values.application.persistent) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.pvc_name . }}
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.application.volume_capacity }}
|
||||
storageClassName: "{{ .Values.application.storageclass }}"
|
||||
{{- end }}
|
56
artemis-broker/templates/rbac.yaml
Normal file
56
artemis-broker/templates/rbac.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
{{- if .Values.clustered }}
|
||||
{{- $service_account := tpl .Values.templates.service_account . }}
|
||||
{{- $role := tpl .Values.templates.k8s_role . }}
|
||||
{{- $rolebinding := tpl .Values.templates.k8s_rolebinding . }}
|
||||
{{- with $app := .Values.application.name }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ $service_account }}
|
||||
labels:
|
||||
app: {{ $app }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ $role }}
|
||||
labels:
|
||||
app: {{ $app }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- endpoints
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- deletecollection
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ $rolebinding }}
|
||||
labels:
|
||||
app: {{ $app }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ $service_account }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ $role }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end }}
|
||||
{{- end }}
|
65
artemis-broker/templates/route.yaml
Normal file
65
artemis-broker/templates/route.yaml
Normal file
@ -0,0 +1,65 @@
|
||||
{{- if eq .Values.platform "openshift" }}
|
||||
{{- $svc_name := tpl .Values.templates.service . }}
|
||||
{{- $app_name := tpl .Values.application.name . }}
|
||||
{{- $route_name := tpl .Values.templates.route . }}
|
||||
{{- $jolokia_ssl := and (.Values.parameters.tls_enabled) (.Values.parameters.jolokia_passthrough) }}
|
||||
{{- range .Values.service.console }}
|
||||
---
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
metadata:
|
||||
labels:
|
||||
application: {{ $app_name }}
|
||||
name: {{ $route_name }}-console
|
||||
spec:
|
||||
{{- if $.Values.parameters.append_ns }}
|
||||
host: {{ $route_name }}.{{ $.Release.Namespace }}.{{ $.Values.parameters.openshift_appdomain }}
|
||||
{{- else }}
|
||||
host: {{ $route_name }}.{{ $.Values.parameters.openshift_appdomain }}
|
||||
{{- end }}
|
||||
to:
|
||||
kind: Service
|
||||
name: {{ $svc_name }}
|
||||
port:
|
||||
targetPort: {{ .port }}
|
||||
tls:
|
||||
{{- if $jolokia_ssl }}
|
||||
termination: passthrough
|
||||
{{- else }}
|
||||
termination: edge
|
||||
{{- end }}
|
||||
insecureEdgeTerminationPolicy: Redirect
|
||||
wildcardPolicy: None
|
||||
{{- end }}
|
||||
{{- if not .Values.clustered }}
|
||||
{{- if .Values.passthrough_route.enabled }}
|
||||
{{- range .Values.service.acceptors }}
|
||||
{{- $nm := toString .name }}
|
||||
{{- if eq $nm $.Values.passthrough_route.service }}
|
||||
---
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
metadata:
|
||||
labels:
|
||||
application: {{ $app_name }}
|
||||
name: {{ $route_name }}-passthrough
|
||||
spec:
|
||||
{{- if $.Values.parameters.append_ns }}
|
||||
host: {{ $.Values.passthrough_route.hostname }}.{{ $.Release.Namespace }}.{{ $.Values.parameters.openshift_appdomain }}
|
||||
{{- else }}
|
||||
host: {{ $.Values.passthrough_route.hostname }}.{{ $.Values.parameters.openshift_appdomain }}
|
||||
{{- end }}
|
||||
to:
|
||||
kind: Service
|
||||
name: {{ $svc_name }}
|
||||
port:
|
||||
targetPort: {{ .port }}
|
||||
tls:
|
||||
termination: passthrough
|
||||
insecureEdgeTerminationPolicy: Redirect
|
||||
wildcardPolicy: None
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
42
artemis-broker/templates/secrets.yaml
Normal file
42
artemis-broker/templates/secrets.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
{{- if .Values.security.createSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.app_secret .}}
|
||||
type: Opaque
|
||||
data:
|
||||
AMQ_USER: {{ b64enc .Values.admin.user }}
|
||||
AMQ_PASSWORD: {{ b64enc .Values.admin.password }}
|
||||
{{- if .Values.clustered }}
|
||||
AMQ_CLUSTER_USER: {{ b64enc .Values.admin.cluster_user }}
|
||||
AMQ_CLUSTER_PASSWORD: {{ b64enc .Values.admin.cluster_password }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.parameters.tls_enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.app_certificates . }}
|
||||
type: Opaque
|
||||
data:
|
||||
AMQ_KEYSTORE_PASSWORD: {{ b64enc .Values.tls.keystore_password }}
|
||||
AMQ_TRUSTSTORE_PASSWORD: {{ b64enc .Values.tls.truststore_password }}
|
||||
{{- range tuple .Values.tls.keystore .Values.tls.truststore }}
|
||||
{{ . }}: |-
|
||||
{{ ( printf "%s%s" "tls/" . | $.Files.Get ) | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.platform "kubernetes") (.Values.ingress.console.tls) }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.ingress.console.tlsSecretName }}
|
||||
data:
|
||||
tls.crt: |-
|
||||
{{ ( printf "%s%s" "tls/" .Values.ingress.console.cert | $.Files.Get) | b64enc }}
|
||||
tls.key: |-
|
||||
{{ ( printf "%s%s" "tls/" .Values.ingress.console.key | $.Files.Get) | b64enc }}
|
||||
type: kubernetes.io/tls
|
||||
{{- end }}
|
16
artemis-broker/templates/servicemonitor.yaml
Normal file
16
artemis-broker/templates/servicemonitor.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ .Values.application.name }}-monitor
|
||||
labels:
|
||||
prometheus: prometheus-app
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
application: {{ .Values.application.name }}
|
||||
endpoints:
|
||||
- targetPort: {{ .Values.metrics.servicemonitor.port }}
|
||||
path: /metrics/
|
||||
interval: {{ .Values.metrics.servicemonitor.interval }}
|
||||
{{- end }}
|
57
artemis-broker/templates/services.yaml
Normal file
57
artemis-broker/templates/services.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
{{- $application_name := .Values.application.name }}
|
||||
{{- $svc_name := tpl .Values.templates.service . }}
|
||||
{{- $dc_name := tpl .Values.templates.deployment . }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
{{- if eq .Values.kind "StatefulSet" }}
|
||||
description: The broker's headless, non load balanced service
|
||||
{{- else }}
|
||||
description: AMQ Broker Service
|
||||
{{- end }}
|
||||
labels:
|
||||
application: {{ $application_name }}
|
||||
app: {{ $application_name }}
|
||||
name: {{ $svc_name }}
|
||||
spec:
|
||||
{{- if eq .Values.kind "StatefulSet" }}
|
||||
clusterIP: None
|
||||
{{- end }}
|
||||
type: ClusterIP
|
||||
publishNotReadyAddresses: true
|
||||
ports:
|
||||
{{- range .Values.service.acceptors }}
|
||||
- port: {{ .port }}
|
||||
name: {{ .name }}
|
||||
protocol: {{ .protocol }}
|
||||
targetPort: {{ .port }}
|
||||
{{- end }}
|
||||
{{- range .Values.service.console }}
|
||||
- port: {{ .port }}
|
||||
name: {{ .name }}
|
||||
protocol: {{ .protocol }}
|
||||
targetPort: {{ .port }}
|
||||
{{- end }}
|
||||
selector:
|
||||
deployment: {{ $dc_name }}
|
||||
{{- if .Values.clustered }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
description: The JGroups ping port for clustering.
|
||||
service.alpha.kubernetes.io/tolerate-unready-endpoints: 'true'
|
||||
labels:
|
||||
application: {{ $application_name }}
|
||||
name: {{ tpl .Values.ping_service.name . }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- targetPort: {{ .Values.ping_service.port }}
|
||||
port: {{ .Values.ping_service.port }}
|
||||
selector:
|
||||
deployment: {{ $dc_name }}
|
||||
{{- end }}
|
50
artemis-broker/templates/statefulset.yaml
Normal file
50
artemis-broker/templates/statefulset.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
{{- if eq .Values.kind "StatefulSet" }}
|
||||
{{- $svc_name := tpl .Values.templates.service . }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
application: {{ .Values.application.name }}
|
||||
name: {{ tpl .Values.templates.deployment . }}
|
||||
{{- if .Values.clustered }}
|
||||
annotations:
|
||||
{{- include "drainer.pod" . | nindent 6 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
application: {{ .Values.application.name }}
|
||||
{{- if .Values.clustered }}
|
||||
podManagementPolicy: OrderedReady
|
||||
replicas: {{ .Values.application.replicas }}
|
||||
{{- else }}
|
||||
replicas: 1
|
||||
{{- end }}
|
||||
serviceName: {{ $svc_name }}
|
||||
template:
|
||||
metadata:
|
||||
# trigger deployments on config map changes
|
||||
annotations:
|
||||
configmap/checksum: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
labels:
|
||||
application: {{ .Values.application.name }}
|
||||
deployment: {{ tpl .Values.templates.deployment . }}
|
||||
app: {{ .Values.application.name }}
|
||||
name: {{ tpl .Values.templates.deployment . }}
|
||||
spec:
|
||||
{{- include "amq.pod" . | nindent 6 }}
|
||||
{{- if .Values.application.persistent }}
|
||||
volumeClaimTemplates:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ tpl .Values.templates.pvc_name . }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.application.volume_capacity }}
|
||||
storageClassName: "{{ .Values.application.storageclass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
1
artemis-broker/tls/ingress_console.crt
Normal file
1
artemis-broker/tls/ingress_console.crt
Normal file
@ -0,0 +1 @@
|
||||
PLACEHOLDER
|
1
artemis-broker/tls/ingress_console.key
Normal file
1
artemis-broker/tls/ingress_console.key
Normal file
@ -0,0 +1 @@
|
||||
PLACEHOLDER
|
1
artemis-broker/tls/keystore.ks
Normal file
1
artemis-broker/tls/keystore.ks
Normal file
@ -0,0 +1 @@
|
||||
PLACEHOLDER
|
1
artemis-broker/tls/keystore.ts
Normal file
1
artemis-broker/tls/keystore.ts
Normal file
@ -0,0 +1 @@
|
||||
PLACEHOLDER
|
227
artemis-broker/values.yaml
Normal file
227
artemis-broker/values.yaml
Normal file
@ -0,0 +1,227 @@
|
||||
# Deploy broker as Deployment or StatefulSet
|
||||
# if clustered is True, then only StatefulSet is supported
|
||||
kind: Deployment
|
||||
clustered: false # only with StatefulSet
|
||||
|
||||
# Platform type.
|
||||
platform: kubernetes
|
||||
|
||||
application:
|
||||
name: broker1 # set broker1 is this for primary deployment else set to broker2
|
||||
amq_broker_version: 55ae4e28b100534d63c34ab86f69230d274c999d46d1493f26fe3e75ba7a0cec # 7.12.3
|
||||
amq_broker_image: registry.redhat.io/amq7/amq-broker-rhel8
|
||||
pullPolicy: IfNotPresent
|
||||
persistent: true
|
||||
journal_type: ASYNCIO # more information see broker.xml
|
||||
volume_capacity: "1G"
|
||||
replicas: 1
|
||||
storageclass: default
|
||||
# this is used if platform type is set as "kubernetes"
|
||||
pullSecretName: redhat-pullsecret
|
||||
|
||||
service:
|
||||
console:
|
||||
- name: jolokia
|
||||
description: "The Jolokia Management Console Service"
|
||||
protocol: TCP
|
||||
port: 8161
|
||||
acceptors:
|
||||
- name: multiplex
|
||||
description: "Multiplexed protocol endpoint (CORE+All the others)"
|
||||
protocol: TCP
|
||||
# when tls is enabled, all acceptors are tls-protected.
|
||||
# this behaviour can be overridden by marking the acceptor as non-tls
|
||||
#use_tls: false
|
||||
port: 61616
|
||||
# if needed, override the protocols here.
|
||||
# default values are specified in the "parameters" section below
|
||||
#amq_protocols: "CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE"
|
||||
# also, additional properties for a single acceptor can be set here
|
||||
#acceptor_params:
|
||||
# - key: supportAdvisory
|
||||
# value: false
|
||||
# - key: suppressInternalManagementObjects
|
||||
# value: false
|
||||
|
||||
ping_service:
|
||||
name: "{{ .Values.application.name }}-ping-svc"
|
||||
port: 8888
|
||||
jgroups:
|
||||
bind_port: 7800
|
||||
|
||||
nodeport:
|
||||
port: 30003
|
||||
service: multiplex
|
||||
enabled: true
|
||||
|
||||
passthrough_route:
|
||||
hostname: multiplex-amq
|
||||
enabled: false
|
||||
service: multiplex
|
||||
|
||||
# only relevant for deployment on kubernetes
|
||||
ingress:
|
||||
# the ingress rule domain
|
||||
domain: kubernetes.local
|
||||
# passthrough ingress rule: only relevant for TLS enabled brokers
|
||||
passthrough:
|
||||
path: "/"
|
||||
service: multiplex
|
||||
enabled: true
|
||||
# jolokia console ingress rule. optional tls certificates can be configured here
|
||||
console:
|
||||
path: "/"
|
||||
service: jolokia
|
||||
enabled: true
|
||||
tls: false
|
||||
tlsSecretName: "amq-console-ingress-certs"
|
||||
cert: ingress_console.crt
|
||||
key: ingress_console.key
|
||||
|
||||
tls:
|
||||
secret_mount_path: "/etc/amq-secret-volume"
|
||||
keystore: keystore.ks
|
||||
truststore: keystore.ts
|
||||
keystore_password: kspwd
|
||||
truststore_password: tspwd
|
||||
|
||||
parameters:
|
||||
tls_enabled: false
|
||||
jolokia_passthrough: false
|
||||
append_ns: false
|
||||
openshift_appdomain: apps.cluster.local
|
||||
amq_protocols: "openwire,amq,stomp,mqtt,hornetq,core"
|
||||
amq_broker_name: "broker"
|
||||
amq_global_max_size: "200 mb"
|
||||
amq_require_login: False
|
||||
amq_extra_args: ""
|
||||
amq_anycast_prefix: "jmx.queue."
|
||||
amq_multicast_prefix: "jmx.topic."
|
||||
amq_journal_type: "nio"
|
||||
ssl_provider: "jdk" # alternative is openssl
|
||||
amq_data_dir: "/opt/amq/data"
|
||||
amq_force_addresses_cleanup: True # if true remove all queues that are not declared here upon chart update
|
||||
|
||||
cluster:
|
||||
ha_ap_mode: false # Primary-Backup Mode / only with 2 Deployments
|
||||
jgroupsCfg: "jgroups-ping.xml"
|
||||
refreshTimeout: 10000
|
||||
connector:
|
||||
ref: multiplex
|
||||
port: 61616
|
||||
|
||||
ha_ap:
|
||||
mode: primary
|
||||
refreshTimeout: 10000
|
||||
connector:
|
||||
ref: artemis
|
||||
port: 61616
|
||||
static:
|
||||
ref: broker2 # set broker2 is this for primary deployment else set to broker1
|
||||
port: 61616
|
||||
|
||||
templates:
|
||||
service: "{{ .Values.application.name }}-svc"
|
||||
service_account: "{{ .Values.application.name }}-sa"
|
||||
k8s_role: "{{ .Values.application.name }}-role"
|
||||
k8s_rolebinding: "{{ .Values.application.name }}-rolebinding"
|
||||
deployment: "{{ .Values.application.name }}-dc"
|
||||
route: "{{ .Values.application.name }}-route"
|
||||
broker_image: "{{ .Values.application.amq_broker_image }}:{{ .Values.application.amq_broker_version }}"
|
||||
override_cm: "{{ .Values.application.name }}-override-cm"
|
||||
config_cm: "{{ .Values.application.name }}-config-cm"
|
||||
app_secret: "{{ .Values.application.name }}-secret"
|
||||
app_certificates: "{{ .Values.application.name }}-certificates"
|
||||
pvc_name: "{{ .Values.application.name }}-persistent-volume"
|
||||
|
||||
admin:
|
||||
user: admin
|
||||
password: password
|
||||
cluster_user: cadmin
|
||||
cluster_password: cpassword
|
||||
role: "admin"
|
||||
|
||||
security:
|
||||
enabled: true
|
||||
# Names of additional secrets to mount into configuration folder.
|
||||
secrets: []
|
||||
createSecret: true
|
||||
jaasUsers:
|
||||
# Secret key entry name for Username password properties file. Override when files is provided by existing Secret.
|
||||
key: artemis-users.properties
|
||||
|
||||
# Add more users to this configuration
|
||||
# Any users that gets assigned the .admin.role
|
||||
# role name becomes an additional administrator
|
||||
users: []
|
||||
# - name: demouser
|
||||
# password: "demo"
|
||||
# roles:
|
||||
# - user
|
||||
# - name: anotheruser
|
||||
# password: "demo1"
|
||||
# roles:
|
||||
# - user
|
||||
#
|
||||
queues:
|
||||
defaults:
|
||||
maxDeliveryAttempts: 3
|
||||
redeliveryDelayMultiplier: 1
|
||||
redeliveryDelay: 5000
|
||||
maxRedeliveryDelay: 50000
|
||||
maxSizeBytes: "100 mb"
|
||||
addressFullPolicy: "PAGE"
|
||||
messageCounterHistoryDayLimit: 10
|
||||
addresses: []
|
||||
# - name: QUEUE_1
|
||||
# type: anycast # for queues, choose 'multicast' for topics
|
||||
# dlq_address: QUEUE_1_DLQ
|
||||
# expiry_address:
|
||||
# maxDeliveryAttempts:
|
||||
# redeliveryDelayMultiplier:
|
||||
# redeliveryDelay:
|
||||
# maxRedeliveryDelay:
|
||||
# maxSizeBytes:
|
||||
# messageCounterHistoryDayLimit:
|
||||
# addressFullPolicy:
|
||||
# permissions:
|
||||
# - grant: consume
|
||||
# roles:
|
||||
# - admin
|
||||
# - user
|
||||
# - grant: browse
|
||||
# roles:
|
||||
# - admin
|
||||
# - user
|
||||
# - grant: send
|
||||
# roles:
|
||||
# - admin
|
||||
# - user
|
||||
# - grant: manage
|
||||
# roles:
|
||||
# - admin
|
||||
# #- grant: createNonDurableQueue # uncomment this when declaring topics (with type: multicast)
|
||||
# # roles:
|
||||
# # - admin
|
||||
# # - user
|
||||
|
||||
# Add Metrics and Prometheus ServiceMonitor for collecting metrics
|
||||
metrics:
|
||||
enabled: false
|
||||
jvm_memory: true
|
||||
jvm_gc: false
|
||||
jvm_threads: false
|
||||
servicemonitor:
|
||||
port: 8161
|
||||
interval: 20s
|
||||
|
||||
# k8s resources
|
||||
resources: {}
|
||||
# limits:
|
||||
# cpu: 1000m
|
||||
# memory: 2000Mi
|
||||
# requests:
|
||||
# cpu: 200m
|
||||
# memory: 1000Mi
|
||||
#
|
||||
|
16
values_helmChart.yaml
Normal file
16
values_helmChart.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
kind: Deployment
|
||||
clustered: true
|
||||
cluster:
|
||||
ha_ap_mode: true
|
||||
ha_ap:
|
||||
connector:
|
||||
ref: broker1
|
||||
static:
|
||||
ref: broker2
|
||||
application:
|
||||
name: broker1
|
||||
amq_broker_image: registry.tuxnet.lan/amq7/amq-broker-rhel8
|
||||
storageclass: nfs-delete
|
||||
|
||||
ingress:
|
||||
domain: tuxnet.lan
|
19
values_helmChart__passive.yaml
Normal file
19
values_helmChart__passive.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
kind: Deployment
|
||||
clustered: true
|
||||
cluster:
|
||||
ha_ap_mode: true
|
||||
ha_ap:
|
||||
mode: backup
|
||||
connector:
|
||||
ref: broker2
|
||||
static:
|
||||
ref: broker1
|
||||
application:
|
||||
name: broker2
|
||||
amq_broker_image: registry.tuxnet.lan/amq7/amq-broker-rhel8
|
||||
|
||||
nodeport:
|
||||
port: 30004
|
||||
|
||||
ingress:
|
||||
domain: tuxnet.lan
|
Loading…
x
Reference in New Issue
Block a user