mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-27 05:43:11 +00:00
Compare commits
526 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60fc7d856c | ||
|
|
5697feea57 | ||
|
|
56f10cf966 | ||
|
|
c996c88178 | ||
|
|
5fb6bb7519 | ||
|
|
0b4b5dd7fd | ||
|
|
d4b295e8b4 | ||
|
|
e0ce3ef71d | ||
|
|
fcf9a0840b | ||
|
|
f9c05a5698 | ||
|
|
bfc4d8e37f | ||
|
|
f04ab1878c | ||
|
|
eeed2b8ae5 | ||
|
|
a47b06f937 | ||
|
|
605b46d83c | ||
|
|
7ead166ca0 | ||
|
|
c5533f47c1 | ||
|
|
78864b3653 | ||
|
|
bed4aff4cc | ||
|
|
e0a8a88243 | ||
|
|
1c3c5d430d | ||
|
|
6e47dc62c2 | ||
|
|
2e9615aa1e | ||
|
|
e2aef8330e | ||
|
|
883baeb16b | ||
|
|
ba1bb878f1 | ||
|
|
45ce8185df | ||
|
|
a55829e5d5 | ||
|
|
54293a0efb | ||
|
|
e506466d08 | ||
|
|
e9750b489e | ||
|
|
0a89fc87a6 | ||
|
|
65a82f706c | ||
|
|
e8f0306ec2 | ||
|
|
f1660c8bd1 | ||
|
|
f967c7d341 | ||
|
|
54072d6a46 | ||
|
|
fb13011aad | ||
|
|
24cb6006f6 | ||
|
|
4c05137fb8 | ||
|
|
07540c29da | ||
|
|
5bb2b2ac87 | ||
|
|
039157d070 | ||
|
|
bb4f4c2eb4 | ||
|
|
97efcab2a2 | ||
|
|
c08c1027a1 | ||
|
|
3d1ecc19f4 | ||
|
|
5d0f91ec13 | ||
|
|
6ab32a42cf | ||
|
|
9718424483 | ||
|
|
d5683adaf8 | ||
|
|
1bc342258a | ||
|
|
79ab6f0b5e | ||
|
|
3822e32755 | ||
|
|
c30d4c174d | ||
|
|
8a5ec6e19c | ||
|
|
d4de2d3c44 | ||
|
|
848cf17d0b | ||
|
|
ae86cb3d13 | ||
|
|
70ec7a5304 | ||
|
|
532be386fc | ||
|
|
0367516203 | ||
|
|
8bad25cbc7 | ||
|
|
f50c029408 | ||
|
|
4f87143719 | ||
|
|
f0a518baf6 | ||
|
|
8224b0b354 | ||
|
|
d42737993f | ||
|
|
a95815561a | ||
|
|
2b0221bbc6 | ||
|
|
36cf9c23ea | ||
|
|
041270ffbe | ||
|
|
9f917231a0 | ||
|
|
cdab3dd538 | ||
|
|
0444ae31db | ||
|
|
e5a24b8918 | ||
|
|
f9792d486e | ||
|
|
dd37ebd440 | ||
|
|
4a1e3c1075 | ||
|
|
4b6eb8df05 | ||
|
|
9fc3738b53 | ||
|
|
e3c2720681 | ||
|
|
23a3266b4a | ||
|
|
e271515385 | ||
|
|
13abaab1b3 | ||
|
|
01bde2cebb | ||
|
|
c696eda50a | ||
|
|
a260ab6873 | ||
|
|
9fa46bea43 | ||
|
|
8ead140541 | ||
|
|
6820981dd5 | ||
|
|
56df3279a6 | ||
|
|
64fb262830 | ||
|
|
5d99553fa6 | ||
|
|
cecf812382 | ||
|
|
3f0fd7f965 | ||
|
|
f27d7b28b8 | ||
|
|
a8da7f9398 | ||
|
|
4720d29fda | ||
|
|
64e4279d96 | ||
|
|
cf61205f49 | ||
|
|
e98c913f86 | ||
|
|
b49d68ca92 | ||
|
|
9638a2b284 | ||
|
|
4fc20de72e | ||
|
|
6fff7cb485 | ||
|
|
6baf3a174d | ||
|
|
ed72dc12b2 | ||
|
|
3fa60853a2 | ||
|
|
f8bbe9f55a | ||
|
|
c7c7171110 | ||
|
|
b7370d0e48 | ||
|
|
0b37f76225 | ||
|
|
e6e1025206 | ||
|
|
a5d5028dae | ||
|
|
413b7003a2 | ||
|
|
7b02b5df04 | ||
|
|
a5211fe511 | ||
|
|
fcbf394272 | ||
|
|
7bf49c207a | ||
|
|
3c70598704 | ||
|
|
80a9e8c156 | ||
|
|
dc0e86b823 | ||
|
|
07b8120788 | ||
|
|
a6e7a1bec3 | ||
|
|
809491bce0 | ||
|
|
5e66b6aeb0 | ||
|
|
c6fe038fe4 | ||
|
|
49d7a566b2 | ||
|
|
3cf912c998 | ||
|
|
0dbf3ddff8 | ||
|
|
af16e9e73f | ||
|
|
154b801cfc | ||
|
|
a8acae4af5 | ||
|
|
6e31feaa20 | ||
|
|
a53a10ad33 | ||
|
|
d5a3cb7519 | ||
|
|
ed6ac1a11a | ||
|
|
b5d81b8e5d | ||
|
|
3abeec518a | ||
|
|
d2c4b9c8a4 | ||
|
|
2ad1d25120 | ||
|
|
26e72b4e1d | ||
|
|
3434cbef96 | ||
|
|
256d84a42a | ||
|
|
03cfe14c07 | ||
|
|
82c7dd2f44 | ||
|
|
818b3682fa | ||
|
|
ffba1b4712 | ||
|
|
dba934daa0 | ||
|
|
d0827ba426 | ||
|
|
16b2f2a34f | ||
|
|
607a7ca58c | ||
|
|
d11d66e81d | ||
|
|
7a937b0932 | ||
|
|
e1c0e33b4f | ||
|
|
cf905ca5d0 | ||
|
|
630a5ee1f3 | ||
|
|
3d78e90ab1 | ||
|
|
3981e6ba5e | ||
|
|
ac682a9c05 | ||
|
|
7bdf48ffc0 | ||
|
|
fc11db4ece | ||
|
|
148309325e | ||
|
|
82756ebfe7 | ||
|
|
a9cee5f4da | ||
|
|
5f3d9ed96f | ||
|
|
1eb8501430 | ||
|
|
ecbb16960f | ||
|
|
368f786244 | ||
|
|
e4fe1ee214 | ||
|
|
0d1fa239a5 | ||
|
|
8a51fe9285 | ||
|
|
33c64d5695 | ||
|
|
a534c856db | ||
|
|
acda72558f | ||
|
|
9e2eb16b67 | ||
|
|
6b02c2c53b | ||
|
|
0ca3f1a7c4 | ||
|
|
69474557eb | ||
|
|
48e3a96305 | ||
|
|
da7e227f71 | ||
|
|
98d5ac126d | ||
|
|
cb5db01406 | ||
|
|
494384c1d7 | ||
|
|
34c2e48e0a | ||
|
|
122995fda7 | ||
|
|
9761c78fe9 | ||
|
|
062c7153c6 | ||
|
|
6ef4aed024 | ||
|
|
3fe42ed4b9 | ||
|
|
2ff1d35b6d | ||
|
|
d3934d9e08 | ||
|
|
3c8ce3718a | ||
|
|
66f03c3c16 | ||
|
|
7e2c2bf92c | ||
|
|
7b95f03a30 | ||
|
|
b0cb1cc07d | ||
|
|
5be4c13016 | ||
|
|
07427be0b7 | ||
|
|
c23bc68900 | ||
|
|
582701d949 | ||
|
|
b6b3b6c0ab | ||
|
|
25a6c3c48a | ||
|
|
c67289d2cf | ||
|
|
d0c7f343b2 | ||
|
|
ef17865f12 | ||
|
|
d5fd5d3819 | ||
|
|
a61ed18147 | ||
|
|
e3e3da0e0e | ||
|
|
1470779b8f | ||
|
|
400df47678 | ||
|
|
0f0ff32bf6 | ||
|
|
a9245454a4 | ||
|
|
bba8b8e2b5 | ||
|
|
93c5e4a0c3 | ||
|
|
06c0dd96d0 | ||
|
|
e6b11084db | ||
|
|
669fe1d253 | ||
|
|
e4cfa2f809 | ||
|
|
7251961bcc | ||
|
|
3a5fbb0b06 | ||
|
|
a69ca7f8b5 | ||
|
|
0fb252b6e4 | ||
|
|
718e5cfcb9 | ||
|
|
a8153d5ffb | ||
|
|
7b0a68c2f4 | ||
|
|
1c89044be4 | ||
|
|
15ed13dd8d | ||
|
|
f2ad70678c | ||
|
|
2ec77f1e7e | ||
|
|
aa7d0b9918 | ||
|
|
38209f9720 | ||
|
|
0ba4feaf7a | ||
|
|
d4c1fda066 | ||
|
|
0d97183bbf | ||
|
|
293f0158e0 | ||
|
|
bb30b3b9fe | ||
|
|
39bebe64ba | ||
|
|
5bd84b3d3e | ||
|
|
76e315d191 | ||
|
|
dd022258b5 | ||
|
|
019fa3d356 | ||
|
|
4a968aa605 | ||
|
|
92639c1e89 | ||
|
|
a7cfbe23da | ||
|
|
16a2b590d6 | ||
|
|
8518e0d1c7 | ||
|
|
6bc101af3e | ||
|
|
31e1914db6 | ||
|
|
aee1b464ed | ||
|
|
61921d40ed | ||
|
|
b5f2c19470 | ||
|
|
8d91a67078 | ||
|
|
3df613346c | ||
|
|
b559e836e4 | ||
|
|
ea5fb823f9 | ||
|
|
4c5429190c | ||
|
|
22a05e8887 | ||
|
|
7012a6acfc | ||
|
|
1dc64b551c | ||
|
|
c949d6e58d | ||
|
|
0e0f413e82 | ||
|
|
7935873746 | ||
|
|
a57b9e0475 | ||
|
|
39eee1370b | ||
|
|
48dcb08c78 | ||
|
|
d60fddebca | ||
|
|
ffd1a4b2ab | ||
|
|
8391ed3501 | ||
|
|
3b2a218419 | ||
|
|
71362dd3d4 | ||
|
|
3188cd2889 | ||
|
|
bf3965eac7 | ||
|
|
7953d424f0 | ||
|
|
dc2599b0b9 | ||
|
|
93a7878ab7 | ||
|
|
3a1b763522 | ||
|
|
fcc25b1835 | ||
|
|
470c7c392b | ||
|
|
6e487ed29e | ||
|
|
7f4dfbc0a1 | ||
|
|
c9ab99385a | ||
|
|
ef7703563b | ||
|
|
7f6ed97fd5 | ||
|
|
45f7545f41 | ||
|
|
4b8f371095 | ||
|
|
822b3a439f | ||
|
|
cfb5048f85 | ||
|
|
43c1f396c3 | ||
|
|
cbdbeb790b | ||
|
|
d61a01321f | ||
|
|
3afe1df555 | ||
|
|
b18d59f118 | ||
|
|
1d72a97ac8 | ||
|
|
a8d2831b1c | ||
|
|
213c1bebc4 | ||
|
|
ca6666d271 | ||
|
|
56d1966397 | ||
|
|
fcc09673cc | ||
|
|
b1655479d2 | ||
|
|
a5e29aefec | ||
|
|
4d20079cfe | ||
|
|
645f3a7cf8 | ||
|
|
b65457a056 | ||
|
|
72bf56946f | ||
|
|
a62487b58b | ||
|
|
aa78813d73 | ||
|
|
a08c9104a9 | ||
|
|
5da4b697f1 | ||
|
|
f99a83c137 | ||
|
|
721d6814ca | ||
|
|
866acb3d9c | ||
|
|
94dc52d224 | ||
|
|
c0cd78899a | ||
|
|
3b54fa8675 | ||
|
|
4a869998d1 | ||
|
|
bc044431ab | ||
|
|
4fe482b77b | ||
|
|
194340688d | ||
|
|
b517b0a2a6 | ||
|
|
1dc56803e8 | ||
|
|
85da1aa1f3 | ||
|
|
6378836706 | ||
|
|
e829dafbd2 | ||
|
|
1023718b87 | ||
|
|
4a5141933c | ||
|
|
084841f549 | ||
|
|
76ab4a8342 | ||
|
|
2d6aa5815f | ||
|
|
d69b57c014 | ||
|
|
562a171de6 | ||
|
|
2118c6f49c | ||
|
|
9c759bfe88 | ||
|
|
d0205f4e5e | ||
|
|
d914edf3e0 | ||
|
|
be4fd1364c | ||
|
|
599b1e387d | ||
|
|
732ff9c02c | ||
|
|
d0e30a6878 | ||
|
|
a213b60008 | ||
|
|
768327ea3b | ||
|
|
4908ecfd5d | ||
|
|
e1e97a1bbf | ||
|
|
e54215863c | ||
|
|
0c2f45569c | ||
|
|
cde24806cf | ||
|
|
5a3b2179bc | ||
|
|
faf51c8b24 | ||
|
|
9bdbf4bacb | ||
|
|
d4015546db | ||
|
|
10df62ff7b | ||
|
|
a2a35d0a40 | ||
|
|
4589e2849d | ||
|
|
1456d24ff5 | ||
|
|
b5e630d0b5 | ||
|
|
4104e7d912 | ||
|
|
2f7297f5f5 | ||
|
|
073e6cff0a | ||
|
|
910f1eeb36 | ||
|
|
bba532e2e5 | ||
|
|
fee2289753 | ||
|
|
c5520d4c61 | ||
|
|
25e7f5a8f2 | ||
|
|
d4e12dff8f | ||
|
|
c4d9970111 | ||
|
|
34f48713a4 | ||
|
|
8d2d44dc6d | ||
|
|
2f59796caa | ||
|
|
4a6d1855dc | ||
|
|
cd3bfbef96 | ||
|
|
02328076e5 | ||
|
|
4bec3f7098 | ||
|
|
b7e6987aec | ||
|
|
7218e42771 | ||
|
|
25dfc97047 | ||
|
|
1106ef54ee | ||
|
|
6fd5ca918b | ||
|
|
942cce05e7 | ||
|
|
c2f0c214eb | ||
|
|
a0fdf653fb | ||
|
|
5894a4ad25 | ||
|
|
3c0ea07a55 | ||
|
|
84b766ac40 | ||
|
|
41e84be0d3 | ||
|
|
d40683cbb9 | ||
|
|
918e487422 | ||
|
|
6192cab653 | ||
|
|
c1bbd85ea9 | ||
|
|
d9f3a428d4 | ||
|
|
ebc040fe75 | ||
|
|
12e51ad9ad | ||
|
|
6477468729 | ||
|
|
19461fa86c | ||
|
|
2b3fd833a3 | ||
|
|
c76ad2cff1 | ||
|
|
aa673de25d | ||
|
|
f1512e9405 | ||
|
|
d853e050cd | ||
|
|
9f0c5c8ba9 | ||
|
|
1d34d86f32 | ||
|
|
7164c412f0 | ||
|
|
a8a05bb113 | ||
|
|
bf91f32f79 | ||
|
|
ef10b06be5 | ||
|
|
1e453aefd3 | ||
|
|
71b950c243 | ||
|
|
b00137cc3e | ||
|
|
2cc398d8d4 | ||
|
|
5c91bbd65e | ||
|
|
88b1a8c125 | ||
|
|
6fd969633e | ||
|
|
9c788ba3bd | ||
|
|
c2fd14e39a | ||
|
|
6513e93e7f | ||
|
|
d0f4898aaa | ||
|
|
3d849d9179 | ||
|
|
fe77f1deae | ||
|
|
9156909023 | ||
|
|
03e3b68eeb | ||
|
|
6cae8dfa32 | ||
|
|
b1ecc89759 | ||
|
|
bb85b31411 | ||
|
|
7e7c23e176 | ||
|
|
8442cc7ae8 | ||
|
|
3faf76d7c9 | ||
|
|
61ef5ef005 | ||
|
|
86043361c6 | ||
|
|
06194960e9 | ||
|
|
46da413585 | ||
|
|
b5f255cf00 | ||
|
|
f328b0adb6 | ||
|
|
1bfd3b2028 | ||
|
|
edf01f009e | ||
|
|
a3c28be98a | ||
|
|
49d1f00dbd | ||
|
|
81939cb521 | ||
|
|
6b10a8141c | ||
|
|
1ef1f00b3d | ||
|
|
ce48812921 | ||
|
|
336ea58a0a | ||
|
|
f042cb3d00 | ||
|
|
94d68bf382 | ||
|
|
b3a74362af | ||
|
|
ad531c8dce | ||
|
|
e589ceb661 | ||
|
|
234a10d185 | ||
|
|
e0fa1610ca | ||
|
|
5a856eeba8 | ||
|
|
d26a6bf641 | ||
|
|
8d6db0934f | ||
|
|
c1b2e73123 | ||
|
|
6ac8668ead | ||
|
|
d0516bcdc1 | ||
|
|
ac5a2538bc | ||
|
|
2bdc87d0a8 | ||
|
|
ab566c2530 | ||
|
|
6a7c3ca2de | ||
|
|
f6f58d5c6d | ||
|
|
b1a547d2a6 | ||
|
|
43f98eda77 | ||
|
|
007e47e35c | ||
|
|
21eb83b052 | ||
|
|
1f8414b8cb | ||
|
|
a199a8c104 | ||
|
|
fb1639a5d4 | ||
|
|
19c6c77c41 | ||
|
|
4ee523ed69 | ||
|
|
4c5bae69ef | ||
|
|
9bf896e37c | ||
|
|
cb50f4f3ac | ||
|
|
066e55e179 | ||
|
|
f35bd7cf83 | ||
|
|
95a1fc082b | ||
|
|
dbd1e59a55 | ||
|
|
61f45147f6 | ||
|
|
c20f9b4128 | ||
|
|
15568fe564 | ||
|
|
1baf417504 | ||
|
|
7fbf1c42aa | ||
|
|
a5e21b56ae | ||
|
|
1399504142 | ||
|
|
e5896d15ed | ||
|
|
6b01ff09ce | ||
|
|
c708cef4dc | ||
|
|
1cf466def2 | ||
|
|
0fc145b6aa | ||
|
|
e30d26cf7b | ||
|
|
7c4a731995 | ||
|
|
d2efea08e6 | ||
|
|
23e94f82c0 | ||
|
|
de2e58f222 | ||
|
|
1c7c89efb3 | ||
|
|
096fe100f7 | ||
|
|
58ee2f0c74 | ||
|
|
93f7484f38 | ||
|
|
225c47dbbc | ||
|
|
2daf8a1320 | ||
|
|
5772c706d3 | ||
|
|
ae0a74bea3 | ||
|
|
97cd7a9b7a | ||
|
|
0975663a52 | ||
|
|
efdbd61860 | ||
|
|
13b45cbb12 | ||
|
|
d3ca9c57c9 | ||
|
|
9b1b5e676d | ||
|
|
17eb9cf8e8 | ||
|
|
ed7e2b2a28 | ||
|
|
5b7589accd | ||
|
|
a1e289e189 | ||
|
|
0611f3efaa | ||
|
|
a94a6f045d | ||
|
|
1892b8f0ea | ||
|
|
57b5795aab | ||
|
|
e8096a5f33 | ||
|
|
271bce48bd | ||
|
|
d64c34f8a4 | ||
|
|
1bddb98476 | ||
|
|
5f183999d0 | ||
|
|
3769897131 | ||
|
|
7f86231009 | ||
|
|
f59dac829a | ||
|
|
edecf4d2fe | ||
|
|
4120b5e2b0 | ||
|
|
8dabca5418 | ||
|
|
1d341a21d0 |
23
.github/dependabot.yml
vendored
Normal file
23
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/docs"
|
||||
groups:
|
||||
dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "component:docs"
|
||||
- "dependencies"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
groups:
|
||||
dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "dependencies"
|
||||
81
.github/workflows/ci.yaml
vendored
81
.github/workflows/ci.yaml
vendored
@@ -4,21 +4,24 @@ name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [devel]
|
||||
|
||||
push:
|
||||
branches: [devel]
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
name: molecule
|
||||
strategy:
|
||||
matrix:
|
||||
ansible_args:
|
||||
- --skip-tags=replicas
|
||||
- -t replicas
|
||||
env:
|
||||
DOCKER_API_VERSION: "1.38"
|
||||
DOCKER_API_VERSION: "1.44"
|
||||
DEBUG_OUTPUT_DIR: /tmp/awx_operator_molecule_test
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.8"
|
||||
|
||||
@@ -35,50 +38,32 @@ jobs:
|
||||
MOLECULE_VERBOSITY: 3
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
STORE_DEBUG_OUTPUT: true
|
||||
run: |
|
||||
sudo rm -f $(which kustomize)
|
||||
make kustomize
|
||||
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind
|
||||
helm:
|
||||
runs-on: ubuntu-18.04
|
||||
name: helm
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind -- ${{ matrix.ansible_args }}
|
||||
|
||||
- name: Upload artifacts for failed tests if Run Molecule fails
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
name: awx_operator_molecule_test
|
||||
path: ${{ env.DEBUG_OUTPUT_DIR }}
|
||||
no-log:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create k8s Kind Cluster
|
||||
uses: helm/kind-action@v1.2.0
|
||||
|
||||
- name: Build operator image and load into kind
|
||||
- name: Check no_log statements
|
||||
run: |
|
||||
IMG=awx-operator-ci make docker-build
|
||||
kind load docker-image --name chart-testing awx-operator-ci
|
||||
|
||||
- name: Patch pull policy for tests
|
||||
run: |
|
||||
kustomize edit add patch --path ../testing/pull_policy/Never.yaml
|
||||
working-directory: config/default
|
||||
|
||||
- name: Build and lint helm chart
|
||||
run: |
|
||||
IMG=awx-operator-ci make helm-chart
|
||||
helm lint ./charts/awx-operator
|
||||
|
||||
- name: Install kubeval
|
||||
run: |
|
||||
mkdir tmp && cd tmp
|
||||
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz
|
||||
tar xf kubeval-linux-amd64.tar.gz
|
||||
sudo cp kubeval /usr/local/bin
|
||||
working-directory: ./charts
|
||||
|
||||
- name: Run kubeval
|
||||
run: |
|
||||
helm template -n awx awx-operator > tmp/test.yaml
|
||||
kubeval --strict --force-color --ignore-missing-schemas tmp/test.yaml
|
||||
working-directory: ./charts
|
||||
|
||||
- name: Install helm chart
|
||||
run: |
|
||||
helm install --wait my-awx-operator --namespace awx --create-namespace ./charts/awx-operator
|
||||
set +e
|
||||
no_log=$(grep -nr ' no_log:' roles | grep -v '"{{ no_log }}"')
|
||||
if [ -n "${no_log}" ]; then
|
||||
echo 'Please update the following no_log statement(s) with the "{{ no_log }}" value'
|
||||
echo "${no_log}"
|
||||
exit 1
|
||||
fi
|
||||
nox-sessions:
|
||||
uses: ./.github/workflows/reusable-nox.yml
|
||||
|
||||
39
.github/workflows/devel.yaml
vendored
39
.github/workflows/devel.yaml
vendored
@@ -8,20 +8,41 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Push devel image
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build Image
|
||||
- name: Fail if QUAY_REGISTRY not set
|
||||
run: |
|
||||
IMG=awx-operator:devel make docker-build
|
||||
if [[ -z "${{ vars.QUAY_REGISTRY }}" ]]; then
|
||||
echo "QUAY_REGISTRY not set. Please set QUAY_REGISTRY in variable GitHub Actions variables."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Push To Quay
|
||||
uses: redhat-actions/push-to-registry@v2.1.1
|
||||
- name: Log into registry ghcr.io
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
image: awx-operator
|
||||
tags: devel
|
||||
registry: quay.io/ansible/
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
- name: Log into registry quay.io
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.QUAY_REGISTRY }}
|
||||
username: ${{ secrets.QUAY_USER }}
|
||||
password: ${{ secrets.QUAY_TOKEN }}
|
||||
|
||||
|
||||
- name: Build and Store Image @ghcr
|
||||
run: |
|
||||
IMG=ghcr.io/${{ github.repository }}:${{ github.sha }} make docker-buildx
|
||||
|
||||
|
||||
- name: Publish Image to quay.io
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
ghcr.io/${{ github.repository }}:${{ github.sha }} \
|
||||
--tag ${{ vars.QUAY_REGISTRY }}/awx-operator:devel
|
||||
|
||||
56
.github/workflows/feature.yml
vendored
Normal file
56
.github/workflows/feature.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
|
||||
name: Feature Branch Image Build and Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [feature_*]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
name: Push devel image
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # needed so that git describe --tag works
|
||||
|
||||
- name: Set VERSION
|
||||
run: |
|
||||
echo "VERSION=$(git describe --tags)" >>${GITHUB_ENV}
|
||||
|
||||
- name: Set lower case owner name
|
||||
run: |
|
||||
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
|
||||
env:
|
||||
OWNER: '${{ github.repository_owner }}'
|
||||
|
||||
- name: Set IMAGE_TAG_BASE
|
||||
run: |
|
||||
echo "IMAGE_TAG_BASE=ghcr.io/${OWNER_LC}/awx-operator" >>${GITHUB_ENV}
|
||||
|
||||
- name: Log in to registry
|
||||
run: |
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build and Push awx-operator Image
|
||||
run: |
|
||||
make docker-build docker-push
|
||||
docker tag ${IMAGE_TAG_BASE}:${VERSION} ${IMAGE_TAG_BASE}:${GITHUB_REF##*/}
|
||||
docker push ${IMAGE_TAG_BASE}:${GITHUB_REF##*/}
|
||||
|
||||
- name: Build bundle manifests
|
||||
run: |
|
||||
make bundle
|
||||
|
||||
- name: Build and Push awx-operator Bundle
|
||||
run: |
|
||||
make bundle-build bundle-push
|
||||
docker tag ${IMAGE_TAG_BASE}-bundle:v${VERSION} ${IMAGE_TAG_BASE}-bundle:${GITHUB_REF##*/}
|
||||
docker push ${IMAGE_TAG_BASE}-bundle:${GITHUB_REF##*/}
|
||||
|
||||
- name: Build and Push awx-operator Catalog
|
||||
run: |
|
||||
make catalog-build catalog-push
|
||||
docker tag ${IMAGE_TAG_BASE}-catalog:v${VERSION} ${IMAGE_TAG_BASE}-catalog:${GITHUB_REF##*/}
|
||||
docker push ${IMAGE_TAG_BASE}-catalog:${GITHUB_REF##*/}
|
||||
54
.github/workflows/label_issue.yml
vendored
Normal file
54
.github/workflows/label_issue.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: Label Issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
name: Label
|
||||
|
||||
steps:
|
||||
- name: Label Issue - Needs Triage
|
||||
uses: github/issue-labeler@v3.4
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
not-before: 2021-12-07T07:00:00Z
|
||||
configuration-path: .github/issue_labeler.yml
|
||||
enable-versioned-regex: 0
|
||||
if: github.event_name == 'issues'
|
||||
|
||||
community:
|
||||
runs-on: ubuntu-latest
|
||||
name: Label Issue - Community
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- name: Install python requests
|
||||
run: pip install requests
|
||||
- name: Check if user is a member of Ansible org
|
||||
uses: jannekem/run-python-script-action@v1
|
||||
id: check_user
|
||||
with:
|
||||
script: |
|
||||
import requests
|
||||
headers = {'Accept': 'application/vnd.github+json', 'Authorization': 'token ${{ secrets.GITHUB_TOKEN }}'}
|
||||
response = requests.get('${{ fromJson(toJson(github.event.issue.user.url)) }}/orgs?per_page=100', headers=headers)
|
||||
is_member = False
|
||||
for org in response.json():
|
||||
if org['login'] == 'ansible':
|
||||
is_member = True
|
||||
if is_member:
|
||||
print("User is member")
|
||||
else:
|
||||
print("User is community")
|
||||
- name: Add community label if not a member
|
||||
if: contains(steps.check_user.outputs.stdout, 'community')
|
||||
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
|
||||
with:
|
||||
add-labels: "community"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
49
.github/workflows/label_pr.yml
vendored
Normal file
49
.github/workflows/label_pr.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Label PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
community:
|
||||
runs-on: ubuntu-latest
|
||||
name: Label PR - Community
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
- name: Create a virtual environment
|
||||
run: python3 -m venv venv
|
||||
|
||||
- name: Activate virtual environment and install dependencies
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
pip3 install requests
|
||||
|
||||
- name: Check if user is a member of Ansible org
|
||||
uses: jannekem/run-python-script-action@v1
|
||||
id: check_user
|
||||
with:
|
||||
script: |
|
||||
import requests
|
||||
headers = {'Accept': 'application/vnd.github+json', 'Authorization': 'token ${{ secrets.GITHUB_TOKEN }}'}
|
||||
response = requests.get('${{ fromJson(toJson(github.event.pull_request.user.url)) }}/orgs?per_page=100', headers=headers)
|
||||
is_member = False
|
||||
for org in response.json():
|
||||
if org['login'] == 'ansible':
|
||||
is_member = True
|
||||
if is_member:
|
||||
print("User is member")
|
||||
else:
|
||||
print("User is community")
|
||||
|
||||
- name: Add community label if not a member
|
||||
if: contains(steps.check_user.outputs.stdout, 'community')
|
||||
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
|
||||
with:
|
||||
add-labels: "community"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
18
.github/workflows/pr_body_check.yml
vendored
18
.github/workflows/pr_body_check.yml
vendored
@@ -13,21 +13,13 @@ jobs:
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Write PR body to a file
|
||||
run: |
|
||||
cat >> pr.body << __SOME_RANDOM_PR_EOF__
|
||||
${{ github.event.pull_request.body }}
|
||||
__SOME_RANDOM_PR_EOF__
|
||||
|
||||
- name: Display the received body for troubleshooting
|
||||
run: cat pr.body
|
||||
|
||||
# We want to write these out individually just incase the options were joined on a single line
|
||||
- name: Check for each of the lines
|
||||
env:
|
||||
PR_BODY: ${{ github.event.pull_request.body }}
|
||||
run: |
|
||||
grep "Bug, Docs Fix or other nominal change" pr.body > Z
|
||||
grep "New or Enhanced Feature" pr.body > Y
|
||||
grep "Breaking Change" pr.body > X
|
||||
echo "$PR_BODY" | grep "Bug, Docs Fix or other nominal change" > Z
|
||||
echo "$PR_BODY" | grep "New or Enhanced Feature" > Y
|
||||
echo "$PR_BODY" | grep "Breaking Change" > X
|
||||
exit 0
|
||||
# We exit 0 and set the shell to prevent the returns from the greps from failing this step
|
||||
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
|
||||
|
||||
76
.github/workflows/promote.yaml
vendored
76
.github/workflows/promote.yaml
vendored
@@ -3,38 +3,70 @@ name: Promote AWX Operator image
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_name:
|
||||
description: 'Name for the tag of the release.'
|
||||
required: true
|
||||
quay_registry:
|
||||
description: 'Quay registry to push to.'
|
||||
default: 'quay.io/ansible'
|
||||
|
||||
env:
|
||||
QUAY_REGISTRY: ${{ vars.QUAY_REGISTRY }}
|
||||
|
||||
jobs:
|
||||
promote:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Log in to GHCR
|
||||
- name: Set GitHub Env vars for workflow_dispatch event
|
||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||
echo "QUAY_REGISTRY=${{ github.event.inputs.quay_registry }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Log in to Quay
|
||||
- name: Set GitHub Env vars if release event
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
run: |
|
||||
echo ${{ secrets.QUAY_TOKEN }} | docker login quay.io -u ${{ secrets.QUAY_USER }} --password-stdin
|
||||
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Re-tag and promote awx-operator image
|
||||
- name: Fail if QUAY_REGISTRY not set
|
||||
run: |
|
||||
docker pull ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest
|
||||
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
docker push quay.io/${{ github.repository }}:latest
|
||||
if [[ -z "${{ env.QUAY_REGISTRY }}" ]]; then
|
||||
echo "QUAY_REGISTRY not set. Please set QUAY_REGISTRY in variable GitHub Actions variables."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
depth: 0
|
||||
|
||||
- name: Release Helm chart
|
||||
|
||||
- name: Log into registry ghcr.io
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
- name: Log into registry quay.io
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ env.QUAY_REGISTRY }}
|
||||
username: ${{ secrets.QUAY_USER }}
|
||||
password: ${{ secrets.QUAY_TOKEN }}
|
||||
|
||||
|
||||
- name: Pull Tagged Staged Image and Publish to quay.io
|
||||
run: |
|
||||
ansible-playbook ansible/helm-release.yml -v \
|
||||
-e operator_image=quay.io/${{ github.repository }} \
|
||||
-e chart_owner=${{ github.repository_owner }} \
|
||||
-e tag=${{ github.event.release.tag_name }} \
|
||||
-e gh_token=${{ secrets.GITHUB_TOKEN }}
|
||||
docker buildx imagetools create \
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }} \
|
||||
--tag ${{ env.QUAY_REGISTRY }}/awx-operator:${{ env.TAG_NAME }}
|
||||
|
||||
|
||||
- name: Pull Staged Image and Publish to quay.io/${{ github.repository }}:latest
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }} \
|
||||
--tag ${{ env.QUAY_REGISTRY }}/awx-operator:latest
|
||||
|
||||
26
.github/workflows/reusable-nox.yml
vendored
Normal file
26
.github/workflows/reusable-nox.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: nox
|
||||
|
||||
"on":
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
nox:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- session: build
|
||||
python-versions: "3.11"
|
||||
name: "Run nox ${{ matrix.session }} session"
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup nox
|
||||
uses: wntrblm/nox@2024.04.15
|
||||
with:
|
||||
python-versions: "${{ matrix.python-versions }}"
|
||||
- name: "Run nox -s ${{ matrix.session }}"
|
||||
run: |
|
||||
nox -s "${{ matrix.session }}"
|
||||
41
.github/workflows/stage.yml
vendored
41
.github/workflows/stage.yml
vendored
@@ -37,14 +37,8 @@ jobs:
|
||||
|
||||
exit 0
|
||||
|
||||
- name: Checkout awx
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/awx
|
||||
path: awx
|
||||
|
||||
- name: Checkout awx-operator
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/awx-operator
|
||||
path: awx-operator
|
||||
@@ -53,17 +47,20 @@ jobs:
|
||||
run: |
|
||||
python3 -m pip install docker
|
||||
|
||||
- name: Log in to GHCR
|
||||
run: |
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
- name: Log into registry ghcr.io
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and stage awx-operator
|
||||
- name: Stage awx-operator
|
||||
working-directory: awx-operator
|
||||
run: |
|
||||
BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.default_awx_version }} \
|
||||
--build-arg OPERATOR_VERSION=${{ github.event.inputs.version }}" \
|
||||
IMAGE_TAG_BASE=ghcr.io/${{ github.repository_owner }}/awx-operator \
|
||||
VERSION=${{ github.event.inputs.version }} make docker-build docker-push
|
||||
--build-arg OPERATOR_VERSION=${{ github.event.inputs.version }}" \
|
||||
IMG=ghcr.io/${{ github.repository }}:${{ github.event.inputs.version }} \
|
||||
make docker-buildx
|
||||
|
||||
- name: Run test deployment
|
||||
working-directory: awx-operator
|
||||
@@ -76,10 +73,12 @@ jobs:
|
||||
env:
|
||||
AWX_TEST_VERSION: ${{ github.event.inputs.default_awx_version }}
|
||||
|
||||
- name: Create draft release
|
||||
working-directory: awx
|
||||
run: |
|
||||
ansible-playbook tools/ansible/stage.yml \
|
||||
-e version=${{ github.event.inputs.version }} \
|
||||
-e repo=${{ github.repository_owner }}/awx-operator \
|
||||
-e github_token=${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create Draft Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.version }}
|
||||
release_name: Release ${{ github.event.inputs.version }}
|
||||
draft: true
|
||||
|
||||
22
.github/workflows/triage_new.yml
vendored
22
.github/workflows/triage_new.yml
vendored
@@ -1,22 +0,0 @@
|
||||
---
|
||||
name: Triage
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
name: Label
|
||||
|
||||
steps:
|
||||
- name: Label issues
|
||||
uses: github/issue-labeler@v2.4.1
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
not-before: 2021-12-07T07:00:00Z
|
||||
configuration-path: .github/issue_labeler.yml
|
||||
enable-versioned-regex: 0
|
||||
if: github.event_name == 'issues'
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*~
|
||||
gh-pages/
|
||||
.cache/
|
||||
/bin
|
||||
/bundle
|
||||
@@ -7,3 +8,7 @@
|
||||
/charts
|
||||
/.cr-release-packages
|
||||
.vscode/
|
||||
__pycache__
|
||||
/site
|
||||
venv/*
|
||||
hacking/
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
apiVersion: v2
|
||||
appVersion: 0.1.0
|
||||
description: A Helm chart for Kubernetes
|
||||
name: starter
|
||||
type: application
|
||||
version: 0.1.0
|
||||
@@ -1,56 +0,0 @@
|
||||
# AWX Operator Helm Chart
|
||||
|
||||
This chart installs the AWX Operator resources configured in [this](https://github.com/ansible/awx-operator) repository.
|
||||
|
||||
## Getting Started
|
||||
To configure your AWX resource using this chart, create your own `yaml` values file. The name is up to personal preference since it will explicitly be passed into the helm chart. Helm will merge whatever values you specify in your file with the default `values.yaml`, overriding any settings you've changed while allowing you to fall back on defaults. Because of this functionality, `values.yaml` should not be edited directly.
|
||||
|
||||
In your values config, enable `AWX.enabled` and add `AWX.spec` values based on the awx operator's [documentation](https://github.com/ansible/awx-operator/blob/devel/README.md). Consult the docs below for additional functionality.
|
||||
|
||||
### Installing
|
||||
The operator's [helm install](https://github.com/ansible/awx-operator/blob/devel/README.md#helm-install-on-existing-cluster) guide provides key installation instructions.
|
||||
|
||||
Example:
|
||||
```
|
||||
helm install my-awx-operator awx-operator/awx-operator -n awx --create-namespace -f myvalues.yaml
|
||||
```
|
||||
|
||||
Argument breakdown:
|
||||
* `-f` passes in the file with your custom values
|
||||
* `-n` sets the namespace to be installed in
|
||||
* This value is accessed by `{{ $.Release.Namespace }}` in the templates
|
||||
* Acts as the default namespace for all unspecified resources
|
||||
* `--create-namespace` specifies that helm should create the namespace before installing
|
||||
|
||||
To update an existing installation, use `helm upgrade` instead of `install`. The rest of the syntax remains the same.
|
||||
|
||||
## Configuration
|
||||
The goal of adding helm configurations is to abstract out and simplify the creation of multi-resource configs. The `AWX.spec` field maps directly to the spec configs of the `AWX` resource that the operator provides, which are detailed in the [main README](https://github.com/ansible/awx-operator/blob/devel/README.md). Other sub-config can be added with the goal of simplifying more involved setups that require additional resources to be specified.
|
||||
|
||||
These sub-headers aim to be a more intuitive entrypoint into customizing your deployment, and are easier to manage in the long-term. By design, the helm templates will defer to the manually defined specs to avoid configuration conflicts. For example, if `AWX.spec.postgres_configuration_secret` is being used, the `AWX.postgres` settings will not be applied, even if enabled.
|
||||
|
||||
### External Postgres
|
||||
The `AWX.postgres` section simplifies the creation of the external postgres secret. If enabled, the configs provided will automatically be placed in a `postgres-config` secret and linked to the `AWX` resource. For proper secret management, the `AWX.postgres.password` value, and any other sensitive values, can be passed in at the command line rather than specified in code. Use the `--set` argument with `helm install`.
|
||||
|
||||
|
||||
## Values Summary
|
||||
|
||||
### AWX
|
||||
| Value | Description | Default |
|
||||
|---|---|---|
|
||||
| `AWX.enabled` | Enable this AWX resource configuration | `false` |
|
||||
| `AWX.name` | The name of the AWX resource and default prefix for other resources | `"awx"` |
|
||||
| `AWX.spec` | specs to directly configure the AWX resource | `{}` |
|
||||
| `AWX.postgres` | configurations for the external postgres secret | - |
|
||||
|
||||
|
||||
# Contributing
|
||||
|
||||
## Adding abstracted sections
|
||||
Where possible, defer to `AWX.spec` configs before applying the abstracted configs to avoid collision. This can be facilitated by the `(hasKey .spec what_i_will_abstract)` check.
|
||||
|
||||
## Building and Testing
|
||||
This chart is built using the Makefile in the [awx-operator repo](https://github.com/ansible/awx-operator). Clone the repo and run `make helm-chart`. This will create the awx-operator chart in the `charts/awx-operator` directory. In this process, the contents of the `.helm/starter` directory will be added to the chart.
|
||||
|
||||
## Future Goals
|
||||
All values under the `AWX` header are focused on configurations that use the operator. Configurations that relate to the Operator itself could be placed under an `Operator` heading, but that may add a layer of complication over current development.
|
||||
@@ -1,6 +0,0 @@
|
||||
{{/*
|
||||
Generate the name of the postgres secret, expects AWX context passed in
|
||||
*/}}
|
||||
{{- define "postgres.secretName" -}}
|
||||
{{ default (printf "%s-postgres-configuration" .Values.AWX.name) .Values.AWX.postgres.secretName }}
|
||||
{{- end }}
|
||||
@@ -1,24 +0,0 @@
|
||||
{{- if $.Values.AWX.enabled }}
|
||||
{{- with .Values.AWX }}
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
spec:
|
||||
{{- /* Include raw map from the values file spec */}}
|
||||
{{ .spec | toYaml | indent 2 }}
|
||||
{{- /* Provide security context defaults */}}
|
||||
{{- if not (hasKey .spec "security_context_settings") }}
|
||||
security_context_settings:
|
||||
runAsGroup: 0
|
||||
runAsUser: 0
|
||||
fsGroup: 0
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
{{- end }}
|
||||
{{- /* Postgres configs if enabled and not already present */}}
|
||||
{{- if and .postgres.enabled (not (hasKey .spec "postgres_configuration_secret")) }}
|
||||
postgres_configuration_secret: {{ include "postgres.secretName" $ }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,18 +0,0 @@
|
||||
{{- if and $.Values.AWX.enabled $.Values.AWX.postgres.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "postgres.secretName" . }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
{{- with $.Values.AWX.postgres }}
|
||||
stringData:
|
||||
host: {{ .host }}
|
||||
port: {{ .port | quote }}
|
||||
database: {{ .dbName }}
|
||||
username: {{ .username }}
|
||||
password: {{ .password }}
|
||||
sslmode: {{ .sslmode }}
|
||||
type: {{ .type }}
|
||||
type: Opaque
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,19 +0,0 @@
|
||||
AWX:
|
||||
# enable use of awx-deploy template
|
||||
enabled: false
|
||||
name: awx
|
||||
spec:
|
||||
admin_user: admin
|
||||
|
||||
# configurations for external postgres instance
|
||||
postgres:
|
||||
enabled: false
|
||||
host: Unset
|
||||
port: 5678
|
||||
dbName: Unset
|
||||
username: admin
|
||||
# for secret management, pass in the password independently of this file
|
||||
# at the command line, use --set AWX.postgres.password
|
||||
password: Unset
|
||||
sslmode: prefer
|
||||
type: unmanaged
|
||||
17
.readthedocs.yml
Normal file
17
.readthedocs.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# RTD API version
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.11"
|
||||
|
||||
mkdocs:
|
||||
configuration: mkdocs.yml
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: ./docs/requirements.txt
|
||||
@@ -6,7 +6,7 @@ ignore: |
|
||||
kustomization.yaml
|
||||
awx-operator.clusterserviceversion.yaml
|
||||
bundle
|
||||
.helm/starter
|
||||
hacking/
|
||||
|
||||
rules:
|
||||
truthy: disable
|
||||
|
||||
@@ -6,13 +6,16 @@ Have questions about this document or anything not covered here? Please file a n
|
||||
|
||||
## Table of contents
|
||||
|
||||
* [Things to know prior to submitting code](#things-to-know-prior-to-submitting-code)
|
||||
* [Submmiting your Work](#submitting-your-work)
|
||||
* [Testing](#testing)
|
||||
* [Testing in Docker](#testing-in-docker)
|
||||
* [Testing in Minikube](#testing-in-minikube)
|
||||
* [Generating a bundle](#generating-a-bundle)
|
||||
* [Reporting Issues](#reporting-issues)
|
||||
- [AWX-Operator Contributing Guidelines](#awx-operator-contributing-guidelines)
|
||||
- [Table of contents](#table-of-contents)
|
||||
- [Things to know prior to submitting code](#things-to-know-prior-to-submitting-code)
|
||||
- [Submmiting your work](#submmiting-your-work)
|
||||
- [Development](#development)
|
||||
- [Testing](#testing)
|
||||
- [Testing in Kind](#testing-in-kind)
|
||||
- [Testing in Minikube](#testing-in-minikube)
|
||||
- [Generating a bundle](#generating-a-bundle)
|
||||
- [Reporting Issues](#reporting-issues)
|
||||
|
||||
|
||||
## Things to know prior to submitting code
|
||||
@@ -25,13 +28,13 @@ Have questions about this document or anything not covered here? Please file a n
|
||||
|
||||
|
||||
## Submmiting your work
|
||||
1. From your fork `devel` branch, create a new brach to stage your changes.
|
||||
1. From your fork `devel` branch, create a new branch to stage your changes.
|
||||
```sh
|
||||
#> git checkout -b <branch-name>
|
||||
```
|
||||
2. Make your changes.
|
||||
3. Test your changes according described on the Testing section.
|
||||
4. If everylooks looks correct, commit your changes.
|
||||
4. If everything looks correct, commit your changes.
|
||||
```sh
|
||||
#> git add <FILES>
|
||||
#> git commit -m "My message here"
|
||||
@@ -40,30 +43,34 @@ Have questions about this document or anything not covered here? Please file a n
|
||||
|
||||
**Note**: If you have multiple commits, make sure to `squash` your commits into a single commit which will facilitate our release process.
|
||||
|
||||
|
||||
## Development
|
||||
The development environment consists of running an [`up.sh`](./up.sh) and a [`down.sh`](./down.sh) script, which applies or deletes yaml on the Openshift or K8s cluster you are connected to. See the [development.md](docs/development.md) for information on how to deploy and test changes from your branch.
|
||||
|
||||
## Testing
|
||||
|
||||
This Operator includes a [Molecule](https://molecule.readthedocs.io/en/stable/)-based test environment, which can be executed standalone in Docker (e.g. in CI or in a single Docker container anywhere), or inside any kind of Kubernetes cluster (e.g. Minikube).
|
||||
This Operator includes a [Molecule](https://ansible.readthedocs.io/projects/molecule/)-based test environment, which can be executed standalone in Docker (e.g. in CI or in a single Docker container anywhere), or inside any kind of Kubernetes cluster (e.g. Minikube).
|
||||
|
||||
You need to make sure you have Molecule installed before running the following commands. You can install Molecule with:
|
||||
|
||||
```sh
|
||||
#> pip install 'molecule[docker]'
|
||||
#> python -m pip install molecule-plugins[docker]
|
||||
```
|
||||
|
||||
Running `molecule test` sets up a clean environment, builds the operator, runs all configured tests on an example operator instance, then tears down the environment (at least in the case of Docker).
|
||||
|
||||
If you want to actively develop the operator, use `molecule converge`, which does everything but tear down the environment at the end.
|
||||
|
||||
#### Testing in Docker
|
||||
#### Testing in Kind
|
||||
|
||||
Testing with a kind cluster is the recommended way to test the awx-operator locally. First, you need to install kind if you haven't already. Please see these docs for setting that up:
|
||||
* https://kind.sigs.k8s.io/docs/user/quick-start/
|
||||
|
||||
To run the tests, from the root of your checkout, run the following command:
|
||||
|
||||
```sh
|
||||
#> molecule test -s test-local
|
||||
#> molecule test -s kind
|
||||
```
|
||||
|
||||
This environment is meant for headless testing (e.g. in a CI environment, or when making smaller changes which don't need to be verified through a web interface). It is difficult to test things like AWX's web UI or to connect other applications on your local machine to the services running inside the cluster, since it is inside a Docker container with no static IP address.
|
||||
|
||||
#### Testing in Minikube
|
||||
|
||||
```sh
|
||||
@@ -137,4 +144,4 @@ Applying this template will do it. Once the CatalogSource is in a READY state, t
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
We welcome your feedback, and encourage you to file an issue when you run into a problem.
|
||||
We welcome your feedback, and encourage you to file an issue when you run into a problem.
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
FROM quay.io/operator-framework/ansible-operator:v1.22.2
|
||||
FROM quay.io/operator-framework/ansible-operator:v1.40.0
|
||||
|
||||
USER root
|
||||
RUN dnf update --security --bugfix -y --disableplugin=subscription-manager && \
|
||||
dnf install -y --disableplugin=subscription-manager openssl
|
||||
|
||||
USER 1001
|
||||
|
||||
ARG DEFAULT_AWX_VERSION
|
||||
ARG OPERATOR_VERSION
|
||||
|
||||
224
Makefile
224
Makefile
@@ -4,16 +4,10 @@
|
||||
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
|
||||
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
|
||||
VERSION ?= $(shell git describe --tags)
|
||||
PREV_VERSION ?= $(shell git describe --abbrev=0 --tags $(shell git rev-list --tags --skip=1 --max-count=1))
|
||||
|
||||
CONTAINER_CMD ?= docker
|
||||
|
||||
# GNU vs BSD in-place sed
|
||||
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
||||
SED_I := sed -i
|
||||
else
|
||||
SED_I := sed -i ''
|
||||
endif
|
||||
|
||||
# CHANNELS define the bundle channels used in the bundle.
|
||||
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
|
||||
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
|
||||
@@ -59,14 +53,6 @@ endif
|
||||
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
|
||||
NAMESPACE ?= awx
|
||||
|
||||
# Helm variables
|
||||
CHART_NAME ?= awx-operator
|
||||
CHART_DESCRIPTION ?= A Helm chart for the AWX Operator
|
||||
CHART_OWNER ?= $(GH_REPO_OWNER)
|
||||
CHART_REPO ?= awx-operator
|
||||
CHART_BRANCH ?= gh-pages
|
||||
CHART_INDEX ?= index.yaml
|
||||
|
||||
.PHONY: all
|
||||
all: docker-build
|
||||
|
||||
@@ -87,6 +73,10 @@ all: docker-build
|
||||
help: ## Display this help.
|
||||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||
|
||||
.PHONY: print-%
|
||||
print-%: ## Print any variable from the Makefile. Use as `make print-VARIABLE`
|
||||
@echo $($*)
|
||||
|
||||
##@ Build
|
||||
|
||||
.PHONY: run
|
||||
@@ -101,6 +91,25 @@ docker-build: ## Build docker image with the manager.
|
||||
docker-push: ## Push docker image with the manager.
|
||||
${CONTAINER_CMD} push ${IMG}
|
||||
|
||||
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
|
||||
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
|
||||
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
|
||||
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
|
||||
# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> than the export will fail)
|
||||
# To properly provided solutions that supports more than one platform you should use this option.
|
||||
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
|
||||
.PHONY: docker-buildx
|
||||
docker-buildx: ## Build and push docker image for the manager for cross-platform support
|
||||
- docker buildx create --name project-v3-builder
|
||||
docker buildx use project-v3-builder
|
||||
- docker buildx build --push $(BUILD_ARGS) --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile .
|
||||
- docker buildx rm project-v3-builder
|
||||
|
||||
.PHONY: podman-buildx
|
||||
podman-buildx: ## Build and push podman image for the manager for cross-platform support
|
||||
podman build --platform=$(PLATFORMS) $(BUILD_ARGS) --manifest ${IMG} -f Dockerfile .
|
||||
podman manifest push --all ${IMG} ${IMG}
|
||||
|
||||
##@ Deployment
|
||||
|
||||
.PHONY: install
|
||||
@@ -140,7 +149,7 @@ ifeq (,$(shell which kustomize 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(KUSTOMIZE)) ;\
|
||||
curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.5.2/kustomize_v4.5.2_$(OS)_$(ARCHA).tar.gz | \
|
||||
curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.0.1/kustomize_v5.0.1_$(OS)_$(ARCHA).tar.gz | \
|
||||
tar xzf - -C bin/ ;\
|
||||
}
|
||||
else
|
||||
@@ -148,6 +157,22 @@ KUSTOMIZE = $(shell which kustomize)
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: operator-sdk
|
||||
OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
|
||||
operator-sdk: ## Download operator-sdk locally if necessary, preferring the $(pwd)/bin path over global if both exist.
|
||||
ifeq (,$(wildcard $(OPERATOR_SDK)))
|
||||
ifeq (,$(shell which operator-sdk 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(OPERATOR_SDK)) ;\
|
||||
curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/v1.40.0/operator-sdk_$(OS)_$(ARCHA) ;\
|
||||
chmod +x $(OPERATOR_SDK) ;\
|
||||
}
|
||||
else
|
||||
OPERATOR_SDK = $(shell which operator-sdk)
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: ansible-operator
|
||||
ANSIBLE_OPERATOR = $(shell pwd)/bin/ansible-operator
|
||||
ansible-operator: ## Download ansible-operator locally if necessary, preferring the $(pwd)/bin path over global if both exist.
|
||||
@@ -156,7 +181,7 @@ ifeq (,$(shell which ansible-operator 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(ANSIBLE_OPERATOR)) ;\
|
||||
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.22.2/ansible-operator_$(OS)_$(ARCHA) ;\
|
||||
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/ansible-operator-plugins/releases/download/v1.40.0/ansible-operator_$(OS)_$(ARCHA) ;\
|
||||
chmod +x $(ANSIBLE_OPERATOR) ;\
|
||||
}
|
||||
else
|
||||
@@ -165,11 +190,11 @@ endif
|
||||
endif
|
||||
|
||||
.PHONY: bundle
|
||||
bundle: kustomize ## Generate bundle manifests and metadata, then validate generated files.
|
||||
operator-sdk generate kustomize manifests -q
|
||||
bundle: kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
|
||||
$(OPERATOR_SDK) generate kustomize manifests -q
|
||||
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
|
||||
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
|
||||
operator-sdk bundle validate ./bundle
|
||||
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
|
||||
$(OPERATOR_SDK) bundle validate ./bundle
|
||||
|
||||
.PHONY: bundle-build
|
||||
bundle-build: ## Build the bundle image.
|
||||
@@ -187,7 +212,7 @@ ifeq (,$(shell which opm 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(OPM)) ;\
|
||||
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$(OS)-$(ARCHA)-opm ;\
|
||||
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.55.0/$(OS)-$(ARCHA)-opm ;\
|
||||
chmod +x $(OPM) ;\
|
||||
}
|
||||
else
|
||||
@@ -218,158 +243,3 @@ catalog-build: opm ## Build a catalog image.
|
||||
.PHONY: catalog-push
|
||||
catalog-push: ## Push a catalog image.
|
||||
$(MAKE) docker-push IMG=$(CATALOG_IMG)
|
||||
|
||||
.PHONY: kubectl-slice
|
||||
KUBECTL_SLICE = $(shell pwd)/bin/kubectl-slice
|
||||
kubectl-slice: ## Download kubectl-slice locally if necessary.
|
||||
ifeq (,$(wildcard $(KUBECTL_SLICE)))
|
||||
ifeq (,$(shell which kubectl-slice 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(KUBECTL_SLICE)) ;\
|
||||
curl -sSLo - https://github.com/patrickdappollonio/kubectl-slice/releases/download/v1.1.0/kubectl-slice_1.1.0_$(OS)_$(ARCHX).tar.gz | \
|
||||
tar xzf - -C bin/ kubectl-slice ;\
|
||||
}
|
||||
else
|
||||
KUBECTL_SLICE = $(shell which kubectl-slice)
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: helm
|
||||
HELM = $(shell pwd)/bin/helm
|
||||
helm: ## Download helm locally if necessary.
|
||||
ifeq (,$(wildcard $(HELM)))
|
||||
ifeq (,$(shell which helm 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(HELM)) ;\
|
||||
curl -sSLo - https://get.helm.sh/helm-v3.8.0-$(OS)-$(ARCHA).tar.gz | \
|
||||
tar xzf - -C bin/ $(OS)-$(ARCHA)/helm ;\
|
||||
mv bin/$(OS)-$(ARCHA)/helm bin/helm ;\
|
||||
rmdir bin/$(OS)-$(ARCHA) ;\
|
||||
}
|
||||
else
|
||||
HELM = $(shell which helm)
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: yq
|
||||
YQ = $(shell pwd)/bin/yq
|
||||
yq: ## Download yq locally if necessary.
|
||||
ifeq (,$(wildcard $(YQ)))
|
||||
ifeq (,$(shell which yq 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(HELM)) ;\
|
||||
curl -sSLo - https://github.com/mikefarah/yq/releases/download/v4.20.2/yq_$(OS)_$(ARCHA).tar.gz | \
|
||||
tar xzf - -C bin/ ;\
|
||||
mv bin/yq_$(OS)_$(ARCHA) bin/yq ;\
|
||||
}
|
||||
else
|
||||
YQ = $(shell which yq)
|
||||
endif
|
||||
endif
|
||||
|
||||
PHONY: cr
|
||||
CR = $(shell pwd)/bin/cr
|
||||
cr: ## Download cr locally if necessary.
|
||||
ifeq (,$(wildcard $(CR)))
|
||||
ifeq (,$(shell which cr 2>/dev/null))
|
||||
@{ \
|
||||
set -e ;\
|
||||
mkdir -p $(dir $(CR)) ;\
|
||||
curl -sSLo - https://github.com/helm/chart-releaser/releases/download/v1.3.0/chart-releaser_1.3.0_$(OS)_$(ARCHA).tar.gz | \
|
||||
tar xzf - -C bin/ cr ;\
|
||||
}
|
||||
else
|
||||
CR = $(shell which cr)
|
||||
endif
|
||||
endif
|
||||
|
||||
charts:
|
||||
mkdir -p $@
|
||||
|
||||
.PHONY: helm-chart
|
||||
helm-chart: helm-chart-generate
|
||||
|
||||
.PHONY: helm-chart-generate
|
||||
helm-chart-generate: kustomize helm kubectl-slice yq charts
|
||||
@echo "== KUSTOMIZE: Set image and chart label =="
|
||||
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
|
||||
cd config/manager && $(KUSTOMIZE) edit set label helm.sh/chart:$(CHART_NAME)-$(VERSION)
|
||||
cd config/default && $(KUSTOMIZE) edit set label helm.sh/chart:$(CHART_NAME)-$(VERSION)
|
||||
|
||||
@echo "== Gather Helm Chart Metadata =="
|
||||
# remove the existing chart if it exists
|
||||
rm -rf charts/$(CHART_NAME)
|
||||
# create new chart metadata in Chart.yaml
|
||||
cd charts && \
|
||||
$(HELM) create awx-operator --starter $(shell pwd)/.helm/starter ;\
|
||||
$(YQ) -i '.version = "$(VERSION)"' $(CHART_NAME)/Chart.yaml ;\
|
||||
$(YQ) -i '.appVersion = "$(VERSION)" | .appVersion style="double"' $(CHART_NAME)/Chart.yaml ;\
|
||||
$(YQ) -i '.description = "$(CHART_DESCRIPTION)"' $(CHART_NAME)/Chart.yaml ;\
|
||||
|
||||
@echo "Generated chart metadata:"
|
||||
@cat charts/$(CHART_NAME)/Chart.yaml
|
||||
|
||||
@echo "== KUSTOMIZE: Generate resources and slice into templates =="
|
||||
# place in raw-files directory so they can be modified while they are valid yaml - as soon as they are in templates/,
|
||||
# wild cards pick up the actual templates, which are not real yaml and can't have yq run on them.
|
||||
$(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/default | \
|
||||
$(KUBECTL_SLICE) --input-file=- \
|
||||
--output-dir=charts/$(CHART_NAME)/raw-files \
|
||||
--sort-by-kind
|
||||
|
||||
@echo "== GIT: Reset kustomize configs =="
|
||||
# reset kustomize configs following kustomize build
|
||||
git checkout -f config/.
|
||||
|
||||
@echo "== Build Templates and CRDS =="
|
||||
# Delete metadata.namespace, release namespace will be automatically inserted by helm
|
||||
for file in charts/$(CHART_NAME)/raw-files/*; do\
|
||||
$(YQ) -i 'del(.metadata.namespace)' $${file};\
|
||||
done
|
||||
# Correct namespace for rolebinding to be release namespace, this must be explicit
|
||||
for file in charts/$(CHART_NAME)/raw-files/*rolebinding*; do\
|
||||
$(YQ) -i '.subjects[0].namespace = "{{ .Release.Namespace }}"' $${file};\
|
||||
done
|
||||
# move all custom resource definitions to crds folder
|
||||
mkdir charts/$(CHART_NAME)/crds
|
||||
mv charts/$(CHART_NAME)/raw-files/customresourcedefinition*.yaml charts/$(CHART_NAME)/crds/.
|
||||
# remove any namespace definitions
|
||||
rm -f charts/$(CHART_NAME)/raw-files/namespace*.yaml
|
||||
# move remaining resources to helm templates
|
||||
mv charts/$(CHART_NAME)/raw-files/* charts/$(CHART_NAME)/templates/.
|
||||
# remove the raw-files folder
|
||||
rm -rf charts/$(CHART_NAME)/raw-files
|
||||
|
||||
# create and populate NOTES.txt
|
||||
@echo "AWX Operator installed with Helm Chart version $(VERSION)" > charts/$(CHART_NAME)/templates/NOTES.txt
|
||||
|
||||
@echo "Helm chart successfully configured for $(CHART_NAME) version $(VERSION)"
|
||||
|
||||
|
||||
.PHONY: helm-package
|
||||
helm-package: cr helm-chart
|
||||
@echo "== CHART RELEASER (package) =="
|
||||
$(CR) package ./charts/awx-operator
|
||||
|
||||
# The actual release happens in ansible/helm-release.yml
|
||||
# until https://github.com/helm/chart-releaser/issues/122 happens
|
||||
.PHONY: helm-index
|
||||
helm-index: cr helm-chart
|
||||
@echo "== CHART RELEASER (httpsorigin) =="
|
||||
git remote add httpsorigin "https://github.com/$(CHART_OWNER)/$(CHART_REPO).git"
|
||||
git fetch httpsorigin
|
||||
|
||||
@echo "== CHART RELEASER (index) =="
|
||||
$(CR) index \
|
||||
--owner "$(CHART_OWNER)" \
|
||||
--git-repo "$(CHART_REPO)" \
|
||||
--token "$(CR_TOKEN)" \
|
||||
--pages-branch "$(CHART_BRANCH)" \
|
||||
--index-path "./charts/$(CHART_INDEX)" \
|
||||
--charts-repo "https://$(CHART_OWNER).github.io/$(CHART_REPO)/$(CHART_INDEX)" \
|
||||
--remote httpsorigin \
|
||||
--release-name-template="{{ .Version }}" \
|
||||
--push
|
||||
|
||||
11
PROJECT
11
PROJECT
@@ -1,3 +1,7 @@
|
||||
# Code generated by tool. DO NOT EDIT.
|
||||
# This file is used to track the info used to scaffold your project
|
||||
# and allow the plugins properly work.
|
||||
# More info: https://book.kubebuilder.io/reference/project-config.html
|
||||
domain: ansible.com
|
||||
layout:
|
||||
- ansible.sdk.operatorframework.io/v1
|
||||
@@ -27,4 +31,11 @@ resources:
|
||||
group: awx
|
||||
kind: AWXRestore
|
||||
version: v1beta1
|
||||
- api:
|
||||
crdVersion: v1
|
||||
namespaced: true
|
||||
domain: ansible.com
|
||||
group: awx
|
||||
kind: AWXMeshIngress
|
||||
version: v1alpha1
|
||||
version: "3"
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
vars:
|
||||
chart_repo: awx-operator
|
||||
tasks:
|
||||
- name: Look up release
|
||||
uri:
|
||||
url: "https://api.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/tags/{{ tag }}"
|
||||
register: release
|
||||
ignore_errors: yes
|
||||
|
||||
- fail:
|
||||
msg: |
|
||||
Release must exist before running this playbook
|
||||
when: release is not success
|
||||
|
||||
- name: Build and package helm chart
|
||||
command: |
|
||||
make helm-package
|
||||
environment:
|
||||
VERSION: "{{ tag }}"
|
||||
IMAGE_TAG_BASE: "{{ operator_image }}"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/../"
|
||||
|
||||
# Move to chart releaser after https://github.com/helm/chart-releaser/issues/122 exists
|
||||
- name: Upload helm chart
|
||||
uri:
|
||||
url: "https://uploads.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/{{ release.json.id }}/assets?name=awx-operator-{{ tag }}.tgz"
|
||||
src: "{{ playbook_dir }}/../.cr-release-packages/awx-operator-{{ tag }}.tgz"
|
||||
headers:
|
||||
Authorization: "token {{ gh_token }}"
|
||||
Content-Type: "application/octet-stream"
|
||||
status_code:
|
||||
- 200
|
||||
- 201
|
||||
register: asset_upload
|
||||
changed_when: asset_upload.json.state == "uploaded"
|
||||
|
||||
- name: Publish helm index
|
||||
command: |
|
||||
make helm-index
|
||||
environment:
|
||||
CHART_OWNER: "{{ chart_owner }}"
|
||||
CR_TOKEN: "{{ gh_token }}"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/../"
|
||||
@@ -26,6 +26,7 @@
|
||||
image_version: "{{ image_version | default(omit) }}"
|
||||
development_mode: "{{ development_mode | default(omit) | bool }}"
|
||||
image_pull_policy: "{{ image_pull_policy | default(omit) }}"
|
||||
nodeport_port: "{{ nodeport_port | default(omit) }}"
|
||||
# ee_images:
|
||||
# - name: test-ee
|
||||
# image: quay.io/<user>/awx-ee
|
||||
|
||||
7
awxmeshingress-demo.yml
Normal file
7
awxmeshingress-demo.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1alpha1
|
||||
kind: AWXMeshIngress
|
||||
metadata:
|
||||
name: awx-mesh-ingress-demo
|
||||
spec:
|
||||
deployment_name: awx-demo
|
||||
@@ -37,6 +37,9 @@ spec:
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
x-kubernetes-validations:
|
||||
- rule: "has(self.postgres_image) && has(self.postgres_image_version) || !has(self.postgres_image) && !has(self.postgres_image_version)"
|
||||
message: "Both postgres_image and postgres_image_version must be set when required"
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
@@ -48,6 +51,10 @@ spec:
|
||||
backup_pvc:
|
||||
description: Name of the backup PVC
|
||||
type: string
|
||||
create_backup_pvc:
|
||||
description: If true (default), automatically create the backup PVC if it does not exist
|
||||
type: boolean
|
||||
default: true
|
||||
backup_pvc_namespace:
|
||||
description: (Deprecated) Namespace the PVC is in
|
||||
type: string
|
||||
@@ -55,7 +62,7 @@ spec:
|
||||
description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from)
|
||||
type: string
|
||||
backup_resource_requirements:
|
||||
description: Resource requirements for the task container
|
||||
description: Resource requirements for the management pod used to create a backup
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
@@ -78,6 +85,13 @@ spec:
|
||||
clean_backup_on_delete:
|
||||
description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted
|
||||
type: boolean
|
||||
pg_dump_suffix:
|
||||
description: Additional parameters for the pg_dump command
|
||||
type: string
|
||||
use_db_compression:
|
||||
description: Enable compression for database dumps using pg_dump built-in compression.
|
||||
type: boolean
|
||||
default: true
|
||||
postgres_label_selector:
|
||||
description: Label selector used to identify postgres pod for backing up data
|
||||
type: string
|
||||
@@ -87,9 +101,33 @@ spec:
|
||||
postgres_image_version:
|
||||
description: PostgreSQL container image version to use
|
||||
type: string
|
||||
precreate_partition_hours:
|
||||
description: Number of hours worth of events table partitions to precreate before backup to avoid pg_dump locks.
|
||||
type: integer
|
||||
format: int32
|
||||
image_pull_policy:
|
||||
description: The image pull policy
|
||||
type: string
|
||||
default: IfNotPresent
|
||||
enum:
|
||||
- Always
|
||||
- always
|
||||
- Never
|
||||
- never
|
||||
- IfNotPresent
|
||||
- ifnotpresent
|
||||
db_management_pod_node_selector:
|
||||
description: nodeSelector for the Postgres pods to backup
|
||||
type: string
|
||||
no_log:
|
||||
description: Configure no_log for no_log tasks
|
||||
type: string
|
||||
type: boolean
|
||||
default: true
|
||||
additional_labels:
|
||||
description: Additional labels defined on the resource, which should be propagated to child resources
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
set_self_labels:
|
||||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
|
||||
type: boolean
|
||||
|
||||
464
config/crd/bases/awx.ansible.com_awxmeshingresses.yaml
Normal file
464
config/crd/bases/awx.ansible.com_awxmeshingresses.yaml
Normal file
@@ -0,0 +1,464 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: awxmeshingresses.awx.ansible.com
|
||||
spec:
|
||||
group: awx.ansible.com
|
||||
names:
|
||||
kind: AWXMeshIngress
|
||||
listKind: AWXMeshIngressList
|
||||
plural: awxmeshingresses
|
||||
singular: awxmeshingress
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: AWXMeshIngress is the Schema for the awxmeshingresses API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Spec defines the desired state of AWXMeshIngress
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- deployment_name
|
||||
properties:
|
||||
deployment_name:
|
||||
description: Name of the AWX deployment to create the Mesh Ingress for.
|
||||
type: string
|
||||
image_pull_secrets:
|
||||
description: Image pull secrets for Mesh Ingress containers.
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
external_hostname:
|
||||
description: External hostname to use for the Mesh Ingress.
|
||||
type: string
|
||||
external_ipaddress:
|
||||
description: External IP address to use for the Mesh Ingress.
|
||||
type: string
|
||||
ingress_type:
|
||||
description: The ingress type to use to reach the deployed instance
|
||||
type: string
|
||||
enum:
|
||||
- none
|
||||
- Ingress
|
||||
- ingress
|
||||
- IngressRouteTCP
|
||||
- ingressroutetcp
|
||||
- Route
|
||||
- route
|
||||
ingress_api_version:
|
||||
description: The Ingress API version to use
|
||||
type: string
|
||||
ingress_annotations:
|
||||
description: Annotations to add to the Ingress Controller
|
||||
type: string
|
||||
route_annotations:
|
||||
description: Annotations to add to the OpenShift Route
|
||||
type: string
|
||||
ingress_class_name:
|
||||
description: The name of ingress class to use instead of the cluster default.
|
||||
type: string
|
||||
ingress_controller:
|
||||
description: Special configuration for specific Ingress Controllers
|
||||
type: string
|
||||
node_selector:
|
||||
description: Assign the Mesh Ingress Pod to the specified node.
|
||||
type: string
|
||||
tolerations:
|
||||
description: Scheduling tolerations for the Mesh Ingress instance.
|
||||
type: string
|
||||
topology_spread_constraints:
|
||||
description: Topology spread constraints for the Mesh Ingress instance.
|
||||
type: string
|
||||
affinity:
|
||||
description: Scheduling constraints to apply to the Pod definition
|
||||
properties:
|
||||
nodeAffinity:
|
||||
properties:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
items:
|
||||
properties:
|
||||
preference:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchFields:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
weight:
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- preference
|
||||
- weight
|
||||
type: object
|
||||
type: array
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
properties:
|
||||
nodeSelectorTerms:
|
||||
items:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchFields:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: array
|
||||
required:
|
||||
- nodeSelectorTerms
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
podAffinity:
|
||||
properties:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
items:
|
||||
properties:
|
||||
podAffinityTerm:
|
||||
properties:
|
||||
labelSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaceSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaces:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
topologyKey:
|
||||
type: string
|
||||
required:
|
||||
- topologyKey
|
||||
type: object
|
||||
weight:
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- podAffinityTerm
|
||||
- weight
|
||||
type: object
|
||||
type: array
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
items:
|
||||
properties:
|
||||
labelSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaceSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaces:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
topologyKey:
|
||||
type: string
|
||||
required:
|
||||
- topologyKey
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
podAntiAffinity:
|
||||
properties:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
items:
|
||||
properties:
|
||||
podAffinityTerm:
|
||||
properties:
|
||||
labelSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaceSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaces:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
topologyKey:
|
||||
type: string
|
||||
required:
|
||||
- topologyKey
|
||||
type: object
|
||||
weight:
|
||||
format: int32
|
||||
type: integer
|
||||
required:
|
||||
- podAffinityTerm
|
||||
- weight
|
||||
type: object
|
||||
type: array
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
items:
|
||||
properties:
|
||||
labelSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaceSelector:
|
||||
properties:
|
||||
matchExpressions:
|
||||
items:
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
operator:
|
||||
type: string
|
||||
values:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
namespaces:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
topologyKey:
|
||||
type: string
|
||||
required:
|
||||
- topologyKey
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
status:
|
||||
description: Status defines the observed state of AWXMeshIngress
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
@@ -37,19 +37,27 @@ spec:
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
x-kubernetes-validations:
|
||||
- rule: "has(self.postgres_image) && has(self.postgres_image_version) || !has(self.postgres_image) && !has(self.postgres_image_version)"
|
||||
message: "Both postgres_image and postgres_image_version must be set when required"
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- deployment_name
|
||||
properties:
|
||||
backup_source:
|
||||
description: Backup source
|
||||
type: string
|
||||
enum:
|
||||
- CR
|
||||
- Backup CR
|
||||
- PVC
|
||||
deployment_name:
|
||||
description: Name of the restored deployment. This should be different from the original deployment name
|
||||
if the original deployment still exists.
|
||||
type: string
|
||||
cluster_name:
|
||||
description: Cluster name
|
||||
type: string
|
||||
backup_name:
|
||||
description: AWXBackup object name
|
||||
type: string
|
||||
@@ -62,8 +70,8 @@ spec:
|
||||
backup_dir:
|
||||
description: Backup directory name, set as a status found on the awxbackup object (backupDirectory)
|
||||
type: string
|
||||
backup_resource_requirements:
|
||||
description: Resource requirements for the management pod that backs up AWX
|
||||
restore_resource_requirements:
|
||||
description: Resource requirements for the management pod that restores AWX from a backup
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
@@ -89,13 +97,42 @@ spec:
|
||||
postgres_image_version:
|
||||
description: PostgreSQL container image version to use
|
||||
type: string
|
||||
spec_overrides:
|
||||
description: Overrides for the AWX spec
|
||||
# type: string
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
image_pull_policy:
|
||||
description: The image pull policy
|
||||
type: string
|
||||
default: IfNotPresent
|
||||
enum:
|
||||
- Always
|
||||
- always
|
||||
- Never
|
||||
- never
|
||||
- IfNotPresent
|
||||
- ifnotpresent
|
||||
db_management_pod_node_selector:
|
||||
description: nodeSelector for the Postgres pods to backup
|
||||
type: string
|
||||
no_log:
|
||||
description: Configure no_log for no_log tasks
|
||||
type: string
|
||||
type: boolean
|
||||
default: true
|
||||
additional_labels:
|
||||
description: Additional labels defined on the resource, which should be propagated to child resources
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
set_self_labels:
|
||||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
|
||||
type: boolean
|
||||
default: true
|
||||
force_drop_db:
|
||||
description: Force drop the database before restoring. USE WITH CAUTION!
|
||||
type: boolean
|
||||
default: false
|
||||
status:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: awxbackups.awx.ansible.com
|
||||
spec:
|
||||
group: awx.ansible.com
|
||||
names:
|
||||
kind: AWXBackup
|
||||
listKind: AWXBackupList
|
||||
plural: awxbackups
|
||||
singular: awxbackup
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
description: Schema validation for the AWXBackup CRD
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
required:
|
||||
- deployment_name
|
||||
properties:
|
||||
backup_resource_requirements:
|
||||
description: Resource requirements for the task container
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
limits:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
deployment_name:
|
||||
description: Name of the deployment to be backed up
|
||||
type: string
|
||||
backup_pvc:
|
||||
description: Name of the backup PVC
|
||||
type: string
|
||||
backup_pvc_namespace:
|
||||
description: (Deprecated) Namespace the PVC is in
|
||||
type: string
|
||||
backup_storage_requirements:
|
||||
description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from)
|
||||
type: string
|
||||
backup_storage_class:
|
||||
description: Storage class to use when creating PVC for backup
|
||||
type: string
|
||||
clean_backup_on_delete:
|
||||
description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted
|
||||
type: boolean
|
||||
postgres_label_selector:
|
||||
description: Label selector used to identify postgres pod for backing up data
|
||||
type: string
|
||||
postgres_image:
|
||||
description: Registry path to the PostgreSQL container to use
|
||||
type: string
|
||||
postgres_image_version:
|
||||
description: PostgreSQL container image version to use
|
||||
type: string
|
||||
no_log:
|
||||
description: Configure no_log for no_log tasks
|
||||
type: string
|
||||
set_self_labels:
|
||||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
|
||||
type: boolean
|
||||
default: true
|
||||
status:
|
||||
type: object
|
||||
properties:
|
||||
conditions:
|
||||
description: The resulting conditions when a Service Telemetry is instantiated
|
||||
items:
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
type: string
|
||||
reason:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
backupDirectory:
|
||||
description: Backup directory name on the specified pvc
|
||||
type: string
|
||||
backupClaim:
|
||||
description: Backup persistent volume claim
|
||||
type: string
|
||||
@@ -1,104 +0,0 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: awxrestores.awx.ansible.com
|
||||
spec:
|
||||
group: awx.ansible.com
|
||||
names:
|
||||
kind: AWXRestore
|
||||
listKind: AWXRestoreList
|
||||
plural: awxrestores
|
||||
singular: awxrestore
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
description: Schema validation for the AWXRestore CRD
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
backup_source:
|
||||
description: Backup source
|
||||
type: string
|
||||
enum:
|
||||
- CR
|
||||
- PVC
|
||||
restore_resource_requirements:
|
||||
description: Resource requirements for the management pod the restores the database to the new AWX instance
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
limits:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
deployment_name:
|
||||
description: Name of the restored deployment. This should be different from the original deployment name
|
||||
if the original deployment still exists.
|
||||
type: string
|
||||
backup_name:
|
||||
description: AWXBackup object name
|
||||
type: string
|
||||
backup_pvc:
|
||||
description: Name of the PVC to be restored from, set as a status found on the awxbackup object (backupClaim)
|
||||
type: string
|
||||
backup_pvc_namespace:
|
||||
description: (Deprecated) Namespace the PVC is in
|
||||
type: string
|
||||
backup_dir:
|
||||
description: Backup directory name, set as a status found on the awxbackup object (backupDirectory)
|
||||
type: string
|
||||
postgres_label_selector:
|
||||
description: Label selector used to identify postgres pod for backing up data
|
||||
type: string
|
||||
postgres_image:
|
||||
description: Registry path to the PostgreSQL container to use
|
||||
type: string
|
||||
postgres_image_version:
|
||||
description: PostgreSQL container image version to use
|
||||
type: string
|
||||
no_log:
|
||||
description: Configure no_log for no_log tasks
|
||||
type: string
|
||||
set_self_labels:
|
||||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
|
||||
type: boolean
|
||||
default: true
|
||||
status:
|
||||
type: object
|
||||
properties:
|
||||
conditions:
|
||||
description: The resulting conditions when a Service Telemetry is instantiated
|
||||
items:
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
type: string
|
||||
reason:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
restoreComplete:
|
||||
description: Restore process complete
|
||||
type: boolean
|
||||
@@ -5,4 +5,5 @@ resources:
|
||||
- bases/awx.ansible.com_awxs.yaml
|
||||
- bases/awx.ansible.com_awxbackups.yaml
|
||||
- bases/awx.ansible.com_awxrestores.yaml
|
||||
- bases/awx.ansible.com_awxmeshingresses.yaml
|
||||
#+kubebuilder:scaffold:crdkustomizeresource
|
||||
|
||||
@@ -9,22 +9,22 @@ namespace: awx
|
||||
namePrefix: awx-operator-
|
||||
|
||||
# Labels to add to all resources and selectors.
|
||||
#commonLabels:
|
||||
# someName: someValue
|
||||
#labels:
|
||||
#- includeSelectors: true
|
||||
# pairs:
|
||||
# someName: someValue
|
||||
|
||||
bases:
|
||||
resources:
|
||||
- ../crd
|
||||
- ../rbac
|
||||
- ../manager
|
||||
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
|
||||
#- ../prometheus
|
||||
- metrics_service.yaml
|
||||
|
||||
patchesStrategicMerge:
|
||||
# Protect the /metrics endpoint by putting it behind auth.
|
||||
# If you want your controller-manager to expose the /metrics
|
||||
# endpoint w/o any authn/z, please comment the following line.
|
||||
- manager_auth_proxy_patch.yaml
|
||||
|
||||
# Mount the controller config file for loading manager configurations
|
||||
# through a ComponentConfig type
|
||||
#- manager_config_patch.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
patches:
|
||||
- path: manager_metrics_patch.yaml
|
||||
target:
|
||||
kind: Deployment
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# This patch inject a sidecar container which is a HTTP proxy for the
|
||||
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: controller-manager
|
||||
namespace: system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-rbac-proxy
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
# TODO(user): uncomment for common cases that do not require escalating privileges
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - "ALL"
|
||||
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0
|
||||
args:
|
||||
- "--secure-listen-address=0.0.0.0:8443"
|
||||
- "--upstream=http://127.0.0.1:8080/"
|
||||
- "--logtostderr=true"
|
||||
- "--v=0"
|
||||
ports:
|
||||
- containerPort: 8443
|
||||
protocol: TCP
|
||||
name: https
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 5m
|
||||
memory: 64Mi
|
||||
- name: awx-manager
|
||||
args:
|
||||
- "--health-probe-bind-address=:6789"
|
||||
- "--metrics-bind-address=127.0.0.1:8080"
|
||||
- "--leader-elect"
|
||||
- "--leader-election-id=awx-operator"
|
||||
12
config/default/manager_metrics_patch.yaml
Normal file
12
config/default/manager_metrics_patch.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
# This patch adds the args to allow exposing the metrics endpoint using HTTPS
|
||||
- op: add
|
||||
path: /spec/template/spec/containers/0/args/0
|
||||
value: --metrics-bind-address=:8443
|
||||
# This patch adds the args to allow securing the metrics endpoint
|
||||
- op: add
|
||||
path: /spec/template/spec/containers/0/args/0
|
||||
value: --metrics-secure
|
||||
# This patch adds the args to allow RBAC-based authn/authz for the metrics endpoint
|
||||
- op: add
|
||||
path: /spec/template/spec/containers/0/args/0
|
||||
value: --metrics-require-rbac
|
||||
@@ -3,6 +3,8 @@ kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
control-plane: controller-manager
|
||||
app.kubernetes.io/name: awx-operator
|
||||
app.kubernetes.io/managed-by: kustomize
|
||||
name: controller-manager-metrics-service
|
||||
namespace: system
|
||||
spec:
|
||||
@@ -10,6 +12,7 @@ spec:
|
||||
- name: https
|
||||
port: 8443
|
||||
protocol: TCP
|
||||
targetPort: https
|
||||
targetPort: 8443
|
||||
selector:
|
||||
control-plane: controller-manager
|
||||
app.kubernetes.io/name: awx-operator
|
||||
@@ -5,9 +5,9 @@ generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
|
||||
configMapGenerator:
|
||||
- name: awx-manager-config
|
||||
files:
|
||||
- files:
|
||||
- controller_manager_config.yaml
|
||||
name: awx-manager-config
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
@@ -21,7 +21,7 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
kubectl.kubernetes.io/default-container: manager
|
||||
kubectl.kubernetes.io/default-container: awx-manager
|
||||
labels:
|
||||
control-plane: controller-manager
|
||||
spec:
|
||||
@@ -38,7 +38,9 @@ spec:
|
||||
- args:
|
||||
- --leader-elect
|
||||
- --leader-election-id=awx-operator
|
||||
- --health-probe-bind-address=:6789
|
||||
image: controller:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: awx-manager
|
||||
env:
|
||||
- name: ANSIBLE_GATHERING
|
||||
@@ -51,7 +53,6 @@ spec:
|
||||
fieldPath: metadata.namespace
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
# TODO(user): uncomment for common cases that do not require escalating privileges
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
@@ -73,7 +74,7 @@ spec:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "4096Mi"
|
||||
memory: "4000Mi"
|
||||
cpu: "2000m"
|
||||
serviceAccountName: controller-manager
|
||||
imagePullSecrets:
|
||||
|
||||
File diff suppressed because one or more lines are too long
31
config/rbac/awxmeshingress_editor_role.yaml
Normal file
31
config/rbac/awxmeshingress_editor_role.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
# permissions for end users to edit awxmeshingresses.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: clusterrole
|
||||
app.kubernetes.io/instance: awxmeshingress-editor-role
|
||||
app.kubernetes.io/component: rbac
|
||||
app.kubernetes.io/created-by: awx-operator
|
||||
app.kubernetes.io/part-of: awx-operator
|
||||
app.kubernetes.io/managed-by: kustomize
|
||||
name: awxmeshingress-editor-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxmeshingresses
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxmeshingresses/status
|
||||
verbs:
|
||||
- get
|
||||
27
config/rbac/awxmeshingress_viewer_role.yaml
Normal file
27
config/rbac/awxmeshingress_viewer_role.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# permissions for end users to view awxmeshingresses.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: clusterrole
|
||||
app.kubernetes.io/instance: awxmeshingress-viewer-role
|
||||
app.kubernetes.io/component: rbac
|
||||
app.kubernetes.io/created-by: awx-operator
|
||||
app.kubernetes.io/part-of: awx-operator
|
||||
app.kubernetes.io/managed-by: kustomize
|
||||
name: awxmeshingress-viewer-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxmeshingresses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxmeshingresses/status
|
||||
verbs:
|
||||
- get
|
||||
@@ -9,10 +9,6 @@ resources:
|
||||
- role_binding.yaml
|
||||
- leader_election_role.yaml
|
||||
- leader_election_role_binding.yaml
|
||||
# Comment the following 4 lines if you want to disable
|
||||
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
|
||||
# which protects your /metrics endpoint.
|
||||
- auth_proxy_service.yaml
|
||||
- auth_proxy_role.yaml
|
||||
- auth_proxy_role_binding.yaml
|
||||
- auth_proxy_client_clusterrole.yaml
|
||||
- metrics_auth_role.yaml
|
||||
- metrics_auth_role_binding.yaml
|
||||
- metrics_reader_role.yaml
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: proxy-role
|
||||
name: metrics-auth-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- authentication.k8s.io
|
||||
@@ -1,11 +1,11 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: proxy-rolebinding
|
||||
name: metrics-auth-rolebinding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: proxy-role
|
||||
name: metrics-auth-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: controller-manager
|
||||
@@ -20,7 +20,6 @@ rules:
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "rbac.authorization.k8s.io"
|
||||
resources:
|
||||
- pods
|
||||
- services
|
||||
@@ -31,6 +30,17 @@ rules:
|
||||
- events
|
||||
- configmaps
|
||||
- secrets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- create
|
||||
- delete
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "rbac.authorization.k8s.io"
|
||||
resources:
|
||||
- roles
|
||||
- rolebindings
|
||||
verbs:
|
||||
@@ -43,12 +53,22 @@ rules:
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apps
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- deployments
|
||||
- daemonsets
|
||||
- replicasets
|
||||
- statefulsets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- create
|
||||
- delete
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
@@ -58,6 +78,18 @@ rules:
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- batch
|
||||
resources:
|
||||
- cronjobs
|
||||
- jobs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- create
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- monitoring.coreos.com
|
||||
resources:
|
||||
@@ -104,3 +136,16 @@ rules:
|
||||
- awxrestores
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- traefik.containo.us
|
||||
- traefik.io
|
||||
resources:
|
||||
- ingressroutetcps
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- create
|
||||
- delete
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
|
||||
8
config/samples/awx_v1alpha1_awxmeshingress.yaml
Normal file
8
config/samples/awx_v1alpha1_awxmeshingress.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Placeholder to pass CI and allow bundle generation
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1alpha1
|
||||
kind: AWXMeshIngress
|
||||
metadata:
|
||||
name: example-awx-mesh-ingress
|
||||
spec:
|
||||
deployment_name: example-awx
|
||||
48
config/samples/awx_v1beta1_awx_resource_limits.yaml
Normal file
48
config/samples/awx_v1beta1_awx_resource_limits.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-with-limits
|
||||
spec:
|
||||
task_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 4Gi
|
||||
web_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
ee_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
redis_resource_requirements:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
rsyslog_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
init_container_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
@@ -3,4 +3,5 @@ resources:
|
||||
- awx_v1beta1_awx.yaml
|
||||
- awx_v1beta1_awxbackup.yaml
|
||||
- awx_v1beta1_awxrestore.yaml
|
||||
- awx_v1alpha1_awxmeshingress.yaml
|
||||
#+kubebuilder:scaffold:manifestskustomizesamples
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- basic-check-spec
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: basic
|
||||
test: basic-check-spec-test
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-bundle-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-bundle-validation-test
|
||||
@@ -14,7 +14,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-crds-have-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-crds-have-validation-test
|
||||
@@ -24,7 +24,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-crds-have-resources
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-crds-have-resources-test
|
||||
@@ -34,7 +34,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-spec-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-spec-descriptors-test
|
||||
@@ -44,7 +44,7 @@
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-status-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.22.2
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-status-descriptors-test
|
||||
|
||||
@@ -7,10 +7,6 @@ namePrefix: osdk-
|
||||
#commonLabels:
|
||||
# someName: someValue
|
||||
|
||||
patchesStrategicMerge:
|
||||
- manager_image.yaml
|
||||
- debug_logs_patch.yaml
|
||||
- ../default/manager_auth_proxy_patch.yaml
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
@@ -18,6 +14,13 @@ resources:
|
||||
- ../crd
|
||||
- ../rbac
|
||||
- ../manager
|
||||
- ../default/metrics_service.yaml
|
||||
images:
|
||||
- name: testing
|
||||
newName: testing-operator
|
||||
patches:
|
||||
- path: manager_image.yaml
|
||||
- path: debug_logs_patch.yaml
|
||||
- path: ../default/manager_metrics_patch.yaml
|
||||
target:
|
||||
kind: Deployment
|
||||
|
||||
24
dev/awx-cr/awx-cr-settings.yml
Normal file
24
dev/awx-cr/awx-cr-settings.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx
|
||||
spec:
|
||||
service_type: clusterip
|
||||
ingress_type: route
|
||||
no_log: false
|
||||
|
||||
# Secrets
|
||||
admin_password_secret: custom-admin-password
|
||||
postgres_configuration_secret: custom-pg-configuration
|
||||
secret_key_secret: custom-secret-key
|
||||
|
||||
# Resource Requirements
|
||||
postgres_storage_requirements:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
# Extra Settings
|
||||
extra_settings:
|
||||
- setting: MAX_PAGE_SIZE
|
||||
value: "500"
|
||||
30
dev/awx-cr/awx-db-configuration.cr.yml
Normal file
30
dev/awx-cr/awx-db-configuration.cr.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx
|
||||
spec:
|
||||
service_type: clusterip
|
||||
ingress_type: Route
|
||||
|
||||
postgres_extra_settings:
|
||||
- setting: max_connections
|
||||
value: "999"
|
||||
- setting: ssl_ciphers
|
||||
value: "HIGH:!aNULL:!MD5"
|
||||
|
||||
# requires custom-postgres-configuration secret to be pre-created
|
||||
# postgres_configuration_secret: custom-postgres-configuration
|
||||
|
||||
postgres_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 800m
|
||||
memory: 1Gi
|
||||
postgres_storage_requirements:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
limits:
|
||||
storage: 100Gi
|
||||
13
dev/awx-cr/awx-k8s-ingress.yml
Normal file
13
dev/awx-cr/awx-k8s-ingress.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx
|
||||
spec:
|
||||
service_type: nodeport
|
||||
ingress_type: ingress
|
||||
|
||||
# Secrets
|
||||
admin_password_secret: custom-admin-password
|
||||
postgres_configuration_secret: custom-pg-configuration
|
||||
secret_key_secret: custom-secret-key
|
||||
13
dev/awx-cr/awx-openshift-cr.yml
Normal file
13
dev/awx-cr/awx-openshift-cr.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx
|
||||
spec:
|
||||
service_type: clusterip
|
||||
ingress_type: Route
|
||||
|
||||
# # Secrets
|
||||
# admin_password_secret: custom-admin-password
|
||||
# postgres_configuration_secret: custom-pg-configuration
|
||||
# secret_key_secret: custom-secret-key
|
||||
7
dev/secrets/admin-password-secret.yml
Normal file
7
dev/secrets/admin-password-secret.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: custom-admin-password
|
||||
stringData:
|
||||
password: 'password'
|
||||
7
dev/secrets/custom-secret-key.yml
Normal file
7
dev/secrets/custom-secret-key.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: custom-secret-key
|
||||
stringData:
|
||||
secret_key: 'awxsecret'
|
||||
12
dev/secrets/external-pg-secret.yml
Normal file
12
dev/secrets/external-pg-secret.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: external-pg-secret
|
||||
stringData:
|
||||
database: 'awx'
|
||||
host: 'awx-postgres'
|
||||
password: 'test'
|
||||
port: '5432'
|
||||
type: 'managed'
|
||||
username: 'awx'
|
||||
16
docs/README.md
Normal file
16
docs/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Building the Ansible AWX Operator Docs
|
||||
|
||||
To build the AWX Operator docs locally:
|
||||
|
||||
1. Clone the AWX operator repository.
|
||||
1. Preferrably, create a virtual environment for installing the dependencies.
|
||||
a. `python3 -m venv venv`
|
||||
b. `source venv/bin/activate`
|
||||
1. From the root directory:
|
||||
a. `pip install -r docs/requirements.txt`
|
||||
b. `mkdocs build`
|
||||
1. View the docs in your browser:
|
||||
a. `mkdocs serve`
|
||||
b. Open your browser and navigate to `http://127.0.0.1:8000/`
|
||||
|
||||
This will create a new directory called `site/` in the root of your clone containing the index.html and static files.
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 825 KiB |
3
docs/contributors-guide/author.md
Normal file
3
docs/contributors-guide/author.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Author
|
||||
|
||||
This operator was originally built in 2019 by [Jeff Geerling](https://www.jeffgeerling.com) and is now maintained by the Ansible Team
|
||||
3
docs/contributors-guide/code-of-conduct.md
Normal file
3
docs/contributors-guide/code-of-conduct.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Code of Conduct
|
||||
|
||||
We ask all of our community members and contributors to adhere to the [Ansible code of conduct](http://docs.ansible.com/ansible/latest/community/code_of_conduct.html). If you have questions or need assistance, please reach out to our community team at [codeofconduct@ansible.com](mailto:codeofconduct@ansible.com)
|
||||
5
docs/contributors-guide/contributing.md
Normal file
5
docs/contributors-guide/contributing.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Contributing
|
||||
|
||||
Please visit [our contributing guidelines](https://github.com/ansible/awx-operator/blob/devel/CONTRIBUTING.md).
|
||||
|
||||
For docs changes, create PRs on the appropriate files in the `/docs` folder.
|
||||
24
docs/contributors-guide/get-involved.md
Normal file
24
docs/contributors-guide/get-involved.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Get Involved
|
||||
|
||||
We welcome your feedback, questions and ideas. Here's how to reach the community.
|
||||
|
||||
## Forum
|
||||
|
||||
Join the [Ansible Forum](https://forum.ansible.com) as a single starting point and our default communication platform for questions and help, development discussions, events, and much more. [Register](https://forum.ansible.com/signup?) to join the community. Search by categories and tags to find interesting topics or start a new one; subscribe only to topics you need!
|
||||
|
||||
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others. Please add appropriate tags if you start new discussions, for example `awx-operator` and `documentation`.
|
||||
* [Posts tagged with 'awx-operator'](https://forum.ansible.com/tag/awx-operator): subscribe to participate in project-related conversations.
|
||||
* [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn) used to announce releases and important changes.
|
||||
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
|
||||
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
|
||||
|
||||
For more information on the forum navigation, see [Navigating the Ansible forum](https://forum.ansible.com/t/navigating-the-ansible-forum-tags-categories-and-concepts/39) post.
|
||||
|
||||
## Matrix
|
||||
|
||||
For real-time interactions, conversations in the community happen over the Matrix protocol in the following channels:
|
||||
|
||||
* [#awx:ansible.com](https://matrix.to/#/#awx:ansible.com): AWX and AWX-Operator project-related discussions.
|
||||
* [#docs:ansible.im](https://matrix.to/#/#docs:ansible.im): Ansible, AWX and AWX-Operator documentation-related discussions.
|
||||
|
||||
For more information, see the community-hosted [Matrix FAQ](https://hackmd.io/@ansible-community/community-matrix-faq).
|
||||
10
docs/contributors-guide/release-process.md
Normal file
10
docs/contributors-guide/release-process.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Release Process
|
||||
|
||||
The first step is to create a draft release. Typically this will happen in the [Stage Release](https://github.com/ansible/awx/blob/devel/.github/workflows/stage.yml) workflow for AWX and you don't need to do it as a separate step.
|
||||
|
||||
If you need to do an independent release of the operator, you can run the [Stage Release](https://github.com/ansible/awx-operator/blob/devel/.github/workflows/stage.yml) in the awx-operator repo. Both of these workflows will run smoke tests, so there is no need to do this manually.
|
||||
|
||||
After the draft release is created, publish it and the [Promote AWX Operator image](https://github.com/ansible/awx-operator/blob/devel/.github/workflows/promote.yaml) will run, which will:
|
||||
|
||||
- Publish image to Quay
|
||||
- Release Helm chart
|
||||
@@ -1,51 +0,0 @@
|
||||
# Iterating on the installer without deploying the operator
|
||||
|
||||
Go through the [normal basic install](https://github.com/ansible/awx-operator/blob/devel/README.md#basic-install) steps.
|
||||
|
||||
Install some dependencies:
|
||||
|
||||
```
|
||||
$ ansible-galaxy collection install -r molecule/requirements.yml
|
||||
$ pip install -r molecule/requirements.txt
|
||||
```
|
||||
|
||||
To prevent the changes we're about to make from being overwritten, scale down any running instance of the operator:
|
||||
|
||||
```
|
||||
$ kubectl scale deployment awx-operator-controller-manager --replicas=0
|
||||
```
|
||||
|
||||
Create a playbook that invokes the installer role (the operator uses ansible-runner's role execution feature):
|
||||
|
||||
```yaml
|
||||
# run.yml
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- installer
|
||||
```
|
||||
|
||||
Create a vars file:
|
||||
|
||||
```yaml
|
||||
# vars.yml
|
||||
---
|
||||
ansible_operator_meta:
|
||||
name: awx
|
||||
namespace: awx
|
||||
service_type: nodeport
|
||||
```
|
||||
|
||||
Run the installer:
|
||||
|
||||
```
|
||||
$ ansible-playbook run.yml -e @vars.yml -v
|
||||
```
|
||||
|
||||
Grab the URL and admin password:
|
||||
|
||||
```
|
||||
$ minikube service awx-service --url -n awx
|
||||
$ minikube kubectl get secret awx-admin-password -- -o jsonpath="{.data.password}" | base64 --decode
|
||||
LU6lTfvnkjUvDwL240kXKy1sNhjakZmT
|
||||
```
|
||||
104
docs/development.md
Normal file
104
docs/development.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# Development Guide
|
||||
|
||||
There are development scripts and yaml examples in the [`dev/`](../dev) directory that, along with the up.sh and down.sh scripts in the root of the repo, can be used to build, deploy and test changes made to the awx-operator.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need to have the following tools installed:
|
||||
|
||||
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||
* [podman](https://podman.io/docs/installation) or [docker](https://docs.docker.com/get-docker/)
|
||||
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
|
||||
* [oc](https://docs.openshift.com/container-platform/4.11/cli_reference/openshift_cli/getting-started-cli.html) (if using Openshift)
|
||||
|
||||
You will also need to have a container registry account. This guide uses quay.io, but any container registry will work. You will need to create a robot account and login at the CLI with `podman login` or `docker login`.
|
||||
|
||||
## Quay.io Setup for Development
|
||||
|
||||
Before using the development scripts, you'll need to set up a Quay.io repository and pull secret:
|
||||
|
||||
### 1. Create a Private Quay.io Repository
|
||||
- Go to [quay.io](https://quay.io) and create a private repository named `awx-operator` under your username
|
||||
- The repository URL should be `quay.io/username/awx-operator`
|
||||
|
||||
### 2. Create a Bot Account
|
||||
- In your Quay.io repository, go to Settings → Robot Accounts
|
||||
- Create a new robot account with write permissions to your repository
|
||||
- Click on the robot account name to view its credentials
|
||||
|
||||
### 3. Generate Kubernetes Pull Secret
|
||||
- In the robot account details, click "Kubernetes Secret"
|
||||
- Copy the generated YAML content from the pop-up
|
||||
|
||||
### 4. Create Local Pull Secret File
|
||||
- Create a file at `hacking/pull-secret.yml` in your awx-operator checkout
|
||||
- Paste the Kubernetes secret YAML content into this file
|
||||
- **Important**: Change the `name` field in the secret from the default to `redhat-operators-pull-secret`
|
||||
- The `hacking/` directory is in `.gitignore`, so this file won't be committed to git
|
||||
|
||||
Example `hacking/pull-secret.yml`:
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: redhat-operators-pull-secret # Change this name
|
||||
namespace: awx
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: <base64-encoded-credentials>
|
||||
```
|
||||
|
||||
## Build and Deploy
|
||||
|
||||
|
||||
If you clone the repo, and make sure you are logged in at the CLI with oc and your cluster, you can run:
|
||||
|
||||
```
|
||||
export QUAY_USER=username
|
||||
export NAMESPACE=awx
|
||||
export TAG=test
|
||||
./up.sh
|
||||
```
|
||||
|
||||
You can add those variables to your .bashrc file so that you can just run `./up.sh` in the future.
|
||||
|
||||
> Note: the first time you run this, it will create quay.io repos on your fork. If you followed the Quay.io setup steps above and created the `hacking/pull-secret.yml` file, the script will automatically handle the pull secret. Otherwise, you will need to either make those repos public, or create a global pull secret on your cluster.
|
||||
|
||||
To get the URL, if on **Openshift**, run:
|
||||
|
||||
```
|
||||
$ oc get route
|
||||
```
|
||||
|
||||
On **k8s with ingress**, run:
|
||||
|
||||
```
|
||||
$ kubectl get ing
|
||||
```
|
||||
|
||||
On **k8s with nodeport**, run:
|
||||
|
||||
```
|
||||
$ kubectl get svc
|
||||
```
|
||||
|
||||
The URL is then `http://<Node-IP>:<NodePort>`
|
||||
|
||||
> Note: NodePort will only work if you expose that port on your underlying k8s node, or are accessing it from localhost.
|
||||
|
||||
By default, the usename and password will be admin and password if using the `up.sh` script because it pre-creates a custom admin password k8s secret and specifies it on the AWX custom resource spec. Without that, a password would have been generated and stored in a k8s secret named <deployment-name>-admin-password.
|
||||
|
||||
## Clean up
|
||||
|
||||
|
||||
Same thing for cleanup, just run ./down.sh and it will clean up your namespace on that cluster
|
||||
|
||||
|
||||
```
|
||||
./down.sh
|
||||
```
|
||||
|
||||
## Running CI tests locally
|
||||
|
||||
More tests coming soon...
|
||||
1
docs/index.md
Symbolic link
1
docs/index.md
Symbolic link
@@ -0,0 +1 @@
|
||||
../README.md
|
||||
177
docs/installation/basic-install.md
Normal file
177
docs/installation/basic-install.md
Normal file
@@ -0,0 +1,177 @@
|
||||
# Basic Install
|
||||
|
||||
After cloning this repository, you must choose the tag to run:
|
||||
|
||||
```sh
|
||||
git clone git@github.com:ansible/awx-operator.git
|
||||
cd awx-operator
|
||||
git tag
|
||||
git checkout tags/<tag>
|
||||
|
||||
# For instance:
|
||||
git checkout tags/2.7.2
|
||||
```
|
||||
|
||||
If you work from a fork and made modifications since the tag was issued, you must provide the VERSION number to deploy. Otherwise the operator will get stuck in "ImagePullBackOff" state:
|
||||
|
||||
```sh
|
||||
export VERSION=<tag>
|
||||
|
||||
# For instance:
|
||||
export VERSION=2.7.2
|
||||
```
|
||||
|
||||
Once you have a running Kubernetes cluster, you can deploy AWX Operator into your cluster using [Kustomize](https://kubectl.docs.kubernetes.io/guides/introduction/kustomize/). Since kubectl version 1.14 kustomize functionality is built-in (otherwise, follow the instructions here to install the latest version of Kustomize: <https://kubectl.docs.kubernetes.io/installation/kustomize/>)
|
||||
|
||||
!!! tip
|
||||
If you don't have a Kubernetes cluster, you can use [Minikube](https://minikube.sigs.k8s.io/docs/) for testing purposes. See the [Minikube install docs](./creating-a-minikube-cluster-for-testing.md) for more details.
|
||||
|
||||
!!! note
|
||||
Some things may need to be configured slightly differently for different Kubernetes flavors for the networking aspects. When installing on Kind, see the [kind install docs](./kind-install.md) for more details.
|
||||
|
||||
There is a make target you can run:
|
||||
|
||||
```sh
|
||||
make deploy
|
||||
```
|
||||
|
||||
If you have a custom operator image you have built, you can specify it with:
|
||||
|
||||
```sh
|
||||
IMG=quay.io/$YOURNAMESPACE/awx-operator:$YOURTAG make deploy
|
||||
```
|
||||
|
||||
Otherwise, you can manually create a file called `kustomization.yaml` with the following content:
|
||||
|
||||
```yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
|
||||
- github.com/ansible/awx-operator/config/default?ref=<tag>
|
||||
|
||||
# Set the image tags to match the git version from above
|
||||
images:
|
||||
- name: quay.io/ansible/awx-operator
|
||||
newTag: <tag>
|
||||
|
||||
# Specify a custom namespace in which to install AWX
|
||||
namespace: awx
|
||||
```
|
||||
|
||||
!!! tip
|
||||
If you need to change any of the default settings for the operator (such as resources.limits), you can add [patches](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/) at the bottom of your kustomization.yaml file.
|
||||
|
||||
Install the manifests by running this:
|
||||
|
||||
```sh
|
||||
$ kubectl apply -k .
|
||||
namespace/awx created
|
||||
customresourcedefinition.apiextensions.k8s.io/awxbackups.awx.ansible.com created
|
||||
customresourcedefinition.apiextensions.k8s.io/awxrestores.awx.ansible.com created
|
||||
customresourcedefinition.apiextensions.k8s.io/awxs.awx.ansible.com created
|
||||
serviceaccount/awx-operator-controller-manager created
|
||||
role.rbac.authorization.k8s.io/awx-operator-awx-manager-role created
|
||||
role.rbac.authorization.k8s.io/awx-operator-leader-election-role created
|
||||
clusterrole.rbac.authorization.k8s.io/awx-operator-metrics-reader created
|
||||
clusterrole.rbac.authorization.k8s.io/awx-operator-proxy-role created
|
||||
rolebinding.rbac.authorization.k8s.io/awx-operator-awx-manager-rolebinding created
|
||||
rolebinding.rbac.authorization.k8s.io/awx-operator-leader-election-rolebinding created
|
||||
clusterrolebinding.rbac.authorization.k8s.io/awx-operator-proxy-rolebinding created
|
||||
configmap/awx-operator-awx-manager-config created
|
||||
service/awx-operator-controller-manager-metrics-service created
|
||||
deployment.apps/awx-operator-controller-manager created
|
||||
```
|
||||
|
||||
Wait a bit and you should have the `awx-operator` running:
|
||||
|
||||
```sh
|
||||
$ kubectl get pods -n awx
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
awx-operator-controller-manager-66ccd8f997-rhd4z 2/2 Running 0 11s
|
||||
```
|
||||
|
||||
So we don't have to keep repeating `-n awx`, let's set the current namespace for `kubectl`:
|
||||
|
||||
```sh
|
||||
kubectl config set-context --current --namespace=awx
|
||||
```
|
||||
|
||||
Next, create a file named `awx-demo.yml` in the same folder with the suggested content below. The `metadata.name` you provide will be the name of the resulting AWX deployment.
|
||||
|
||||
!!! note
|
||||
If you deploy more than one AWX instance to the same namespace, be sure to use unique names.
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
spec:
|
||||
service_type: nodeport
|
||||
```
|
||||
|
||||
!!! tip
|
||||
It may make sense to create and specify your own secret key for your deployment so that if the k8s secret gets deleted, it can be re-created if needed. If it is not provided, one will be auto-generated, but cannot be recovered if lost. Read more [here](../user-guide/admin-user-account-configuration.md#secret-key-configuration).
|
||||
|
||||
If you are on Openshift, you can take advantage of Routes by specifying the following your spec. This will automatically create a Route for you with a custom hostname. This can be found on the Route section of the Openshift Console.
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
spec:
|
||||
service_type: clusterip
|
||||
ingress_type: Route
|
||||
```
|
||||
|
||||
Make sure to add this new file to the list of `resources` in your `kustomization.yaml` file:
|
||||
|
||||
```yaml
|
||||
...
|
||||
resources:
|
||||
- github.com/ansible/awx-operator/config/default?ref=<tag>
|
||||
# Add this extra line:
|
||||
- awx-demo.yml
|
||||
...
|
||||
```
|
||||
|
||||
Finally, apply the changes to create the AWX instance in your cluster:
|
||||
|
||||
```sh
|
||||
kubectl apply -k .
|
||||
```
|
||||
|
||||
After a few seconds, you should see the operator begin to create new resources:
|
||||
|
||||
```sh
|
||||
$ kubectl get pods -l "app.kubernetes.io/managed-by=awx-operator"
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
awx-demo-77d96f88d5-pnhr8 4/4 Running 0 3m24s
|
||||
awx-demo-postgres-0 1/1 Running 0 3m34s
|
||||
|
||||
$ kubectl get svc -l "app.kubernetes.io/managed-by=awx-operator"
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
awx-demo-postgres ClusterIP None <none> 5432/TCP 4m4s
|
||||
awx-demo-service NodePort 10.109.40.38 <none> 80:31006/TCP 3m56s
|
||||
```
|
||||
|
||||
After a few minutes, the new AWX instance will be deployed. You can look at the operator pod logs in order to know where the installation process is at:
|
||||
|
||||
```sh
|
||||
kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager
|
||||
```
|
||||
|
||||
Once deployed, your AWX instance should now be reachable at `http://localhost:<assigned-nodeport>/` (in this case, `http://localhost:31006/`).
|
||||
|
||||
By default, the admin user is `admin` and the password is available in the `<resourcename>-admin-password` secret. To retrieve the admin password, run:
|
||||
|
||||
```sh
|
||||
$ kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo
|
||||
yDL2Cx5Za94g9MvBP6B73nzVLlmfgPjR
|
||||
```
|
||||
|
||||
You just completed the most basic install of an AWX instance via this operator. Congratulations!!!
|
||||
61
docs/installation/creating-a-minikube-cluster-for-testing.md
Normal file
61
docs/installation/creating-a-minikube-cluster-for-testing.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Creating a minikube cluster for testing
|
||||
|
||||
If you do not have an existing cluster, the `awx-operator` can be deployed on a [Minikube](https://minikube.sigs.k8s.io/docs/) cluster for testing purposes. Due to different OS and hardware environments, please refer to the official Minikube documentation for further information.
|
||||
|
||||
```sh
|
||||
$ minikube start --cpus=4 --memory=6g --addons=ingress
|
||||
😄 minikube v1.23.2 on Fedora 34
|
||||
✨ Using the docker driver based on existing profile
|
||||
👍 Starting control plane node minikube in cluster minikube
|
||||
🚜 Pulling base image ...
|
||||
🏃 Updating the running docker "minikube" container ...
|
||||
🐳 Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
|
||||
🔎 Verifying Kubernetes components...
|
||||
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
|
||||
▪ Using image k8s.gcr.io/ingress-nginx/controller:v1.0.0-beta.3
|
||||
▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0
|
||||
▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.0
|
||||
🔎 Verifying ingress addon...
|
||||
🌟 Enabled addons: storage-provisioner, default-storageclass, ingress
|
||||
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
|
||||
```
|
||||
|
||||
Once Minikube is deployed, check if the node(s) and `kube-apiserver` communication is working as expected.
|
||||
|
||||
```sh
|
||||
$ minikube kubectl -- get nodes
|
||||
NAME STATUS ROLES AGE VERSION
|
||||
minikube Ready control-plane,master 113s v1.22.2
|
||||
|
||||
$ minikube kubectl -- get pods -A
|
||||
NAMESPACE NAME READY STATUS RESTARTS AGE
|
||||
ingress-nginx ingress-nginx-admission-create--1-kk67h 0/1 Completed 0 2m1s
|
||||
ingress-nginx ingress-nginx-admission-patch--1-7mp2r 0/1 Completed 1 2m1s
|
||||
ingress-nginx ingress-nginx-controller-69bdbc4d57-bmwg8 1/1 Running 0 2m
|
||||
kube-system coredns-78fcd69978-q7nmx 1/1 Running 0 2m
|
||||
kube-system etcd-minikube 1/1 Running 0 2m12s
|
||||
kube-system kube-apiserver-minikube 1/1 Running 0 2m16s
|
||||
kube-system kube-controller-manager-minikube 1/1 Running 0 2m12s
|
||||
kube-system kube-proxy-5mmnw 1/1 Running 0 2m1s
|
||||
kube-system kube-scheduler-minikube 1/1 Running 0 2m15s
|
||||
kube-system storage-provisioner 1/1 Running 0 2m11s
|
||||
```
|
||||
|
||||
It is not required for `kubectl` to be separately installed since it comes already wrapped inside minikube. As demonstrated above, simply prefix `minikube kubectl --` before kubectl command, i.e. `kubectl get nodes` would become `minikube kubectl -- get nodes`
|
||||
|
||||
Let's create an alias for easier usage:
|
||||
|
||||
```sh
|
||||
alias kubectl="minikube kubectl --"
|
||||
```
|
||||
|
||||
Now, you can proceed with the installation of the AWX Operator and AWX. Please refer to the [Basic Install](basic-install.md) for further instructions.
|
||||
|
||||
!!! tip
|
||||
Once your AWX has been deployed, the AWX instance will be accessible by running:
|
||||
|
||||
```sh
|
||||
minikube service -n awx awx-demo-service --url
|
||||
```
|
||||
|
||||
For an example using the Nginx Ingress Controller in Minikube, don't miss our [demo video](https://asciinema.org/a/416946).
|
||||
119
docs/installation/kind-install.md
Normal file
119
docs/installation/kind-install.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# AWX Operator on Kind
|
||||
|
||||
## Kind Install
|
||||
|
||||
Install Kind by running the following. Refer to the [official Kind documentation](https://kind.sigs.k8s.io/docs/user/quick-start/) for more information.
|
||||
|
||||
```sh
|
||||
# For Intel Macs
|
||||
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-darwin-amd64
|
||||
# For M1 / ARM Macs
|
||||
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-darwin-arm64
|
||||
chmod +x ./kind
|
||||
mv ./kind /some-dir-in-your-PATH/kind
|
||||
```
|
||||
|
||||
### Create the Kind cluster
|
||||
|
||||
Create a file called `kind.config`
|
||||
|
||||
```yaml
|
||||
apiVersion: kind.x-k8s.io/v1alpha4
|
||||
kind: Cluster
|
||||
nodes:
|
||||
- role: control-plane
|
||||
extraPortMappings:
|
||||
- containerPort: 32000
|
||||
hostPort: 32000
|
||||
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
|
||||
protocol: tcp # Optional, defaults to tcp
|
||||
- role: worker
|
||||
```
|
||||
|
||||
Then create a cluster using that config
|
||||
|
||||
```sh
|
||||
kind create cluster --config=kind.config
|
||||
```
|
||||
|
||||
Set cluster context for kubectl
|
||||
|
||||
```sh
|
||||
kubectl cluster-info --context kind-kind
|
||||
```
|
||||
|
||||
Install NGINX Ingress Controller
|
||||
|
||||
```sh
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
|
||||
```
|
||||
|
||||
## AWX
|
||||
|
||||
Set the namespace context
|
||||
|
||||
```sh
|
||||
kubectl config set-context --current --namespace=awx
|
||||
```
|
||||
|
||||
Checkout the tag you want to install from
|
||||
|
||||
```sh
|
||||
git checkout 2.7.2
|
||||
```
|
||||
|
||||
Create a file named `kustomization.yaml` in the root of your local awx-operator clone. Include the following:
|
||||
|
||||
```sh
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
|
||||
- github.com/ansible/awx-operator/config/default?ref=2.7.2
|
||||
|
||||
# Set the image tags to match the git version from above
|
||||
images:
|
||||
- name: quay.io/ansible/awx-operator
|
||||
newTag: 2.7.2
|
||||
|
||||
# Specify a custom namespace in which to install AWX
|
||||
namespace: awx
|
||||
```
|
||||
|
||||
Run the following to apply the yaml
|
||||
|
||||
```sh
|
||||
kubectl apply -k .
|
||||
```
|
||||
|
||||
Create a file called `awx-cr.yaml` with the following contents and any configuration changes you may wish to add.
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
spec:
|
||||
service_type: nodeport
|
||||
nodeport_port: 32000
|
||||
```
|
||||
|
||||
Create your AWX CR
|
||||
|
||||
```sh
|
||||
kubectl create -f awx-cr.yaml
|
||||
```
|
||||
|
||||
Your AWX instance should now be reachable at <http://localhost:32000/>
|
||||
|
||||
!!! note
|
||||
If you configured a custom `nodeport_port`, you can find it by running `kubectl -n awx get svc awx-demo-service`
|
||||
|
||||
## Cleanup
|
||||
|
||||
When you are done, you can delete all of this by running
|
||||
|
||||
```sh
|
||||
kind delete cluster
|
||||
```
|
||||
@@ -19,7 +19,8 @@ stringData:
|
||||
type: Opaque
|
||||
```
|
||||
|
||||
**Note**: `<resourcename>` must match the `name` of the AWX object you are creating. In our example below, it is `awx`.
|
||||
!!! note
|
||||
`<resourcename>` must match the `name` of the AWX object you are creating. In our example below, it is `awx`.
|
||||
|
||||
### Old Database Credentials
|
||||
|
||||
@@ -34,23 +35,21 @@ metadata:
|
||||
namespace: <target namespace>
|
||||
stringData:
|
||||
host: <external ip or url resolvable by the cluster>
|
||||
port: <external port, this usually defaults to 5432>
|
||||
port: "<external port, this usually defaults to 5432>" # quotes are required
|
||||
database: <desired database name>
|
||||
username: <username to connect as>
|
||||
password: <password to connect with>
|
||||
type: Opaque
|
||||
```
|
||||
|
||||
> For `host`, a URL resolvable by the cluster could look something like `postgresql.<namespace>.svc.cluster.local`, where `<namespace>` is filled in with the namespace of the AWX deployment you are migrating data from.
|
||||
!!! note
|
||||
For `host`, a URL resolvable by the cluster could look something like `postgresql.<namespace>.svc.<cluster domain>`, where `<namespace>` is filled in with the namespace of the AWX deployment you are migrating data from, and `<cluster domain>` is filled in with the internal kubernetes cluster domain (In most cases it's `cluster.local`).
|
||||
|
||||
If your AWX deployment is already using an external database server or its database is otherwise not managed
|
||||
by the AWX deployment, you can instead create the same secret as above but omit the `-old-` from the `name`.
|
||||
In the next section pass it in through `postgres_configuration_secret` instead, omitting the `_old_`
|
||||
from the key and ensuring the value matches the name of the secret. This will make AWX pick up on the existing
|
||||
database and apply any pending migrations. It is strongly recommended to backup your database beforehand.
|
||||
If your AWX deployment is already using an external database server or its database is otherwise not managed by the AWX deployment, you can instead create the same secret as above but omit the `-old-` from the `name`.
|
||||
In the next section pass it in through `postgres_configuration_secret` instead, omitting the `_old_` from the key and ensuring the value matches the name of the secret. This will make AWX pick up on the existing database and apply any pending migrations.
|
||||
It is strongly recommended to backup your database beforehand.
|
||||
|
||||
The postgresql pod for the old deployment is used when streaming data to the new postgresql pod. If your postgresql pod has a custom label,
|
||||
you can pass that via the `postgres_label_selector` variable to make sure the postgresql pod can be found.
|
||||
The postgresql pod for the old deployment is used when streaming data to the new postgresql pod. If your postgresql pod has a custom label, you can pass that via the `postgres_label_selector` variable to make sure the postgresql pod can be found.
|
||||
|
||||
## Deploy AWX
|
||||
|
||||
@@ -66,7 +65,16 @@ spec:
|
||||
secret_key_secret: <resourcename>-secret-key
|
||||
...
|
||||
```
|
||||
### Exclude postgreSQL tables during migration (optional)
|
||||
|
||||
Use the `pg_dump_suffix` parameter under `AWX.spec` to customize the pg_dump command that will execute during migration. This variable will append your provided pg_dump parameters to the end of the 'standard' command. For example, to exclude the data from 'main_jobevent' and 'main_job' to decrease the size of the backup use:
|
||||
|
||||
```
|
||||
pg_dump_suffix: "--exclude-table-data 'main_jobevent*' --exclude-table-data 'main_job'"
|
||||
```
|
||||
|
||||
## Important Note
|
||||
|
||||
If you intend to put all the above in one file, make sure to separate each block with three dashes like so:
|
||||
|
||||
```yaml
|
||||
@@ -79,4 +87,5 @@ If you intend to put all the above in one file, make sure to separate each block
|
||||
---
|
||||
# AWX Config
|
||||
```
|
||||
|
||||
Failing to do so will lead to an inoperable setup.
|
||||
3
docs/requirements.in
Normal file
3
docs/requirements.in
Normal file
@@ -0,0 +1,3 @@
|
||||
# This requirements file is used for AWX Operator latest doc builds.
|
||||
|
||||
mkdocs-ansible
|
||||
193
docs/requirements.txt
Normal file
193
docs/requirements.txt
Normal file
@@ -0,0 +1,193 @@
|
||||
#
|
||||
# This file is autogenerated by pip-compile with Python 3.12
|
||||
# by the following command:
|
||||
#
|
||||
# pip-compile --allow-unsafe --output-file=docs/requirements.txt --strip-extras docs/requirements.in
|
||||
#
|
||||
babel==2.14.0
|
||||
# via mkdocs-material
|
||||
beautifulsoup4==4.12.3
|
||||
# via
|
||||
# linkchecker
|
||||
# mkdocs-htmlproofer-plugin
|
||||
# readtime
|
||||
cairocffi==1.6.1
|
||||
# via cairosvg
|
||||
cairosvg==2.7.0
|
||||
# via mkdocs-ansible
|
||||
certifi==2024.2.2
|
||||
# via requests
|
||||
cffi==1.16.0
|
||||
# via cairocffi
|
||||
charset-normalizer==3.3.2
|
||||
# via requests
|
||||
click==8.1.7
|
||||
# via
|
||||
# mkdocs
|
||||
# mkdocstrings
|
||||
colorama==0.4.6
|
||||
# via
|
||||
# griffe
|
||||
# mkdocs-material
|
||||
csscompressor==0.9.5
|
||||
# via mkdocs-minify-plugin
|
||||
cssselect==1.2.0
|
||||
# via pyquery
|
||||
cssselect2==0.7.0
|
||||
# via cairosvg
|
||||
defusedxml==0.7.1
|
||||
# via cairosvg
|
||||
dnspython==2.6.1
|
||||
# via linkchecker
|
||||
ghp-import==2.1.0
|
||||
# via mkdocs
|
||||
griffe==0.40.1
|
||||
# via mkdocstrings-python
|
||||
htmlmin2==0.1.13
|
||||
# via mkdocs-minify-plugin
|
||||
idna==3.6
|
||||
# via requests
|
||||
jinja2==3.1.3
|
||||
# via
|
||||
# mkdocs
|
||||
# mkdocs-macros-plugin
|
||||
# mkdocs-material
|
||||
# mkdocstrings
|
||||
jsmin==3.0.1
|
||||
# via mkdocs-minify-plugin
|
||||
linkchecker==10.4.0
|
||||
# via mkdocs-ansible
|
||||
lxml==5.1.0
|
||||
# via
|
||||
# mkdocs-material
|
||||
# pyquery
|
||||
markdown==3.5.2
|
||||
# via
|
||||
# markdown-include
|
||||
# mkdocs
|
||||
# mkdocs-autorefs
|
||||
# mkdocs-htmlproofer-plugin
|
||||
# mkdocs-material
|
||||
# mkdocstrings
|
||||
# pymdown-extensions
|
||||
markdown-exec==1.8.0
|
||||
# via mkdocs-ansible
|
||||
markdown-include==0.8.1
|
||||
# via mkdocs-ansible
|
||||
markdown2==2.4.12
|
||||
# via readtime
|
||||
markupsafe==2.1.5
|
||||
# via
|
||||
# jinja2
|
||||
# mkdocs
|
||||
# mkdocstrings
|
||||
mergedeep==1.3.4
|
||||
# via mkdocs
|
||||
mkdocs==1.5.3
|
||||
# via
|
||||
# mkdocs-ansible
|
||||
# mkdocs-autorefs
|
||||
# mkdocs-gen-files
|
||||
# mkdocs-htmlproofer-plugin
|
||||
# mkdocs-macros-plugin
|
||||
# mkdocs-material
|
||||
# mkdocs-minify-plugin
|
||||
# mkdocs-monorepo-plugin
|
||||
# mkdocstrings
|
||||
mkdocs-ansible==24.3.1
|
||||
# via -r requirements.in
|
||||
mkdocs-autorefs==0.5.0
|
||||
# via mkdocstrings
|
||||
mkdocs-gen-files==0.5.0
|
||||
# via mkdocs-ansible
|
||||
mkdocs-htmlproofer-plugin==1.0.0
|
||||
# via mkdocs-ansible
|
||||
mkdocs-macros-plugin==1.0.5
|
||||
# via mkdocs-ansible
|
||||
mkdocs-material==9.2.6
|
||||
# via mkdocs-ansible
|
||||
mkdocs-material-extensions==1.3.1
|
||||
# via
|
||||
# mkdocs-ansible
|
||||
# mkdocs-material
|
||||
mkdocs-minify-plugin==0.8.0
|
||||
# via mkdocs-ansible
|
||||
mkdocs-monorepo-plugin==1.1.0
|
||||
# via mkdocs-ansible
|
||||
mkdocstrings==0.24.0
|
||||
# via
|
||||
# mkdocs-ansible
|
||||
# mkdocstrings-python
|
||||
mkdocstrings-python==1.8.0
|
||||
# via mkdocs-ansible
|
||||
packaging==23.2
|
||||
# via mkdocs
|
||||
paginate==0.5.6
|
||||
# via mkdocs-material
|
||||
pathspec==0.12.1
|
||||
# via mkdocs
|
||||
pillow==10.0.1
|
||||
# via
|
||||
# cairosvg
|
||||
# mkdocs-ansible
|
||||
pipdeptree==2.7.1
|
||||
# via mkdocs-ansible
|
||||
platformdirs==4.2.0
|
||||
# via
|
||||
# mkdocs
|
||||
# mkdocstrings
|
||||
pycparser==2.21
|
||||
# via cffi
|
||||
pygments==2.17.2
|
||||
# via mkdocs-material
|
||||
pymdown-extensions==10.0.1
|
||||
# via
|
||||
# markdown-exec
|
||||
# mkdocs-ansible
|
||||
# mkdocs-material
|
||||
# mkdocstrings
|
||||
pyquery==2.0.0
|
||||
# via readtime
|
||||
python-dateutil==2.8.2
|
||||
# via
|
||||
# ghp-import
|
||||
# mkdocs-macros-plugin
|
||||
python-slugify==8.0.4
|
||||
# via mkdocs-monorepo-plugin
|
||||
pyyaml==6.0.1
|
||||
# via
|
||||
# mkdocs
|
||||
# mkdocs-macros-plugin
|
||||
# pymdown-extensions
|
||||
# pyyaml-env-tag
|
||||
pyyaml-env-tag==0.1
|
||||
# via mkdocs
|
||||
readtime==3.0.0
|
||||
# via mkdocs-material
|
||||
regex==2023.12.25
|
||||
# via mkdocs-material
|
||||
requests==2.31.0
|
||||
# via
|
||||
# linkchecker
|
||||
# mkdocs-htmlproofer-plugin
|
||||
# mkdocs-material
|
||||
six==1.16.0
|
||||
# via python-dateutil
|
||||
soupsieve==2.5
|
||||
# via beautifulsoup4
|
||||
termcolor==2.4.0
|
||||
# via mkdocs-macros-plugin
|
||||
text-unidecode==1.3
|
||||
# via python-slugify
|
||||
tinycss2==1.2.1
|
||||
# via
|
||||
# cairosvg
|
||||
# cssselect2
|
||||
urllib3==2.2.1
|
||||
# via requests
|
||||
watchdog==4.0.0
|
||||
# via mkdocs
|
||||
webencodings==0.5.1
|
||||
# via
|
||||
# cssselect2
|
||||
# tinycss2
|
||||
125
docs/troubleshooting/debugging.md
Normal file
125
docs/troubleshooting/debugging.md
Normal file
@@ -0,0 +1,125 @@
|
||||
# Debugging the AWX Operator
|
||||
|
||||
## General Debugging
|
||||
|
||||
When the operator is deploying AWX, it is running the `installer` role inside the operator container. If the AWX CR's status is `Failed`, it is often useful to look at the awx-operator container logs, which shows the output of the installer role. To see these logs, run:
|
||||
|
||||
```sh
|
||||
kubectl logs deployments/awx-operator-controller-manager -c awx-manager -f
|
||||
```
|
||||
|
||||
### Inspect k8s Resources
|
||||
|
||||
Past that, it is often useful to inspect various resources the AWX Operator manages like:
|
||||
|
||||
* awx
|
||||
* awxbackup
|
||||
* awxrestore
|
||||
* pod
|
||||
* deployment
|
||||
* pvc
|
||||
* service
|
||||
* ingress
|
||||
* route
|
||||
* secrets
|
||||
* serviceaccount
|
||||
|
||||
To inspect these resources you can use these commands
|
||||
|
||||
```sh
|
||||
# Inspecting k8s resources
|
||||
kubectl describe -n <namespace> <resource> <resource-name>
|
||||
kubectl get -n <namespace> <resource> <resource-name> -o yaml
|
||||
kubectl logs -n <namespace> <resource> <resource-name>
|
||||
|
||||
# Inspecting Pods
|
||||
kubectl exec -it -n <namespace> <pod> <pod-name>
|
||||
```
|
||||
|
||||
### Configure No Log
|
||||
|
||||
It is possible to show task output for debugging by setting no_log to false on the AWX CR spec.
|
||||
This will show output in the awx-operator logs for any failed tasks where no_log was set to true.
|
||||
|
||||
For example:
|
||||
|
||||
```sh
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
spec:
|
||||
service_type: nodeport
|
||||
no_log: false # <------------
|
||||
|
||||
```
|
||||
|
||||
## Iterating on the installer without deploying the operator
|
||||
|
||||
Go through the [normal basic install](../installation/basic-install.md) steps.
|
||||
|
||||
Install some dependencies:
|
||||
|
||||
```sh
|
||||
ansible-galaxy collection install -r molecule/requirements.yml
|
||||
pip install -r molecule/requirements.txt
|
||||
```
|
||||
|
||||
To prevent the changes we're about to make from being overwritten, scale down any running instance of the operator:
|
||||
|
||||
```sh
|
||||
kubectl scale deployment awx-operator-controller-manager --replicas=0
|
||||
```
|
||||
|
||||
Create a playbook that invokes the installer role (the operator uses ansible-runner's role execution feature):
|
||||
|
||||
```yaml
|
||||
# run.yml
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- installer
|
||||
```
|
||||
|
||||
Create a vars file:
|
||||
|
||||
```yaml
|
||||
# vars.yml
|
||||
---
|
||||
ansible_operator_meta:
|
||||
name: awx
|
||||
namespace: awx
|
||||
set_self_labels: false
|
||||
update_status: false
|
||||
service_type: nodeport
|
||||
```
|
||||
|
||||
The vars file will replace the awx resource so any value that you wish to over ride using the awx resource, put in the vars file. For example, if you wish to use your own image, version and pull policy, you can specify it like below:
|
||||
|
||||
```yaml
|
||||
# vars.yml
|
||||
---
|
||||
ansible_operator_meta:
|
||||
name: awx
|
||||
namespace: awx
|
||||
set_self_labels: false
|
||||
update_status: false
|
||||
service_type: nodeport
|
||||
image: $DEV_DOCKER_TAG_BASE/awx_kube_devel
|
||||
image_pull_policy: Always
|
||||
image_version: $COMPOSE_TAG
|
||||
```
|
||||
|
||||
Run the installer:
|
||||
|
||||
```sh
|
||||
ansible-playbook run.yml -e @vars.yml -v
|
||||
```
|
||||
|
||||
Grab the URL and admin password:
|
||||
|
||||
```sh
|
||||
$ kubectl get secret awx-admin-password -- -o jsonpath="{.data.password}" | base64 --decode ; echo
|
||||
LU6lTfvnkjUvDwL240kXKy1sNhjakZmT
|
||||
```
|
||||
13
docs/uninstall/uninstall.md
Normal file
13
docs/uninstall/uninstall.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Uninstall
|
||||
|
||||
To uninstall an AWX deployment instance, you basically need to remove the AWX kind related to that instance. For example, to delete an AWX instance named awx-demo, you would do:
|
||||
|
||||
```sh
|
||||
$ kubectl delete awx awx-demo
|
||||
awx.awx.ansible.com "awx-demo" deleted
|
||||
```
|
||||
|
||||
Deleting an AWX instance will remove all related deployments and statefulsets, however, persistent volumes and secrets will remain. To enforce secrets also getting removed, you can use `garbage_collect_secrets: true`.
|
||||
|
||||
!!! note
|
||||
If you ever intend to recover an AWX from an existing database you will need a copy of the secrets in order to perform a successful recovery.
|
||||
56
docs/upgrade/upgrading.md
Normal file
56
docs/upgrade/upgrading.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Upgrading
|
||||
|
||||
To upgrade AWX, it is recommended to upgrade the awx-operator to the version that maps to the desired version of AWX. To find the version of AWX that will be installed by the awx-operator by default, check the version specified in the `DEFAULT_AWX_VERSION` variable for that particular release. You can do so by running the following command
|
||||
|
||||
```shell
|
||||
AWX_OPERATOR_VERSION=2.8.0
|
||||
docker run --entrypoint="" quay.io/ansible/awx-operator:$AWX_OPERATOR_VERSION bash -c "env | grep DEFAULT_AWX_VERSION"
|
||||
```
|
||||
|
||||
Make sure you have a backup before upgrading, then upgrade operator by invoking `make deploy` on the desired tag or by applying the `kustomization.yaml` that contains desired version of the operator, and in turn also upgrade your AWX deployment.
|
||||
|
||||
## Backup
|
||||
|
||||
The first part of any upgrade should be a backup. Note, there are secrets in the pod which work in conjunction with the database. Having just a database backup without the required secrets will not be sufficient for recovering from an issue when upgrading to a new version. See the [backup role documentation](https://github.com/ansible/awx-operator/tree/devel/roles/backup) for information on how to backup your database and secrets.
|
||||
|
||||
In the event you need to recover the backup see the [restore role documentation](https://github.com/ansible/awx-operator/tree/devel/roles/restore). _Before Restoring from a backup_, be sure to:
|
||||
|
||||
- delete the old existing AWX CR
|
||||
- delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-15-<deployment-name>-postgres-15-0`
|
||||
|
||||
**Note**: Do not delete the namespace/project, as that will delete the backup and the backup's PVC as well.
|
||||
|
||||
## PostgreSQL Upgrade Considerations
|
||||
|
||||
If there is a PostgreSQL major version upgrade, after the data directory on the PVC is migrated to the new version, the old PVC is kept by default.
|
||||
This provides the ability to roll back if needed, but can take up extra storage space in your cluster unnecessarily. You can configure it to be deleted automatically after a successful upgrade by setting the following variable on the AWX spec.
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
postgres_keep_pvc_after_upgrade: False
|
||||
```
|
||||
|
||||
## Caveats for upgrading to v0.14.0
|
||||
|
||||
### Cluster-scope to Namespace-scope considerations
|
||||
|
||||
Starting with awx-operator 0.14.0, AWX can only be deployed in the namespace that the operator exists in. This is called a namespace-scoped operator. If you are upgrading from an earlier version, you will want to delete your existing `awx-operator` service account, role and role binding.
|
||||
|
||||
### Project is now based on v1.x of the operator-sdk project
|
||||
|
||||
Starting with awx-operator 0.14.0, the project is now based on operator-sdk 1.x. You may need to manually delete your old operator Deployment to avoid issues.
|
||||
|
||||
### Steps to upgrade to v0.14.0
|
||||
|
||||
Delete your old AWX Operator and existing `awx-operator` service account, role and role binding in `default` namespace first:
|
||||
|
||||
```sh
|
||||
kubectl -n default delete deployment awx-operator
|
||||
kubectl -n default delete serviceaccount awx-operator
|
||||
kubectl -n default delete clusterrolebinding awx-operator
|
||||
kubectl -n default delete clusterrole awx-operator
|
||||
```
|
||||
|
||||
Then install the new AWX Operator by following the instructions in [Basic Install](../installation/basic-install.md). The `NAMESPACE` environment variable have to be the name of the namespace in which your old AWX instance resides.
|
||||
|
||||
Once the new AWX Operator is up and running, your AWX deployment will also be upgraded.
|
||||
64
docs/user-guide/admin-user-account-configuration.md
Normal file
64
docs/user-guide/admin-user-account-configuration.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Admin user account configuration
|
||||
|
||||
There are three variables that are customizable for the admin user account creation.
|
||||
|
||||
| Name | Description | Default |
|
||||
| --------------------- | -------------------------------------------- | ------------------ |
|
||||
| admin_user | Name of the admin user | `admin` |
|
||||
| admin_email | Email of the admin user | `test@example.com` |
|
||||
| admin_password_secret | Secret that contains the admin user password | Empty string |
|
||||
|
||||
!!! warning
|
||||
`admin_password_secret` must be a Kubernetes secret and not your text clear password.
|
||||
|
||||
If `admin_password_secret` is not provided, the operator will look for a secret named `<resourcename>-admin-password` for the admin password. If it is not present, the operator will generate a password and create a Secret from it named `<resourcename>-admin-password`.
|
||||
|
||||
To retrieve the admin password, run `kubectl get secret <resourcename>-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo`
|
||||
|
||||
The secret that is expected to be passed should be formatted as follow:
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: <resourcename>-admin-password
|
||||
namespace: <target namespace>
|
||||
stringData:
|
||||
password: mysuperlongpassword
|
||||
```
|
||||
|
||||
## Secret Key Configuration
|
||||
|
||||
This key is used to encrypt sensitive data in the database.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ----------------- | ----------------------------------------------------- | ---------------- |
|
||||
| secret_key_secret | Secret that contains the symmetric key for encryption | Generated |
|
||||
|
||||
!!! warning
|
||||
`secret_key_secret` must be a Kubernetes secret and not your text clear secret value.
|
||||
|
||||
If `secret_key_secret` is not provided, the operator will look for a secret named `<resourcename>-secret-key` for the secret key. If it is not present, the operator will generate a password and create a Secret from it named `<resourcename>-secret-key`. It is important to not delete this secret as it will be needed for upgrades and if the pods get scaled down at any point. If you are using a GitOps flow, you will want to pass a secret key secret.
|
||||
|
||||
The secret should be formatted as follow:
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: custom-awx-secret-key
|
||||
namespace: <target namespace>
|
||||
stringData:
|
||||
secret_key: supersecuresecretkey
|
||||
```
|
||||
|
||||
Then specify the secret name on the AWX spec:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
secret_key_secret: custom-awx-secret-key
|
||||
```
|
||||
@@ -0,0 +1,95 @@
|
||||
# Assigning AWX pods to specific nodes
|
||||
|
||||
You can constrain the AWX pods created by the operator to run on a certain subset of nodes. `node_selector` and `postgres_selector` constrains
|
||||
the AWX pods to run only on the nodes that match all the specified key/value pairs. `tolerations` and `postgres_tolerations` allow the AWX
|
||||
pods to be scheduled onto nodes with matching taints.
|
||||
The ability to specify topologySpreadConstraints is also allowed through `topology_spread_constraints`
|
||||
If you want to use affinity rules for your AWX pod you can use the `affinity` option.
|
||||
|
||||
If you want to constrain the web and task pods individually, you can do so by specifying the deployment type before the specific setting. For
|
||||
example, specifying `task_tolerations` will allow the AWX task pod to be scheduled onto nodes with matching taints.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------------------------- | ---------------------------------------- | -------------------------------- |
|
||||
| postgres_image | Path of the image to pull | quay.io/sclorg/postgresql-15-c9s |
|
||||
| postgres_image_version | Image version to pull | latest |
|
||||
| node_selector | AWX pods' nodeSelector | '' |
|
||||
| web_node_selector | AWX web pods' nodeSelector | '' |
|
||||
| task_node_selector | AWX task pods' nodeSelector | '' |
|
||||
| topology_spread_constraints | AWX pods' topologySpreadConstraints | '' |
|
||||
| web_topology_spread_constraints | AWX web pods' topologySpreadConstraints | '' |
|
||||
| task_topology_spread_constraints | AWX task pods' topologySpreadConstraints | '' |
|
||||
| affinity | AWX pods' affinity rules | '' |
|
||||
| web_affinity | AWX web pods' affinity rules | '' |
|
||||
| task_affinity | AWX task pods' affinity rules | '' |
|
||||
| tolerations | AWX pods' tolerations | '' |
|
||||
| web_tolerations | AWX web pods' tolerations | '' |
|
||||
| task_tolerations | AWX task pods' tolerations | '' |
|
||||
| annotations | AWX pods' annotations | '' |
|
||||
| postgres_selector | Postgres pods' nodeSelector | '' |
|
||||
| postgres_tolerations | Postgres pods' tolerations | '' |
|
||||
|
||||
Example of customization could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
node_selector: |
|
||||
disktype: ssd
|
||||
kubernetes.io/arch: amd64
|
||||
kubernetes.io/os: linux
|
||||
topology_spread_constraints: |
|
||||
- maxSkew: 100
|
||||
topologyKey: "topology.kubernetes.io/zone"
|
||||
whenUnsatisfiable: "ScheduleAnyway"
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: "<resourcename>"
|
||||
tolerations: |
|
||||
- key: "dedicated"
|
||||
operator: "Equal"
|
||||
value: "AWX"
|
||||
effect: "NoSchedule"
|
||||
task_tolerations: |
|
||||
- key: "dedicated"
|
||||
operator: "Equal"
|
||||
value: "AWX_task"
|
||||
effect: "NoSchedule"
|
||||
postgres_selector: |
|
||||
disktype: ssd
|
||||
kubernetes.io/arch: amd64
|
||||
kubernetes.io/os: linux
|
||||
postgres_tolerations: |
|
||||
- key: "dedicated"
|
||||
operator: "Equal"
|
||||
value: "AWX"
|
||||
effect: "NoSchedule"
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: another-node-label-key
|
||||
operator: In
|
||||
values:
|
||||
- another-node-label-value
|
||||
- another-node-label-value
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: security
|
||||
operator: In
|
||||
values:
|
||||
- S2
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
```
|
||||
|
||||
## Special Note on DB-Migration Job Scheduling
|
||||
|
||||
For the **db-migration job**, which applies database migrations at cluster startup, you can specify scheduling settings using the `task_*` configurations such as `task_node_selector`, `task_tolerations`, etc.
|
||||
If these task-specific settings are not defined, the job will automatically use the global AWX configurations like `node_selector` and `tolerations`.
|
||||
37
docs/user-guide/advanced-configuration/auto-upgrade.md
Normal file
37
docs/user-guide/advanced-configuration/auto-upgrade.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Auto upgrade
|
||||
|
||||
With this parameter you can influence the behavior during an operator upgrade.
|
||||
If set to `true`, the operator will upgrade the specific instance directly.
|
||||
When the value is set to `false`, and we have a running deployment, the operator will not update the AWX instance.
|
||||
This can be useful when you have multiple AWX instances which you want to upgrade step by step instead of all at once.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------| ---------------------------------- | ------- |
|
||||
| auto_upgrade | Automatic upgrade of AWX instances | true |
|
||||
|
||||
Example configuration of `auto_upgrade` parameter
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
auto_upgrade: true
|
||||
```
|
||||
|
||||
## Upgrade of instances without auto upgrade
|
||||
|
||||
There are two ways to upgrade instances which are marked with the 'auto_upgrade: false' flag.
|
||||
|
||||
Changing flags:
|
||||
|
||||
- change the auto_upgrade flag on your AWX object to true
|
||||
- wait until the upgrade process of that instance is finished
|
||||
- change the auto_upgrade flag on your AWX object back to false
|
||||
|
||||
Delete the deployment:
|
||||
|
||||
- delete the deployment object of your AWX instance
|
||||
|
||||
```sh
|
||||
kubectl -n awx delete deployment <yourInstanceName>
|
||||
```
|
||||
|
||||
- wait until the instance gets redeployed
|
||||
53
docs/user-guide/advanced-configuration/container-probes.md
Normal file
53
docs/user-guide/advanced-configuration/container-probes.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Container Probes
|
||||
|
||||
These parameters control the usage of liveness and readiness container probes for
|
||||
the web and task containers.
|
||||
|
||||
!!! tip
|
||||
All of probes are disabled by default for now, to enable it, set the `*_period` parameters. For example:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
web_liveness_period: 15
|
||||
web_readiness_period: 15
|
||||
task_liveness_period: 15
|
||||
task_readiness_period: 15
|
||||
```
|
||||
|
||||
## Web / Task Container Liveness Check
|
||||
|
||||
The liveness probe queries the status of the supervisor daemon of the container. The probe will fail if it
|
||||
detects one of the services in a state other than "RUNNING".
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------| -----------------------------------|---------|
|
||||
| web_liveness_period | Time period in seconds between each probe check. The value of 0 disables the probe. | 0 |
|
||||
| web_liveness_initial_delay | Initial delay before starting probes in seconds | 5 |
|
||||
| web_liveness_failure_threshold| Number of consecutive failure events to identify failure of container | 3 |
|
||||
| web_liveness_timeout | Number of seconds to wait for a probe response from container | 1 |
|
||||
| task_liveness_period | Time period in seconds between each probe check. The value of 0 disables the probe. | 0 |
|
||||
| task_liveness_initial_delay | Initial delay before starting probes in seconds | 5 |
|
||||
| task_liveness_failure_threshold| Number of consecutive failure events to identify failure of container | 3 |
|
||||
| task_liveness_timeout | Number of seconds to wait for a probe response from container | 1 |
|
||||
|
||||
## Web Container Readiness Check
|
||||
|
||||
This is an HTTP check against the status endpoint to confirm the system is still able to respond to web requests.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------| ---------------------------------- | ------- |
|
||||
| web_readiness_period | Time period in seconds between each probe check. The value of 0 disables the probe. | 0 |
|
||||
| web_readiness_initial_delay | Initial delay before starting probes in seconds | 5 |
|
||||
| web_readiness_failure_threshold| Number of consecutive failure events to identify failure of container | 3 |
|
||||
| web_readiness_timeout | Number of seconds to wait for a probe response from container | 1 |
|
||||
|
||||
## Task Container Readiness Check
|
||||
|
||||
This is a command probe using the builtin check command of the awx-manage utility.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------| ---------------------------------- | ------- |
|
||||
| task_readiness_period | Time period in seconds between each probe check. The value of 0 disables the probe. | 0 |
|
||||
| task_readiness_initial_delay | Initial delay before starting probes in seconds | 5 |
|
||||
| task_readiness_failure_threshold| Number of consecutive failure events to identify failure of container | 3 |
|
||||
| task_readiness_timeout | Number of seconds to wait for a probe response from container | 1 |
|
||||
@@ -0,0 +1,72 @@
|
||||
# Containers Resource Requirements
|
||||
|
||||
The resource requirements for both, the task and the web containers are configurable - both the lower end (requests) and the upper end (limits).
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------------------------------------ | ------------------------------------------------------------ | ------------------------------------ |
|
||||
| web_resource_requirements | Web container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||
| task_resource_requirements | Task container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||
| ee_resource_requirements | EE control plane container resource requirements | requests: {cpu: 50m, memory: 64Mi} |
|
||||
| redis_resource_requirements | Redis container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||
| postgres_resource_requirements | Postgres container (and initContainer) resource requirements | requests: {cpu: 10m, memory: 64Mi} |
|
||||
| rsyslog_resource_requirements | Rsyslog container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||
| init_container_resource_requirements | Init Container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||
|
||||
Example of customization could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
|
||||
task_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
ephemeral-storage: 100M
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 4Gi
|
||||
ephemeral-storage: 500M
|
||||
web_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
ee_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
redis_resource_requirements:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
rsyslog_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
init_container_resource_requirements:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
```
|
||||
|
||||
## Limits and ResourceQuotas
|
||||
|
||||
If the cluster you are deploying in has a ResoruceQuota, you will need to configure resource limits for all of the pods deployed in that cluster. This can be done for AWX pods on the AWX spec in the manner shown above.
|
||||
|
||||
There is an example you can use in [`awx_v1beta1_awx_resource_limits.yaml`](https://raw.githubusercontent.com/ansible/awx-operator/devel/config/samples/awx_v1beta1_awx_resource_limits.yaml).
|
||||
@@ -0,0 +1,14 @@
|
||||
# CSRF Cookie Secure Setting
|
||||
|
||||
With `csrf_cookie_secure`, you can pass the value for `CSRF_COOKIE_SECURE` to `/etc/tower/settings.py`
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------------------ | ------------------ | ------- |
|
||||
| csrf_cookie_secure | CSRF Cookie Secure | '' |
|
||||
|
||||
Example configuration of the `csrf_cookie_secure` setting:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
csrf_cookie_secure: 'False'
|
||||
```
|
||||
@@ -0,0 +1,24 @@
|
||||
# Custom Receptor CA
|
||||
|
||||
The control nodes on the K8S cluster will communicate with execution nodes via mutual TLS TCP connections, running via Receptor.
|
||||
Execution nodes will verify incoming connections by ensuring the x509 certificate was issued by a trusted Certificate Authority (CA).
|
||||
|
||||
A user may wish to provide their own CA for this validation. If no CA is provided, AWX Operator will automatically generate one using OpenSSL.
|
||||
|
||||
Given custom `ca.crt` and `ca.key` stored locally, run the following,
|
||||
|
||||
```bash
|
||||
kubectl create secret tls awx-demo-receptor-ca \
|
||||
--cert=/path/to/ca.crt --key=/path/to/ca.key
|
||||
```
|
||||
|
||||
The secret should be named `{AWX Custom Resource name}-receptor-ca`. In the above the AWX CR name is "awx-demo". Please replace "awx-demo" with your AWX Custom Resource name.
|
||||
|
||||
If this secret is created after AWX is deployed, run the following to restart the deployment,
|
||||
|
||||
```bash
|
||||
kubectl rollout restart deployment awx-demo
|
||||
```
|
||||
|
||||
!!! warning
|
||||
Changing the receptor CA will break connections to any existing execution nodes. These nodes will enter an `unavailable` state, and jobs will not be able to run on them. Users will need to download and re-run the install bundle for each execution node. This will replace the TLS certificate files with those signed by the new CA. The execution nodes should then appear in a `ready` state after a few minutes.
|
||||
@@ -0,0 +1,194 @@
|
||||
# Custom Volume and Volume Mount Options
|
||||
|
||||
In a scenario where custom volumes and volume mounts are required to either overwrite defaults or mount configuration files.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ---------------------------------- | -------------------------------------------------------- | ------- |
|
||||
| extra_volumes | Specify extra volumes to add to the application pod | '' |
|
||||
| web_extra_volume_mounts | Specify volume mounts to be added to Web container | '' |
|
||||
| task_extra_volume_mounts | Specify volume mounts to be added to Task container | '' |
|
||||
| rsyslog_extra_volume_mounts | Specify volume mounts to be added to Rsyslog container | '' |
|
||||
| ee_extra_volume_mounts | Specify volume mounts to be added to Execution container | '' |
|
||||
| init_container_extra_volume_mounts | Specify volume mounts to be added to Init container | '' |
|
||||
| init_container_extra_commands | Specify additional commands for Init container | '' |
|
||||
|
||||
!!! warning
|
||||
The `ee_extra_volume_mounts` and `extra_volumes` will only take effect to the globally available Execution Environments. For custom `ee`, please [customize the Pod spec](https://docs.ansible.com/ansible-tower/latest/html/administration/external_execution_envs.html#customize-the-pod-spec).
|
||||
|
||||
Example configuration for ConfigMap
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: <resourcename>-extra-config
|
||||
namespace: <target namespace>
|
||||
data:
|
||||
ansible.cfg: |
|
||||
[defaults]
|
||||
remote_tmp = /tmp
|
||||
[ssh_connection]
|
||||
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
|
||||
```
|
||||
|
||||
Example spec file for volumes and volume mounts
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
extra_volumes: |
|
||||
- name: ansible-cfg
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: ansible.cfg
|
||||
path: ansible.cfg
|
||||
name: <resourcename>-extra-config
|
||||
- name: shared-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: my-external-volume-claim
|
||||
|
||||
init_container_extra_volume_mounts: |
|
||||
- name: shared-volume
|
||||
mountPath: /shared
|
||||
|
||||
init_container_extra_commands: |
|
||||
# set proper permissions (rwx) for the awx user
|
||||
chmod 775 /shared
|
||||
chgrp 1000 /shared
|
||||
|
||||
ee_extra_volume_mounts: |
|
||||
- name: ansible-cfg
|
||||
mountPath: /etc/ansible/ansible.cfg
|
||||
subPath: ansible.cfg
|
||||
```
|
||||
|
||||
!!! warning
|
||||
**Volume and VolumeMount names cannot contain underscores(_)**
|
||||
|
||||
## Custom UWSGI Configuration
|
||||
|
||||
We allow the customization of two UWSGI parameters:
|
||||
|
||||
* [processes](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#processes) with `uwsgi_processes` (default 5)
|
||||
* [listen](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#listen) with `uwsgi_listen_queue_size` (default 128)
|
||||
|
||||
**Note:** Increasing the listen queue beyond 128 requires that the sysctl setting net.core.somaxconn be set to an equal value or higher.
|
||||
The operator will set the appropriate securityContext sysctl value for you, but it is a required that this sysctl be added to an allowlist on the kubelet level. [See kubernetes docs about allowing this sysctl setting](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#enabling-unsafe-sysctls).
|
||||
|
||||
These vars relate to the vertical and horizontal scalibility of the web service.
|
||||
|
||||
Increasing the number of processes allows more requests to be actively handled
|
||||
per web pod, but will consume more CPU and Memory and the resource requests
|
||||
should be increased in tandem. Increasing the listen queue allows uwsgi to
|
||||
queue up requests not yet being handled by the active worker processes, which
|
||||
may allow the web pods to handle more "bursty" request patterns if many
|
||||
requests (more than 128) tend to come in a short period of time, but can all be
|
||||
handled before any other time outs may apply. Also see related nginx
|
||||
configuration.
|
||||
|
||||
## Custom Nginx Configuration
|
||||
|
||||
Using the [extra_volumes feature](#custom-volume-and-volume-mount-options), it is possible to extend the nginx.conf.
|
||||
|
||||
1. Create a ConfigMap with the extra settings you want to include in the nginx.conf
|
||||
2. Create an extra_volumes entry in the AWX spec for this ConfigMap
|
||||
3. Create an web_extra_volume_mounts entry in the AWX spec to mount this volume
|
||||
|
||||
The AWX nginx config automatically includes /etc/nginx/conf.d/*.conf if present.
|
||||
|
||||
Additionally there are some global configuration values in the base nginx
|
||||
config that are available for setting with individual variables.
|
||||
These vars relate to the vertical and horizontal scalibility of the web service.
|
||||
Increasing the number of processes allows more requests to be actively handled
|
||||
per web pod, but will consume more CPU and Memory and the resource requests
|
||||
should be increased in tandem. Increasing the listen queue allows nginx to
|
||||
queue up requests not yet being handled by the active worker processes, which
|
||||
may allow the web pods to handle more "bursty" request patterns if many
|
||||
requests (more than 128) tend to come in a short period of time, but can all be
|
||||
handled before any other time outs may apply. Also see related uwsgi
|
||||
configuration.
|
||||
|
||||
* [worker_processes](http://nginx.org/en/docs/ngx_core_module.html#worker_processes) with `nginx_worker_processes` (default of 1)
|
||||
* [worker_cpu_affinity](http://nginx.org/en/docs/ngx_core_module.html#worker_cpu_affinity) with `nginx_worker_cpu_affinity` (default "auto")
|
||||
* [worker_connections](http://nginx.org/en/docs/ngx_core_module.html#worker_connections) with `nginx_worker_connections` (minimum of 1024)
|
||||
* [listen](https://nginx.org/en/docs/http/ngx_http_core_module.html#listen) with `nginx_listen_queue_size` (default same as uwsgi listen queue size)
|
||||
* [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size) with `nginx_client_max_body_size` (default of 5M)
|
||||
|
||||
## Custom Logos
|
||||
|
||||
You can use custom volume mounts to mount in your own logos to be displayed instead of the AWX logo.
|
||||
There are two different logos, one to be displayed on page headers, and one for the login screen.
|
||||
|
||||
First, create configmaps for the logos from local `logo-login.svg` and `logo-header.svg` files.
|
||||
|
||||
```bash
|
||||
kubectl create configmap logo-login-configmap --from-file logo-login.svg
|
||||
kubectl create configmap logo-header-configmap --from-file logo-header.svg
|
||||
```
|
||||
|
||||
Then specify the extra_volume and web_extra_volume_mounts on your AWX CR spec
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
extra_volumes: |
|
||||
- name: logo-login
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: logo-login.svg
|
||||
path: logo-login.svg
|
||||
name: logo-login-configmap
|
||||
- name: logo-header
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: logo-header.svg
|
||||
path: logo-header.svg
|
||||
name: logo-header-configmap
|
||||
web_extra_volume_mounts: |
|
||||
- name: logo-login
|
||||
mountPath: /var/lib/awx/public/static/media/logo-login.svg
|
||||
subPath: logo-login.svg
|
||||
- name: logo-header
|
||||
mountPath: /var/lib/awx/public/static/media/logo-header.svg
|
||||
subPath: logo-header.svg
|
||||
```
|
||||
|
||||
## Custom Favicon
|
||||
|
||||
You can also use custom volume mounts to mount in your own favicon to be displayed in your AWX browser tab.
|
||||
|
||||
First, create the configmap from a local `favicon.ico` file.
|
||||
|
||||
```bash
|
||||
kubectl create configmap favicon-configmap --from-file favicon.ico
|
||||
```
|
||||
|
||||
Then specify the extra_volume and web_extra_volume_mounts on your AWX CR spec
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
extra_volumes: |
|
||||
- name: favicon
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: favicon.ico
|
||||
path: favicon.ico
|
||||
name: favicon-configmap
|
||||
web_extra_volume_mounts: |
|
||||
- name: favicon
|
||||
mountPath: /var/lib/awx/public/static/media/favicon.ico
|
||||
subPath: favicon.ico
|
||||
```
|
||||
|
||||
## Custom AWX Configuration
|
||||
|
||||
Refer to the [Extra Settings](./extra-settings.md) documentation for customizing the AWX configuration.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Using images from private registries
|
||||
|
||||
## Available variables to use images from private registries
|
||||
|
||||
There are variables that are customizable for awx the image management.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ----------------------------- | ----------------------------- | ------------------------------------------ |
|
||||
| image | Path of the image to pull | quay.io/ansible/awx |
|
||||
| image_version | Image version to pull | value of DEFAULT_AWX_VERSION or latest |
|
||||
| image_pull_policy | The pull policy to adopt | IfNotPresent |
|
||||
| image_pull_secrets | The pull secrets to use | None |
|
||||
| ee_images | A list of EEs to register | quay.io/ansible/awx-ee:DEFAULT_AWX_VERSION |
|
||||
| ee_pull_credentials_secret | The pull secret for ee_images | None |
|
||||
| redis_image | Path of the image to pull | docker.io/redis |
|
||||
| redis_image_version | Image version to pull | latest |
|
||||
| control_plane_ee_image | Image version to pull | quay.io/ansible/awx-ee:DEFAULT_AWX_VERSION |
|
||||
| init_container_image | Path of the image to pull | quay.io/ansible/awx-ee |
|
||||
| init_container_image_version | Image version to pull | value of DEFAULT_AWX_VERSION or latest |
|
||||
| init_projects_container_image | Image version to pull | quay.io/centos/centos:stream9 |
|
||||
|
||||
Example of customization could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
image: myorg/my-custom-awx
|
||||
image_version: latest
|
||||
image_pull_policy: Always
|
||||
image_pull_secrets:
|
||||
- pull_secret_name
|
||||
ee_images:
|
||||
- name: my-custom-awx-ee
|
||||
image: myorg/my-custom-awx-ee
|
||||
control_plane_ee_image: myorg/my-custom-awx-ee:latest
|
||||
init_container_image: myorg/my-custom-awx-ee
|
||||
init_container_image_version: latest
|
||||
init_projects_container_image: myorg/my-mirrored-centos:stream9
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The `image` and `image_version` are intended for local mirroring scenarios. Please note that using a version of AWX other than the one bundled with the `awx-operator` is **not** supported. For the default values, check the [main.yml](https://github.com/ansible/awx-operator/blob/devel/roles/installer/defaults/main.yml) file.
|
||||
|
||||
## Default execution environments from private registries
|
||||
|
||||
In order to register default execution environments from private registries, the Custom Resource needs to know about the pull credentials. Those credentials should be stored as a secret and either specified as `ee_pull_credentials_secret` at the CR spec level, or simply be present on the namespace under the name `<resourcename>-ee-pull-credentials` . Instance initialization will register a `Container registry` type credential on the deployed instance and assign it to the registered default execution environments.
|
||||
|
||||
The secret should be formatted as follows:
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: <resourcename>-ee-pull-credentials
|
||||
namespace: <target namespace>
|
||||
stringData:
|
||||
url: <registry url. i.e. quay.io>
|
||||
username: <username to connect as>
|
||||
password: <password to connect with>
|
||||
ssl_verify: <Optional attribute. Whether verify ssl connection or not. Accepted values "True" (default), "False" >
|
||||
type: Opaque
|
||||
```
|
||||
|
||||
## Control plane ee from private registry
|
||||
|
||||
The images listed in `ee_images` will be added as globally available Execution Environments. The `control_plane_ee_image` will be used to run project updates. In order to use a private image for any of these you'll need to use `image_pull_secrets` to provide a list of k8s pull secrets to access it. Currently the same secret is used for any of these images supplied at install time.
|
||||
|
||||
You can create `image_pull_secret`
|
||||
|
||||
```sh
|
||||
kubectl create secret <resoucename>-cp-pull-credentials regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>
|
||||
```
|
||||
|
||||
If you need more control (for example, to set a namespace or a label on the new secret) then you can customize the Secret before storing it
|
||||
|
||||
Example spec file extra-config
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: <resoucename>-cp-pull-credentials
|
||||
namespace: <target namespace>
|
||||
data:
|
||||
.dockerconfigjson: <base64 docker config>
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
```
|
||||
19
docs/user-guide/advanced-configuration/disable-ipv6.md
Normal file
19
docs/user-guide/advanced-configuration/disable-ipv6.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Disable IPv6
|
||||
|
||||
Starting with AWX Operator release 0.24.0, [IPv6 was enabled in ngnix configuration](https://github.com/ansible/awx-operator/pull/950) which causes
|
||||
upgrades and installs to fail in environments where IPv6 is not allowed. Starting in 1.1.1 release, you can set the `ipv6_disabled` flag on the AWX
|
||||
spec. If you need to use an AWX operator version between 0.24.0 and 1.1.1 in an IPv6 disabled environment, it is suggested to enabled ipv6 on worker
|
||||
nodes.
|
||||
|
||||
In order to disable ipv6 on ngnix configuration (awx-web container), add following to the AWX spec.
|
||||
|
||||
The following variables are customizable:
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------------- | ---------------------- | ------- |
|
||||
| ipv6_disabled | Flag to disable ipv6 | false |
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
ipv6_disabled: true
|
||||
```
|
||||
@@ -0,0 +1,143 @@
|
||||
# Enabling LDAP Integration at AWX bootstrap (Deprecated)
|
||||
|
||||
A sample of extra settings can be found as below. All possible options can be found here: <https://django-auth-ldap.readthedocs.io/en/latest/reference.html#settings>
|
||||
|
||||
Refer to the [Extra Settings](./extra-settings.md) page for more information on how to configure extra settings.
|
||||
|
||||
!!! tip
|
||||
To trust a custom Certificate Authority for your LDAP server, or to specify password LDAP bind DN, refer to the [Trusting a Custom Certificate Authority](./trusting-a-custom-certificate-authority.md) page.
|
||||
|
||||
## Configure LDAP integration via `extra_settings_files`
|
||||
|
||||
Create a Python file with arbitrary name, e.g. `custom_ldap_settings.py`, and add the following content for example:
|
||||
|
||||
```python title="custom_ldap_settings.py"
|
||||
AUTH_LDAP_SERVER_URI = "ldaps://ad01.abc.com:636 ldaps://ad02.abc.com:636"
|
||||
AUTH_LDAP_BIND_DN = "CN=LDAP User,OU=Service Accounts,DC=abc,DC=com"
|
||||
AUTH_LDAP_USER_SEARCH = LDAPSearch(
|
||||
"DC=abc,DC=com",
|
||||
ldap.SCOPE_SUBTREE,
|
||||
"(sAMAccountName=%(user)s)",
|
||||
)
|
||||
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
|
||||
"OU=Groups,DC=abc,DC=com",
|
||||
ldap.SCOPE_SUBTREE,
|
||||
"(objectClass=group)",
|
||||
)
|
||||
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType()
|
||||
AUTH_LDAP_USER_ATTR_MAP = {
|
||||
"first_name": "givenName",
|
||||
"last_name": "sn",
|
||||
"email": "mail",
|
||||
}
|
||||
AUTH_LDAP_REQUIRE_GROUP = "CN=operators,OU=Groups,DC=abc,DC=com"
|
||||
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
|
||||
"is_superuser": ["CN=admin,OU=Groups,DC=abc,DC=com"],
|
||||
}
|
||||
AUTH_LDAP_ORGANIZATION_MAP = {
|
||||
"abc": {
|
||||
"admins": "CN=admin,OU=Groups,DC=abc,DC=com",
|
||||
"remove_admins": False,
|
||||
"remove_users": False,
|
||||
"users": True,
|
||||
}
|
||||
}
|
||||
AUTH_LDAP_TEAM_MAP = {
|
||||
"admin": {
|
||||
"organization": "abc",
|
||||
"remove": True,
|
||||
"users": "CN=admin,OU=Groups,DC=abc,DC=com",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Create a ConfigMap with the content of the above Python file.
|
||||
|
||||
```bash
|
||||
kubectl create configmap custom-ldap-settings \
|
||||
--from-file /PATH/TO/YOUR/custom_ldap_settings.py
|
||||
```
|
||||
|
||||
Then specify this ConfigMap to the `extra_settings_files` parameter.
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings_files:
|
||||
configmaps:
|
||||
- name: custom-ldap-settings
|
||||
key: custom_ldap_settings.py
|
||||
```
|
||||
|
||||
!!! note
|
||||
If you have embedded some sensitive information like passwords in the Python file, you can create and pass a Secret instead of a ConfigMap.
|
||||
|
||||
```bash
|
||||
kubectl create secret generic custom-ldap-settings \
|
||||
--from-file /PATH/TO/YOUR/custom_ldap_settings.py
|
||||
```
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings_files:
|
||||
secrets:
|
||||
- name: custom-ldap-settings
|
||||
key: custom_ldap_settings.py
|
||||
```
|
||||
|
||||
## Configure LDAP integration via `extra_settings`
|
||||
|
||||
!!! note
|
||||
These values are inserted into a Python file, so pay close attention to which values need quotes and which do not.
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings:
|
||||
- setting: AUTH_LDAP_SERVER_URI
|
||||
value: >-
|
||||
"ldaps://ad01.abc.com:636 ldaps://ad02.abc.com:636"
|
||||
|
||||
- setting: AUTH_LDAP_BIND_DN
|
||||
value: >-
|
||||
"CN=LDAP User,OU=Service Accounts,DC=abc,DC=com"
|
||||
|
||||
- setting: AUTH_LDAP_USER_SEARCH
|
||||
value: 'LDAPSearch("DC=abc,DC=com",ldap.SCOPE_SUBTREE,"(sAMAccountName=%(user)s)",)'
|
||||
|
||||
- setting: AUTH_LDAP_GROUP_SEARCH
|
||||
value: 'LDAPSearch("OU=Groups,DC=abc,DC=com",ldap.SCOPE_SUBTREE,"(objectClass=group)",)'
|
||||
|
||||
- setting: AUTH_LDAP_GROUP_TYPE
|
||||
value: 'GroupOfNamesType()'
|
||||
|
||||
- setting: AUTH_LDAP_USER_ATTR_MAP
|
||||
value: '{"first_name": "givenName","last_name": "sn","email": "mail"}'
|
||||
|
||||
- setting: AUTH_LDAP_REQUIRE_GROUP
|
||||
value: >-
|
||||
"CN=operators,OU=Groups,DC=abc,DC=com"
|
||||
- setting: AUTH_LDAP_USER_FLAGS_BY_GROUP
|
||||
value: {
|
||||
"is_superuser": [
|
||||
"CN=admin,OU=Groups,DC=abc,DC=com"
|
||||
]
|
||||
}
|
||||
|
||||
- setting: AUTH_LDAP_ORGANIZATION_MAP
|
||||
value: {
|
||||
"abc": {
|
||||
"admins": "CN=admin,OU=Groups,DC=abc,DC=com",
|
||||
"remove_users": false,
|
||||
"remove_admins": false,
|
||||
"users": true
|
||||
}
|
||||
}
|
||||
|
||||
- setting: AUTH_LDAP_TEAM_MAP
|
||||
value: {
|
||||
"admin": {
|
||||
"remove": true,
|
||||
"users": "CN=admin,OU=Groups,DC=abc,DC=com",
|
||||
"organization": "abc"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
# Exporting Environment Variables to Containers
|
||||
|
||||
If you need to export custom environment variables to your containers.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ----------------- | ------------------------------------------------------ | ------- |
|
||||
| task_extra_env | Environment variables to be added to Task container | '' |
|
||||
| web_extra_env | Environment variables to be added to Web container | '' |
|
||||
| rsyslog_extra_env | Environment variables to be added to Rsyslog container | '' |
|
||||
| ee_extra_env | Environment variables to be added to EE container | '' |
|
||||
|
||||
!!! warning
|
||||
The `ee_extra_env` will only take effect to the globally available Execution Environments. For custom `ee`, please [customize the Pod spec](https://docs.ansible.com/ansible-tower/latest/html/administration/external_execution_envs.html#customize-the-pod-spec).
|
||||
|
||||
Example configuration of environment variables
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
task_extra_env: |
|
||||
- name: MYCUSTOMVAR
|
||||
value: foo
|
||||
web_extra_env: |
|
||||
- name: MYCUSTOMVAR
|
||||
value: foo
|
||||
rsyslog_extra_env: |
|
||||
- name: MYCUSTOMVAR
|
||||
value: foo
|
||||
ee_extra_env: |
|
||||
- name: MYCUSTOMVAR
|
||||
value: foo
|
||||
```
|
||||
120
docs/user-guide/advanced-configuration/extra-settings.md
Normal file
120
docs/user-guide/advanced-configuration/extra-settings.md
Normal file
@@ -0,0 +1,120 @@
|
||||
# Extra Settings
|
||||
|
||||
With `extra_settings` and `extra_settings_files`, you can pass multiple custom settings to AWX via the AWX Operator.
|
||||
|
||||
!!! note
|
||||
Parameters configured in `extra_settings` or `extra_settings_files` are set as read-only settings in AWX. As a result, they cannot be changed in the UI after deployment.
|
||||
|
||||
If you need to change the setting after the initial deployment, you need to change it on the AWX CR spec (for `extra_settings`) or corresponding ConfigMap or Secret (for `extra_settings_files`). After updating ConfigMap or Secret, you need to restart the AWX pods to apply the changes.
|
||||
|
||||
!!! note
|
||||
If the same setting is set in both `extra_settings` and `extra_settings_files`, the setting in `extra_settings_files` will take precedence.
|
||||
|
||||
## Add extra settings with `extra_settings`
|
||||
|
||||
You can pass extra settings by specifying the pair of the setting name and value as the `extra_settings` parameter.
|
||||
|
||||
The settings passed via `extra_settings` will be appended to the `/etc/tower/settings.py`.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------- | -------------- | --------- |
|
||||
| extra_settings | Extra settings | `[]` |
|
||||
|
||||
Example configuration of `extra_settings` parameter
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings:
|
||||
- setting: MAX_PAGE_SIZE
|
||||
value: "500"
|
||||
|
||||
# LDAP is deprecated
|
||||
- setting: AUTH_LDAP_BIND_DN
|
||||
value: "cn=admin,dc=example,dc=com"
|
||||
|
||||
- setting: LOG_AGGREGATOR_LEVEL
|
||||
value: "'DEBUG'"
|
||||
```
|
||||
|
||||
Note for some settings, such as `LOG_AGGREGATOR_LEVEL`, the value may need double quotes.
|
||||
|
||||
## Add extra settings with `extra_settings_files`
|
||||
|
||||
You can pass extra settings by specifying the additional settings files in the ConfigMaps or Secrets as the `extra_settings_files` parameter.
|
||||
|
||||
The settings files passed via `extra_settings_files` will be mounted as the files under the `/etc/tower/conf.d`.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------------- | -------------------- | --------- |
|
||||
| extra_settings_files | Extra settings files | `{}` |
|
||||
|
||||
!!! note
|
||||
If the same setting is set in multiple files in `extra_settings_files`, it would be difficult to predict which would be adopted since these files are loaded in arbitrary order that [`glob`](https://docs.python.org/3/library/glob.html) returns. For a reliable setting, do not include the same key in more than one file.
|
||||
|
||||
Create ConfigMaps or Secrets that contain custom settings files (`*.py`).
|
||||
|
||||
```python title="custom_job_settings.py"
|
||||
AWX_TASK_ENV = {
|
||||
"HTTPS_PROXY": "http://proxy.example.com:3128",
|
||||
"HTTP_PROXY": "http://proxy.example.com:3128",
|
||||
"NO_PROXY": "127.0.0.1,localhost,.example.com"
|
||||
}
|
||||
GALAXY_TASK_ENV = {
|
||||
"ANSIBLE_FORCE_COLOR": "false",
|
||||
"GIT_SSH_COMMAND": "ssh -o StrictHostKeyChecking=no",
|
||||
}
|
||||
```
|
||||
|
||||
```python title="custom_system_settings.py"
|
||||
REMOTE_HOST_HEADERS = [
|
||||
"HTTP_X_FORWARDED_FOR",
|
||||
"REMOTE_ADDR",
|
||||
"REMOTE_HOST",
|
||||
]
|
||||
```
|
||||
|
||||
```python title="custom_passwords.py"
|
||||
SUBSCRIPTIONS_PASSWORD = "my-super-secure-subscription-password123!"
|
||||
REDHAT_PASSWORD = "my-super-secure-redhat-password123!"
|
||||
```
|
||||
|
||||
```bash title="Create ConfigMap and Secret"
|
||||
# Create ConfigMap
|
||||
kubectl create configmap my-custom-settings \
|
||||
--from-file /PATH/TO/YOUR/custom_job_settings.py \
|
||||
--from-file /PATH/TO/YOUR/custom_system_settings.py
|
||||
|
||||
# Create Secret
|
||||
kubectl create secret generic my-custom-passwords \
|
||||
--from-file /PATH/TO/YOUR/custom_passwords.py
|
||||
```
|
||||
|
||||
Then specify them in the AWX CR spec. Here is an example configuration of `extra_settings_files` parameter.
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings_files:
|
||||
configmaps:
|
||||
- name: my-custom-settings # The name of the ConfigMap
|
||||
key: custom_job_settings.py # The key in the ConfigMap, which means the file name
|
||||
- name: my-custom-settings
|
||||
key: custom_system_settings.py
|
||||
secrets:
|
||||
- name: my-custom-passwords # The name of the Secret
|
||||
key: custom_passwords.py # The key in the Secret, which means the file name
|
||||
```
|
||||
|
||||
!!! Warning "Restriction"
|
||||
There are some restrictions on the ConfigMaps or Secrets used in `extra_settings_files`.
|
||||
|
||||
- The keys in ConfigMaps or Secrets MUST be the name of python files and MUST end with `.py`
|
||||
- The keys in ConfigMaps or Secrets MUST consists of alphanumeric characters, `-`, `_` or `.`
|
||||
- The keys in ConfigMaps or Secrets are converted to the following strings, which MUST not exceed 63 characters
|
||||
- Keys in ConfigMaps: `<instance name>-<KEY>-configmap`
|
||||
- Keys in Secrets: `<instance name>-<KEY>-secret`
|
||||
- Following keys are reserved and MUST NOT be used in ConfigMaps or Secrets
|
||||
- `credentials.py`
|
||||
- `execution_environments.py`
|
||||
- `ldap.py`
|
||||
|
||||
Refer to the Kubernetes documentations ([[1]](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/config-map-v1/), [[2]](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/secret-v1/), [[3]](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/volume/), [[4]](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/)) for more information about character types and length restrictions.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Horizontal Pod Autoscaler (HPA)
|
||||
|
||||
Horizontal Pod Autoscaler allows Kubernetes to scale the number of replicas of
|
||||
deployments in response to configured metrics.
|
||||
|
||||
This feature conflicts with the operators ability to manage the number of static
|
||||
replicas to create for each deployment.
|
||||
|
||||
The use of the settings below will tell the operator to not manage the replicas
|
||||
field on the identified deployments even if a replicas count has been set for those
|
||||
properties in the operator resource.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ---------------------- | ----------------------------------------------------------------------------- | ------- |
|
||||
| web_manage_replicas | Indicates operator should control the replicas count for the web deployment. | true |
|
||||
| task_manage_replicas | Indicates operator should control the replicas count for the task deployment. | true |
|
||||
|
||||
## Recommended Settings for HPA
|
||||
|
||||
Please see the Kubernetes documentation on how to configure the horizontal pod
|
||||
autoscaler.
|
||||
|
||||
The values for optimal HPA are cluster and need specific so general guidelines
|
||||
are not available at this time.
|
||||
19
docs/user-guide/advanced-configuration/host-aliases.md
Normal file
19
docs/user-guide/advanced-configuration/host-aliases.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# HostAliases
|
||||
|
||||
Sometimes you might need to use [HostAliases](https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/) in web/task containers.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------------ | --------------------- | ------- |
|
||||
| host_aliases | A list of HostAliases | None |
|
||||
|
||||
Example of customization could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
host_aliases:
|
||||
- ip: <name-of-your-ip>
|
||||
hostnames:
|
||||
- <name-of-your-domain>
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 162 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 162 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user