mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-27 22:03:11 +00:00
Compare commits
307 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
f8719db954 | ||
|
|
89425826e8 | ||
|
|
5c572a9ba6 | ||
|
|
b7bbfd432d | ||
|
|
b17cd16fb7 | ||
|
|
dc6cbab501 | ||
|
|
a81be586db | ||
|
|
f2a9e967cc | ||
|
|
9f017d03e6 | ||
|
|
7d2d1b3c5e | ||
|
|
5d0ebd0121 | ||
|
|
f368a539a9 | ||
|
|
0aef4cc35f | ||
|
|
e3701dd3db | ||
|
|
cf98edc282 | ||
|
|
58a4778c89 | ||
|
|
8e50bdde9b | ||
|
|
60386bc928 | ||
|
|
f1df88dc53 | ||
|
|
8de6179ac7 | ||
|
|
8a3c8e727a | ||
|
|
c230016819 | ||
|
|
bea05c97ee | ||
|
|
3a6040e0cd | ||
|
|
24f3f440f1 | ||
|
|
87b0511997 | ||
|
|
fde4a47a14 | ||
|
|
af2e681f1e | ||
|
|
82ffa3d348 | ||
|
|
db6a5b53ed | ||
|
|
0be17476cd | ||
|
|
f4a781ccc5 | ||
|
|
fcd2c4c023 | ||
|
|
8e30a17a77 | ||
|
|
b3037c1067 | ||
|
|
f7ff132a2e | ||
|
|
5f06e90906 | ||
|
|
36355b6a15 | ||
|
|
bc08c4bbbe | ||
|
|
ba3b6f5436 |
26
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
26
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
##### SUMMARY
|
||||
<!--- Describe the change, including rationale and design decisions -->
|
||||
|
||||
<!---
|
||||
If you are fixing an existing issue, please include "fixes #nnn" in your
|
||||
commit message and your description; but you should still explain what
|
||||
the change does.
|
||||
-->
|
||||
|
||||
##### ISSUE TYPE
|
||||
<!--- Pick one below and delete the rest: -->
|
||||
- Breaking Change
|
||||
- New or Enhanced Feature
|
||||
- Bug, Docs Fix or other nominal change
|
||||
|
||||
##### ADDITIONAL INFORMATION
|
||||
<!---
|
||||
Include additional information to help people understand the change here.
|
||||
For bugs that don't have a linked bug report, a step-by-step reproduction
|
||||
of the problem is helpful.
|
||||
-->
|
||||
|
||||
<!--- Paste verbatim command output below, e.g. before and after your change -->
|
||||
```
|
||||
|
||||
```
|
||||
51
.github/workflows/ci.yaml
vendored
51
.github/workflows/ci.yaml
vendored
@@ -4,17 +4,19 @@ 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.41"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -38,9 +40,9 @@ jobs:
|
||||
run: |
|
||||
sudo rm -f $(which kustomize)
|
||||
make kustomize
|
||||
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind
|
||||
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind -- ${{ matrix.ansible_args }}
|
||||
helm:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
name: helm
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -60,7 +62,40 @@ jobs:
|
||||
kustomize edit add patch --path ../testing/pull_policy/Never.yaml
|
||||
working-directory: config/default
|
||||
|
||||
- name: Build and install helm chart
|
||||
- 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
|
||||
no-log:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check no_log statements
|
||||
run: |
|
||||
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
|
||||
|
||||
2
.github/workflows/devel.yaml
vendored
2
.github/workflows/devel.yaml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Push devel image
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
75
.github/workflows/feature.yml
vendored
Normal file
75
.github/workflows/feature.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
|
||||
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@v3
|
||||
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: Set ARCH environment variable
|
||||
run: |
|
||||
echo "ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)" >>${GITHUB_ENV}
|
||||
|
||||
- name: Set OS environment variable
|
||||
run: |
|
||||
echo "OS=$(uname | awk '{print tolower($0)}')" >>${GITHUB_ENV}
|
||||
|
||||
- name: Install operator-sdk
|
||||
run: |
|
||||
echo "Installing operator-sdk ${OPERATOR_SDK_DL_URL}" && \
|
||||
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} && \
|
||||
chmod +x operator-sdk_${OS}_${ARCH} && \
|
||||
sudo mkdir -p /usr/local/bin/ && \
|
||||
sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk && \
|
||||
operator-sdk version
|
||||
env:
|
||||
OPERATOR_SDK_DL_URL: https://github.com/operator-framework/operator-sdk/releases/download/v1.26.0
|
||||
|
||||
- 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@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'
|
||||
|
||||
community:
|
||||
runs-on: ubuntu-latest
|
||||
name: Label Issue - Community
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v4
|
||||
- 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 }}
|
||||
40
.github/workflows/label_pr.yml
vendored
Normal file
40
.github/workflows/label_pr.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
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@v2
|
||||
- uses: actions/setup-python@v4
|
||||
- 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.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 }}
|
||||
37
.github/workflows/pr_body_check.yml
vendored
Normal file
37
.github/workflows/pr_body_check.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: PR Check
|
||||
env:
|
||||
BRANCH: ${{ github.base_ref || 'devel' }}
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, reopened, synchronize]
|
||||
jobs:
|
||||
pr-check:
|
||||
name: Scan PR description for semantic versioning keywords
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check for each of the lines
|
||||
env:
|
||||
PR_BODY: ${{ github.event.pull_request.body }}
|
||||
run: |
|
||||
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
|
||||
shell: bash {0}
|
||||
|
||||
- name: Check for exactly one item
|
||||
run: |
|
||||
if [ $(cat X Y Z | wc -l) != 1 ] ; then
|
||||
echo "The PR body must contain exactly one of [ 'Bug, Docs Fix or other nominal change', 'New or Enhanced Feature', 'Breaking Change' ]"
|
||||
echo "We counted $(cat X Y Z | wc -l)"
|
||||
echo "See the default PR body for examples"
|
||||
exit 255;
|
||||
else
|
||||
exit 0;
|
||||
fi
|
||||
13
.github/workflows/promote.yaml
vendored
13
.github/workflows/promote.yaml
vendored
@@ -8,7 +8,9 @@ jobs:
|
||||
promote:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
depth: 0
|
||||
|
||||
- name: Log in to GHCR
|
||||
run: |
|
||||
@@ -26,15 +28,12 @@ jobs:
|
||||
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
docker push quay.io/${{ github.repository }}:latest
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Release Helm chart
|
||||
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 }}
|
||||
-e gh_token=${{ secrets.GITHUB_TOKEN }} \
|
||||
-e gh_user=${{ github.actor }} \
|
||||
-e repo_type=https
|
||||
|
||||
26
.github/workflows/publish-helm.yml
vendored
Normal file
26
.github/workflows/publish-helm.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Re-publish helm chart
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag'
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
promote:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
depth: 0
|
||||
|
||||
- name: Release Helm chart
|
||||
run: |
|
||||
ansible-playbook ansible/helm-release.yml -v \
|
||||
-e operator_image=quay.io/${{ github.repository }} \
|
||||
-e chart_owner=${{ github.repository_owner }} \
|
||||
-e tag=${{ inputs.tag }} \
|
||||
-e gh_token=${{ secrets.GITHUB_TOKEN }} \
|
||||
-e gh_user=${{ github.actor }} \
|
||||
-e repo_type=https
|
||||
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'
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*~
|
||||
gh-pages/
|
||||
.cache/
|
||||
/bin
|
||||
/bundle
|
||||
@@ -6,3 +7,6 @@
|
||||
/bundle.Dockerfile
|
||||
/charts
|
||||
/.cr-release-packages
|
||||
.vscode/
|
||||
__pycache__
|
||||
/site
|
||||
|
||||
67
.helm/starter/README.md
Normal file
67
.helm/starter/README.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# 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`. Supplying the password this way is not recommended for production use, but may be helpful for initial PoC.
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
# Chart Publishing
|
||||
|
||||
The chart is currently hosted on the gh-pages branch of the repo. During the release pipeline, the `index.yaml` stored in that branch is generated with helm chart entries from all valid tags. We are currently unable to use the `chart-releaser` pipeline due to the fact that the complete helm chart is not committed to the repo and is instead built during the release process. Therefore, the cr action is unable to compare against previous versions.
|
||||
|
||||
Instead of CR, we use `helm repo index` to generate an index from all locally pulled chart versions. Since we build from scratch every time, the timestamps of all entries will be updated. This could be improved by using yq or something similar to detect which tags are already in the index.yaml file, and only merge in tags that are not present.
|
||||
|
||||
Not using CR could be addressed in the future by keeping the chart built as a part of releases, as long as CR compares the chart to previous release packages rather than previous commits. If the latter is the case, then we would not have the necessary history for comparison.
|
||||
|
||||
|
||||
6
.helm/starter/templates/_helpers.tpl
Normal file
6
.helm/starter/templates/_helpers.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
{{/*
|
||||
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 }}
|
||||
24
.helm/starter/templates/awx-deploy.yaml
Normal file
24
.helm/starter/templates/awx-deploy.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
{{- 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 }}
|
||||
18
.helm/starter/templates/postgres-config.yaml
Normal file
18
.helm/starter/templates/postgres-config.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- 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 }}
|
||||
@@ -0,0 +1,19 @@
|
||||
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,8 +6,15 @@ ignore: |
|
||||
kustomization.yaml
|
||||
awx-operator.clusterserviceversion.yaml
|
||||
bundle
|
||||
.helm/starter
|
||||
hacking/
|
||||
|
||||
rules:
|
||||
truthy: disable
|
||||
line-length:
|
||||
max: 170
|
||||
document-start: disable
|
||||
comments-indentation: disable
|
||||
indentation:
|
||||
level: warning
|
||||
indent-sequences: consistent
|
||||
|
||||
@@ -31,7 +31,7 @@ Have questions about this document or anything not covered here? Please file a n
|
||||
```
|
||||
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"
|
||||
@@ -56,14 +56,17 @@ Running `molecule test` sets up a clean environment, builds the operator, runs a
|
||||
|
||||
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 +140,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.
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -1,4 +1,10 @@
|
||||
FROM quay.io/operator-framework/ansible-operator:v1.12.0
|
||||
FROM quay.io/operator-framework/ansible-operator:v1.28.1
|
||||
|
||||
USER 0
|
||||
|
||||
RUN dnf install -y openssl
|
||||
|
||||
USER 1001
|
||||
|
||||
ARG DEFAULT_AWX_VERSION
|
||||
ARG OPERATOR_VERSION
|
||||
@@ -12,3 +18,8 @@ RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
|
||||
COPY watches.yaml ${HOME}/watches.yaml
|
||||
COPY roles/ ${HOME}/roles/
|
||||
COPY playbooks/ ${HOME}/playbooks/
|
||||
|
||||
ENTRYPOINT ["/tini", "--", "/usr/local/bin/ansible-operator", "run", \
|
||||
"--watches-file=./watches.yaml", \
|
||||
"--reconcile-period=0s" \
|
||||
]
|
||||
|
||||
159
Makefile
159
Makefile
@@ -44,6 +44,17 @@ IMAGE_TAG_BASE ?= quay.io/ansible/awx-operator
|
||||
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
|
||||
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
|
||||
|
||||
# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
|
||||
BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
|
||||
|
||||
# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
|
||||
# You can enable this value if you would like to use SHA Based Digests
|
||||
# To enable set flag to true
|
||||
USE_IMAGE_DIGESTS ?= false
|
||||
ifeq ($(USE_IMAGE_DIGESTS), true)
|
||||
BUNDLE_GEN_FLAGS += --use-image-digests
|
||||
endif
|
||||
|
||||
# Image URL to use all building/pushing image targets
|
||||
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
|
||||
NAMESPACE ?= awx
|
||||
@@ -54,8 +65,10 @@ CHART_DESCRIPTION ?= A Helm chart for the AWX Operator
|
||||
CHART_OWNER ?= $(GH_REPO_OWNER)
|
||||
CHART_REPO ?= awx-operator
|
||||
CHART_BRANCH ?= gh-pages
|
||||
CHART_DIR ?= gh-pages
|
||||
CHART_INDEX ?= index.yaml
|
||||
|
||||
.PHONY: all
|
||||
all: docker-build
|
||||
|
||||
##@ General
|
||||
@@ -71,38 +84,47 @@ all: docker-build
|
||||
# More info on the awk command:
|
||||
# http://linuxcommand.org/lc3_adv_awk.php
|
||||
|
||||
.PHONY: help
|
||||
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)
|
||||
|
||||
##@ Build
|
||||
|
||||
.PHONY: run
|
||||
run: ansible-operator ## Run against the configured Kubernetes cluster in ~/.kube/config
|
||||
ANSIBLE_ROLES_PATH="$(ANSIBLE_ROLES_PATH):$(shell pwd)/roles" $(ANSIBLE_OPERATOR) run
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build: ## Build docker image with the manager.
|
||||
${CONTAINER_CMD} build $(BUILD_ARGS) -t ${IMG} .
|
||||
|
||||
.PHONY: docker-push
|
||||
docker-push: ## Push docker image with the manager.
|
||||
${CONTAINER_CMD} push ${IMG}
|
||||
|
||||
##@ Deployment
|
||||
|
||||
.PHONY: install
|
||||
install: kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
|
||||
$(KUSTOMIZE) build config/crd | kubectl apply -f -
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
|
||||
$(KUSTOMIZE) build config/crd | kubectl delete -f -
|
||||
|
||||
.PHONY: gen-resources
|
||||
gen-resources: kustomize ## Generate resources for controller and print to stdout
|
||||
@cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
|
||||
@cd config/default && $(KUSTOMIZE) edit set namespace ${NAMESPACE}
|
||||
@$(KUSTOMIZE) build config/default
|
||||
|
||||
.PHONY: deploy
|
||||
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
|
||||
@cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
|
||||
@cd config/default && $(KUSTOMIZE) edit set namespace ${NAMESPACE}
|
||||
@$(KUSTOMIZE) build config/default | kubectl apply -f -
|
||||
|
||||
.PHONY: undeploy
|
||||
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
|
||||
@cd config/default && $(KUSTOMIZE) edit set namespace ${NAMESPACE}
|
||||
$(KUSTOMIZE) build config/default | kubectl delete -f -
|
||||
@@ -119,7 +141,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
|
||||
@@ -135,7 +157,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.12.0/ansible-operator_$(OS)_$(ARCHA) ;\
|
||||
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.26.0/ansible-operator_$(OS)_$(ARCHA) ;\
|
||||
chmod +x $(ANSIBLE_OPERATOR) ;\
|
||||
}
|
||||
else
|
||||
@@ -166,7 +188,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.15.1/$(OS)-$(ARCHA)-opm ;\
|
||||
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.26.0/$(OS)-$(ARCHA)-opm ;\
|
||||
chmod +x $(OPM) ;\
|
||||
}
|
||||
else
|
||||
@@ -206,7 +228,7 @@ 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 | \
|
||||
curl -sSLo - https://github.com/patrickdappollonio/kubectl-slice/releases/download/v1.2.6/kubectl-slice_$(OS)_$(ARCHX).tar.gz | \
|
||||
tar xzf - -C bin/ kubectl-slice ;\
|
||||
}
|
||||
else
|
||||
@@ -269,55 +291,116 @@ charts:
|
||||
mkdir -p $@
|
||||
|
||||
.PHONY: helm-chart
|
||||
helm-chart: kustomize helm kubectl-slice yq charts
|
||||
@echo "== KUSTOMIZE (image and namespace) =="
|
||||
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
|
||||
helm-chart: helm-chart-generate
|
||||
|
||||
@echo "== HELM =="
|
||||
.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)
|
||||
cd config/default && $(KUSTOMIZE) edit set label helm.sh/chart:$(CHART_NAME)
|
||||
|
||||
@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 (annotation) =="
|
||||
cd config/manager && $(KUSTOMIZE) edit set annotation helm.sh/chart:$(CHART_NAME)-$(VERSION)
|
||||
cd config/default && $(KUSTOMIZE) edit set annotation helm.sh/chart:$(CHART_NAME)-$(VERSION)
|
||||
|
||||
@echo "== SLICE =="
|
||||
@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)/templates \
|
||||
--output-dir=charts/$(CHART_NAME)/raw-files \
|
||||
--sort-by-kind
|
||||
@echo "Helm Chart $(VERSION)" > charts/$(CHART_NAME)/templates/NOTES.txt
|
||||
$(foreach file, $(wildcard charts/$(CHART_NAME)/templates/*),$(YQ) -i 'del(.. | select(has("namespace")).namespace)' $(file);)
|
||||
$(foreach file, $(wildcard charts/$(CHART_NAME)/templates/*rolebinding*),$(YQ) -i '.subjects[0].namespace = "{{ .Release.Namespace }}"' $(file);)
|
||||
rm -f charts/$(CHART_NAME)/templates/namespace*.yaml
|
||||
|
||||
@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
|
||||
# Correct .metadata.name for cluster scoped resources
|
||||
cluster_scoped_files="charts/$(CHART_NAME)/raw-files/clusterrolebinding-awx-operator-proxy-rolebinding.yaml charts/$(CHART_NAME)/raw-files/clusterrole-awx-operator-metrics-reader.yaml charts/$(CHART_NAME)/raw-files/clusterrole-awx-operator-proxy-role.yaml";\
|
||||
for file in $${cluster_scoped_files}; do\
|
||||
$(YQ) -i '.metadata.name += "-{{ .Release.Name }}"' $${file};\
|
||||
done
|
||||
|
||||
# Correct the reference for the clusterrolebinding
|
||||
$(YQ) -i '.roleRef.name += "-{{ .Release.Name }}"' 'charts/$(CHART_NAME)/raw-files/clusterrolebinding-awx-operator-proxy-rolebinding.yaml'
|
||||
# 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
|
||||
helm-package: helm-chart
|
||||
@echo "== Package Current Chart Version =="
|
||||
mkdir -p .cr-release-packages
|
||||
# package the chart and put it in .cr-release-packages dir
|
||||
$(HELM) package ./charts/awx-operator -d .cr-release-packages/$(VERSION)
|
||||
|
||||
# The actual release happens in ansible/helm-release.yml
|
||||
# until https://github.com/helm/chart-releaser/issues/122 happens
|
||||
# List all tags oldest to newest.
|
||||
TAGS := $(shell git ls-remote --tags --sort=version:refname --refs -q | cut -d/ -f3)
|
||||
|
||||
# The actual release happens in ansible/helm-release.yml, which calls this targer
|
||||
# until https://github.com/helm/chart-releaser/issues/122 happens, chart-releaser is not ideal for a chart
|
||||
# that is contained within a larger repo, where a tag may not require a new chart version
|
||||
.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
|
||||
helm-index:
|
||||
# when running in CI the gh-pages branch is checked out by the ansible playbook
|
||||
# TODO: test if gh-pages directory exists and if not exist
|
||||
|
||||
@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
|
||||
@echo "== GENERATE INDEX FILE =="
|
||||
# This step to workaround issues with old releases being dropped.
|
||||
# Until https://github.com/helm/chart-releaser/issues/133 happens
|
||||
@echo "== CHART FETCH previous releases =="
|
||||
# Download all old releases
|
||||
mkdir -p .cr-release-packages
|
||||
|
||||
for tag in $(TAGS); do\
|
||||
dl_url="https://github.com/$(CHART_OWNER)/$(CHART_REPO)/releases/download/$${tag}/$(CHART_REPO)-$${tag}.tgz";\
|
||||
echo "Downloading $${tag} from $${dl_url}";\
|
||||
curl -RLOs -z "$(CHART_REPO)-$${tag}.tgz" --fail $${dl_url};\
|
||||
result=$$?;\
|
||||
if [ $${result} -eq 0 ]; then\
|
||||
echo "Downloaded $${dl_url}";\
|
||||
mkdir -p .cr-release-packages/$${tag};\
|
||||
mv ./$(CHART_REPO)-$${tag}.tgz .cr-release-packages/$${tag};\
|
||||
else\
|
||||
echo "Skipping release $${tag}; No helm chart present";\
|
||||
rm -rf "$(CHART_REPO)-$${tag}.tgz";\
|
||||
fi;\
|
||||
done;\
|
||||
|
||||
# generate the index file in the root of the gh-pages branch
|
||||
# --merge will leave any values in index.yaml that don't get generated by this command, but
|
||||
# it is likely that all values are overridden
|
||||
$(HELM) repo index .cr-release-packages --url https://github.com/$(CHART_OWNER)/$(CHART_REPO)/releases/download/ --merge $(CHART_DIR)/index.yaml
|
||||
|
||||
mv .cr-release-packages/index.yaml $(CHART_DIR)/index.yaml
|
||||
|
||||
14
PROJECT
14
PROJECT
@@ -13,4 +13,18 @@ resources:
|
||||
group: awx
|
||||
kind: AWX
|
||||
version: v1beta1
|
||||
- api:
|
||||
crdVersion: v1
|
||||
namespaced: true
|
||||
domain: ansible.com
|
||||
group: awx
|
||||
kind: AWXBackup
|
||||
version: v1beta1
|
||||
- api:
|
||||
crdVersion: v1
|
||||
namespaced: true
|
||||
domain: ansible.com
|
||||
group: awx
|
||||
kind: AWXRestore
|
||||
version: v1beta1
|
||||
version: "3"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
- hosts: localhost
|
||||
vars:
|
||||
chart_repo: awx-operator
|
||||
environment:
|
||||
CHART_OWNER: "{{ chart_owner }}"
|
||||
tasks:
|
||||
- name: Look up release
|
||||
uri:
|
||||
@@ -14,34 +16,107 @@
|
||||
Release must exist before running this playbook
|
||||
when: release is not success
|
||||
|
||||
- name: Build and package helm chart
|
||||
command: |
|
||||
make helm-chart helm-package
|
||||
environment:
|
||||
VERSION: "{{ tag }}"
|
||||
IMAGE_TAG_BASE: "{{ operator_image }}"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/../"
|
||||
- name: Set helm filename and commit message
|
||||
set_fact:
|
||||
asset_already_attached: False
|
||||
helm_file_name: "awx-operator-{{ tag }}.tgz"
|
||||
commit_message: "Updated index.yaml for release {{ release.json.tag_name }}"
|
||||
|
||||
# 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: See if file is already attached
|
||||
set_fact:
|
||||
asset_already_attached: True
|
||||
loop: "{{ release.json.get('assets', []) }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when: item.name == helm_file_name
|
||||
|
||||
- name: Publish helm index
|
||||
command: |
|
||||
make helm-index
|
||||
environment:
|
||||
CHART_OWNER: "{{ chart_owner }}"
|
||||
CR_TOKEN: "{{ gh_token }}"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/../"
|
||||
- when: not asset_already_attached
|
||||
block:
|
||||
- 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={{ helm_file_name }}"
|
||||
src: "{{ playbook_dir }}/../.cr-release-packages/{{ tag }}/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: Ensure gh-pages exists
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ playbook_dir }}/../gh-pages"
|
||||
|
||||
- name: Check if we have published the release
|
||||
command:
|
||||
cmd: "git log --grep='{{ commit_message }}'"
|
||||
chdir: "{{ playbook_dir }}/../gh-pages"
|
||||
register: commits_for_release
|
||||
|
||||
- when: commits_for_release.stdout == ''
|
||||
block:
|
||||
- name: Make a temp dir
|
||||
tempfile:
|
||||
state: directory
|
||||
register: temp_dir
|
||||
|
||||
- name: Clone the gh-pages branch from {{ chart_owner }}
|
||||
git:
|
||||
repo: "{{ ((repo_type | default('http')) == 'ssh') | ternary(ssh_repo, http_repo) }}"
|
||||
dest: "{{ temp_dir.path }}"
|
||||
single_branch: yes
|
||||
version: gh-pages
|
||||
vars:
|
||||
http_repo: "https://github.com/{{ chart_owner }}/{{ chart_repo }}"
|
||||
ssh_repo: "git@github.com:{{ chart_owner }}/{{ chart_repo }}.git"
|
||||
|
||||
- name: Publish helm index
|
||||
ansible.builtin.command:
|
||||
cmd: make helm-index
|
||||
environment:
|
||||
CHART_OWNER: "{{ chart_owner }}"
|
||||
CR_TOKEN: "{{ gh_token }}"
|
||||
CHART_DIR: "{{ temp_dir.path }}"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/.."
|
||||
|
||||
- name: Set url base swap in gitconfig
|
||||
command:
|
||||
cmd: "git config --local url.https://{{ gh_user }}:{{ gh_token }}@github.com/.insteadOf https://github.com/"
|
||||
args:
|
||||
chdir: "{{ temp_dir.path }}/"
|
||||
no_log: true
|
||||
|
||||
- name: Stage and Push commit to gh-pages branch
|
||||
command:
|
||||
cmd: "{{ item }}"
|
||||
loop:
|
||||
- git add index.yaml
|
||||
- git commit -m "{{ commit_message }}"
|
||||
- git push
|
||||
args:
|
||||
chdir: "{{ temp_dir.path }}/"
|
||||
environment:
|
||||
GIT_AUTHOR_NAME: "{{ gh_user }}"
|
||||
GIT_AUTHOR_EMAIL: "{{ gh_user }}@users.noreply.github.com"
|
||||
GIT_COMMITTER_NAME: "{{ gh_user }}"
|
||||
GIT_COMMITTER_EMAIL: "{{ gh_user }}@users.noreply.github.com"
|
||||
|
||||
always:
|
||||
- name: Remove temp dir
|
||||
file:
|
||||
path: "{{ temp_dir.path }}"
|
||||
state: absent
|
||||
|
||||
@@ -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
|
||||
|
||||
143
config/crd/bases/awx.ansible.com_awxbackups.yaml
Normal file
143
config/crd/bases/awx.ansible.com_awxbackups.yaml
Normal file
@@ -0,0 +1,143 @@
|
||||
---
|
||||
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
|
||||
description: Schema validation for the AWXBackup CRD
|
||||
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:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- deployment_name
|
||||
properties:
|
||||
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_resource_requirements:
|
||||
description: Resource requirements for the management pod used to create a backup
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
limits:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
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
|
||||
pg_dump_suffix:
|
||||
description: Additional parameters for the pg_dump command
|
||||
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
|
||||
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: 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
|
||||
status:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
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
|
||||
144
config/crd/bases/awx.ansible.com_awxrestores.yaml
Normal file
144
config/crd/bases/awx.ansible.com_awxrestores.yaml
Normal file
@@ -0,0 +1,144 @@
|
||||
---
|
||||
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
|
||||
description: Schema validation for the AWXRestore CRD
|
||||
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:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
required:
|
||||
- deployment_name
|
||||
properties:
|
||||
backup_source:
|
||||
description: Backup source
|
||||
type: string
|
||||
enum:
|
||||
- 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
|
||||
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
|
||||
restore_resource_requirements:
|
||||
description: Resource requirements for the management pod that restores AWX from a backup
|
||||
properties:
|
||||
requests:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
limits:
|
||||
properties:
|
||||
cpu:
|
||||
type: string
|
||||
memory:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
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
|
||||
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: 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
|
||||
status:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,83 +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:
|
||||
deployment_name:
|
||||
description: Name of the deployment to be backed up
|
||||
type: string
|
||||
backup_pvc:
|
||||
description: Name of the PVC to be used for storing the backup
|
||||
type: string
|
||||
backup_pvc_namespace:
|
||||
description: Namespace the PVC is in
|
||||
type: string
|
||||
backup_storage_requirements:
|
||||
description: Storage requirements for the PostgreSQL container
|
||||
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
|
||||
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,81 +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
|
||||
deployment_name:
|
||||
description: Name of the deployment to be restored to
|
||||
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: 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
|
||||
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
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
# This kustomization.yaml is not intended to be run by itself,
|
||||
# since it depends on service name and namespace that are out of this kustomize package.
|
||||
# It should be run by config/default
|
||||
resources:
|
||||
- bases/awx.ansible.com_awxs.yaml
|
||||
- bases/awxbackup.ansible.com_awxbackups.yaml
|
||||
- bases/awxrestore.ansible.com_awxrestores.yaml
|
||||
# +kubebuilder:scaffold:crdkustomizeresource
|
||||
- bases/awx.ansible.com_awxs.yaml
|
||||
- bases/awx.ansible.com_awxbackups.yaml
|
||||
- bases/awx.ansible.com_awxrestores.yaml
|
||||
#+kubebuilder:scaffold:crdkustomizeresource
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
# Adds namespace to all resources.
|
||||
namespace: awx
|
||||
|
||||
# Value of this field is prepended to the
|
||||
# names of all resources, e.g. a deployment named
|
||||
# "wordpress" becomes "alices-wordpress".
|
||||
# Note that it should also match with the prefix (text before '-') of the namespace
|
||||
# field above.
|
||||
namePrefix: awx-operator-
|
||||
|
||||
# Labels to add to all resources and selectors.
|
||||
# commonLabels:
|
||||
# someName: someValue
|
||||
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
|
||||
# - ../prometheus
|
||||
# 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.
|
||||
patchesStrategicMerge:
|
||||
- manager_auth_proxy_patch.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
#labels:
|
||||
#- includeSelectors: true
|
||||
# pairs:
|
||||
# someName: someValue
|
||||
|
||||
resources:
|
||||
- ../crd
|
||||
- ../rbac
|
||||
- ../manager
|
||||
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
|
||||
#- ../prometheus
|
||||
|
||||
# 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.
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
patches:
|
||||
- path: manager_auth_proxy_patch.yaml
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
# 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
|
||||
@@ -10,20 +9,32 @@ spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-rbac-proxy
|
||||
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
|
||||
args:
|
||||
- "--secure-listen-address=0.0.0.0:8443"
|
||||
- "--upstream=http://127.0.0.1:8080/"
|
||||
- "--logtostderr=true"
|
||||
- "--v=10"
|
||||
ports:
|
||||
- containerPort: 8443
|
||||
protocol: TCP
|
||||
name: https
|
||||
- name: awx-manager
|
||||
args:
|
||||
- "--health-probe-bind-address=:6789"
|
||||
- "--metrics-bind-address=127.0.0.1:8080"
|
||||
- "--leader-elect"
|
||||
- "--leader-election-id=awx-operator"
|
||||
- name: kube-rbac-proxy
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
|
||||
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"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -8,14 +7,14 @@ spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: awx-manager
|
||||
args:
|
||||
- "--config=controller_manager_config.yaml"
|
||||
volumeMounts:
|
||||
- name: awx-manager-config
|
||||
mountPath: /controller_manager_config.yaml
|
||||
subPath: controller_manager_config.yaml
|
||||
volumes:
|
||||
- name: awx-manager
|
||||
args:
|
||||
- "--config=controller_manager_config.yaml"
|
||||
volumeMounts:
|
||||
- name: awx-manager-config
|
||||
configMap:
|
||||
name: awx-manager-config
|
||||
mountPath: /controller_manager_config.yaml
|
||||
subPath: controller_manager_config.yaml
|
||||
volumes:
|
||||
- name: awx-manager-config
|
||||
configMap:
|
||||
name: awx-manager-config
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
---
|
||||
apiVersion: controller-runtime.sigs.k8s.io/v1beta1
|
||||
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
|
||||
kind: ControllerManagerConfig
|
||||
health:
|
||||
healthProbeBindAddress: :6789
|
||||
metrics:
|
||||
bindAddress: 127.0.0.1:8080
|
||||
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
resourceName: 811c9dc5.ansible.com
|
||||
# leaderElectionReleaseOnCancel defines if the leader should step down volume
|
||||
# when the Manager ends. This requires the binary to immediately end when the
|
||||
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
|
||||
# speeds up voluntary leader transitions as the new leader don't have to wait
|
||||
# LeaseDuration time first.
|
||||
# In the default scaffold provided, the program ends immediately after
|
||||
# the manager stops, so would be fine to enable this option. However,
|
||||
# if you are doing or is intended to do any operation such as perform cleanups
|
||||
# after the manager stops then its usage might be unsafe.
|
||||
# leaderElectionReleaseOnCancel: true
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
resources:
|
||||
- manager.yaml
|
||||
|
||||
generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
|
||||
configMapGenerator:
|
||||
- files:
|
||||
- name: awx-manager-config
|
||||
files:
|
||||
- controller_manager_config.yaml
|
||||
name: awx-manager-config
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
images:
|
||||
|
||||
@@ -20,48 +20,61 @@ spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
kubectl.kubernetes.io/default-container: awx-manager
|
||||
labels:
|
||||
control-plane: controller-manager
|
||||
spec:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
# For common cases that do not require escalating privileges
|
||||
# it is recommended to ensure that all your Pods/Containers are restrictive.
|
||||
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
|
||||
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
|
||||
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
|
||||
# seccompProfile:
|
||||
# type: RuntimeDefault
|
||||
containers:
|
||||
- args:
|
||||
- --leader-elect
|
||||
- --leader-election-id=awx-operator
|
||||
image: controller:latest
|
||||
name: awx-manager
|
||||
env:
|
||||
- name: ANSIBLE_GATHERING
|
||||
value: explicit
|
||||
- name: ANSIBLE_DEBUG_LOGS
|
||||
value: 'false'
|
||||
- name: WATCH_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 6789
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
port: 6789
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "4096Mi"
|
||||
cpu: "2000m"
|
||||
- args:
|
||||
- --leader-elect
|
||||
- --leader-election-id=awx-operator
|
||||
image: controller:latest
|
||||
name: awx-manager
|
||||
env:
|
||||
- name: ANSIBLE_GATHERING
|
||||
value: explicit
|
||||
- name: ANSIBLE_DEBUG_LOGS
|
||||
value: 'false'
|
||||
- name: WATCH_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- "ALL"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 6789
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
port: 6789
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "4096Mi"
|
||||
cpu: "2000m"
|
||||
serviceAccountName: controller-manager
|
||||
imagePullSecrets:
|
||||
- name: redhat-operators-pull-secret
|
||||
- name: redhat-operators-pull-secret
|
||||
terminationGracePeriodSeconds: 10
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,7 @@
|
||||
---
|
||||
# These resources constitute the fully configured set of manifests
|
||||
# used to generate the 'manifests/' directory in a bundle.
|
||||
resources:
|
||||
- bases/awx-operator.clusterserviceversion.yaml
|
||||
- ../default
|
||||
- ../samples
|
||||
- ../scorecard
|
||||
- bases/awx-operator.clusterserviceversion.yaml
|
||||
- ../default
|
||||
- ../samples
|
||||
- ../scorecard
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
---
|
||||
resources:
|
||||
- monitor.yaml
|
||||
- monitor.yaml
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
# Prometheus Monitor Service (Metrics)
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: metrics-reader
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/metrics"
|
||||
verbs:
|
||||
- get
|
||||
- nonResourceURLs:
|
||||
- "/metrics"
|
||||
verbs:
|
||||
- get
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: proxy-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- authentication.k8s.io
|
||||
resources:
|
||||
- tokenreviews
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- authorization.k8s.io
|
||||
resources:
|
||||
- subjectaccessreviews
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- authentication.k8s.io
|
||||
resources:
|
||||
- tokenreviews
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- authorization.k8s.io
|
||||
resources:
|
||||
- subjectaccessreviews
|
||||
verbs:
|
||||
- create
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
@@ -8,6 +7,6 @@ roleRef:
|
||||
kind: ClusterRole
|
||||
name: proxy-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: controller-manager
|
||||
namespace: system
|
||||
- kind: ServiceAccount
|
||||
name: controller-manager
|
||||
namespace: system
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
@@ -8,9 +7,9 @@ metadata:
|
||||
namespace: system
|
||||
spec:
|
||||
ports:
|
||||
- name: https
|
||||
port: 8443
|
||||
protocol: TCP
|
||||
targetPort: https
|
||||
- name: https
|
||||
port: 8443
|
||||
protocol: TCP
|
||||
targetPort: https
|
||||
selector:
|
||||
control-plane: controller-manager
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
---
|
||||
# permissions for end users to edit awxs.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awx-editor-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs/status
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs/status
|
||||
verbs:
|
||||
- get
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
---
|
||||
# permissions for end users to view awxs.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awx-viewer-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs/status
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxs/status
|
||||
verbs:
|
||||
- get
|
||||
|
||||
24
config/rbac/awxbackup_editor_role.yaml
Normal file
24
config/rbac/awxbackup_editor_role.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# permissions for end users to edit awxbackups.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awxbackup-editor-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxbackups
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxbackups/status
|
||||
verbs:
|
||||
- get
|
||||
20
config/rbac/awxbackup_viewer_role.yaml
Normal file
20
config/rbac/awxbackup_viewer_role.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
# permissions for end users to view awxbackups.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awxbackup-viewer-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxbackups
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxbackups/status
|
||||
verbs:
|
||||
- get
|
||||
24
config/rbac/awxrestore_editor_role.yaml
Normal file
24
config/rbac/awxrestore_editor_role.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# permissions for end users to edit awxrestores.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awxrestore-editor-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxrestores
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxrestores/status
|
||||
verbs:
|
||||
- get
|
||||
20
config/rbac/awxrestore_viewer_role.yaml
Normal file
20
config/rbac/awxrestore_viewer_role.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
# permissions for end users to view awxrestores.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: awxrestore-viewer-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxrestores
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- awx.ansible.com
|
||||
resources:
|
||||
- awxrestores/status
|
||||
verbs:
|
||||
- get
|
||||
@@ -1,19 +1,18 @@
|
||||
---
|
||||
resources:
|
||||
# All RBAC will be applied under this service account in
|
||||
# the deployment namespace. You may comment out this resource
|
||||
# if your manager will use a service account that exists at
|
||||
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
|
||||
# subjects if changing service account names.
|
||||
- service_account.yaml
|
||||
- role.yaml
|
||||
- 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
|
||||
# All RBAC will be applied under this service account in
|
||||
# the deployment namespace. You may comment out this resource
|
||||
# if your manager will use a service account that exists at
|
||||
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
|
||||
# subjects if changing service account names.
|
||||
- service_account.yaml
|
||||
- role.yaml
|
||||
- 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
|
||||
|
||||
@@ -1,38 +1,37 @@
|
||||
---
|
||||
# permissions to do leader election.
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: leader-election-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- patch
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
@@ -8,6 +7,6 @@ roleRef:
|
||||
kind: Role
|
||||
name: leader-election-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: controller-manager
|
||||
namespace: system
|
||||
- kind: ServiceAccount
|
||||
name: controller-manager
|
||||
namespace: system
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
|
||||
13
config/samples/awx_v1beta1_awxbackup.yaml
Normal file
13
config/samples/awx_v1beta1_awxbackup.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWXBackup
|
||||
metadata:
|
||||
name: example-awx-backup
|
||||
spec:
|
||||
deployment_name: example-awx
|
||||
backup_resource_requirements:
|
||||
limits:
|
||||
cpu: "1000m"
|
||||
memory: "4096Mi"
|
||||
requests:
|
||||
cpu: "25m"
|
||||
memory: "32Mi"
|
||||
14
config/samples/awx_v1beta1_awxrestore.yaml
Normal file
14
config/samples/awx_v1beta1_awxrestore.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWXRestore
|
||||
metadata:
|
||||
name: awxrestore-sample
|
||||
spec:
|
||||
deployment_name: example-awx-2
|
||||
backup_name: example-awx-backup
|
||||
restore_resource_requirements:
|
||||
limits:
|
||||
cpu: "1000m"
|
||||
memory: "4096Mi"
|
||||
requests:
|
||||
cpu: "25m"
|
||||
memory: "32Mi"
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
## Append samples you want in your CSV to this file as resources ##
|
||||
resources:
|
||||
- awx_v1beta1_awx.yaml
|
||||
# +kubebuilder:scaffold:manifestskustomizesamples
|
||||
- awx_v1beta1_awx.yaml
|
||||
- awx_v1beta1_awxbackup.yaml
|
||||
- awx_v1beta1_awxrestore.yaml
|
||||
#+kubebuilder:scaffold:manifestskustomizesamples
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
---
|
||||
apiVersion: scorecard.operatorframework.io/v1alpha3
|
||||
kind: Configuration
|
||||
metadata:
|
||||
name: config
|
||||
stages:
|
||||
- parallel: true
|
||||
tests: []
|
||||
- parallel: true
|
||||
tests: []
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
---
|
||||
resources:
|
||||
- bases/config.yaml
|
||||
- bases/config.yaml
|
||||
patchesJson6902:
|
||||
- path: patches/basic.config.yaml
|
||||
target:
|
||||
group: scorecard.operatorframework.io
|
||||
version: v1alpha3
|
||||
kind: Configuration
|
||||
name: config
|
||||
- path: patches/olm.config.yaml
|
||||
target:
|
||||
group: scorecard.operatorframework.io
|
||||
version: v1alpha3
|
||||
kind: Configuration
|
||||
name: config
|
||||
# +kubebuilder:scaffold:patchesJson6902
|
||||
- path: patches/basic.config.yaml
|
||||
target:
|
||||
group: scorecard.operatorframework.io
|
||||
version: v1alpha3
|
||||
kind: Configuration
|
||||
name: config
|
||||
- path: patches/olm.config.yaml
|
||||
target:
|
||||
group: scorecard.operatorframework.io
|
||||
version: v1alpha3
|
||||
kind: Configuration
|
||||
name: config
|
||||
#+kubebuilder:scaffold:patchesJson6902
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
- op: add
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- basic-check-spec
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- basic-check-spec
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: basic
|
||||
test: basic-check-spec-test
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
- op: add
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-bundle-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- olm-bundle-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-bundle-validation-test
|
||||
@@ -13,9 +12,9 @@
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-crds-have-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- olm-crds-have-validation
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-crds-have-validation-test
|
||||
@@ -23,9 +22,9 @@
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-crds-have-resources
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- olm-crds-have-resources
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-crds-have-resources-test
|
||||
@@ -33,9 +32,9 @@
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-spec-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- olm-spec-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-spec-descriptors-test
|
||||
@@ -43,9 +42,9 @@
|
||||
path: /stages/0/tests/-
|
||||
value:
|
||||
entrypoint:
|
||||
- scorecard-test
|
||||
- olm-status-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.12.0
|
||||
- scorecard-test
|
||||
- olm-status-descriptors
|
||||
image: quay.io/operator-framework/scorecard-test:v1.26.0
|
||||
labels:
|
||||
suite: olm
|
||||
test: olm-status-descriptors-test
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Adds namespace to all resources.
|
||||
namespace: osdk-test
|
||||
|
||||
namePrefix: osdk-
|
||||
|
||||
# Labels to add to all resources and selectors.
|
||||
# commonLabels:
|
||||
# someName: someValue
|
||||
patchesStrategicMerge:
|
||||
- manager_image.yaml
|
||||
- debug_logs_patch.yaml
|
||||
- ../default/manager_auth_proxy_patch.yaml
|
||||
#commonLabels:
|
||||
# someName: someValue
|
||||
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
@@ -18,4 +18,6 @@ images:
|
||||
- name: testing
|
||||
newName: testing-operator
|
||||
patches:
|
||||
- path: pull_policy/Never.yaml
|
||||
- path: manager_image.yaml
|
||||
- path: debug_logs_patch.yaml
|
||||
- path: ../default/manager_auth_proxy_patch.yaml
|
||||
|
||||
10
docs/README.md
Normal file
10
docs/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Building the Ansible AWX Operator Docs
|
||||
|
||||
To build the AWX Operator docs locally:
|
||||
|
||||
1. Clone the AWX operator repository.
|
||||
2. From the root directory:
|
||||
a. pip install --user -r docs/requirements.txt
|
||||
b. mkdocs build
|
||||
|
||||
This will create a new directory called `site/` in the root of your clone containing the index.html and static files. To view the docs in your browser, navigate there in your file explorer and double-click on the `index.html` file. This should open the docs site in your browser.
|
||||
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)
|
||||
3
docs/contributors-guide/contributing.md
Normal file
3
docs/contributors-guide/contributing.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Contributing
|
||||
|
||||
Please visit [our contributing guidelines](https://github.com/ansible/awx-operator/blob/devel/CONTRIBUTING.md).
|
||||
6
docs/contributors-guide/get-involved.md
Normal file
6
docs/contributors-guide/get-involved.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## Get Involved
|
||||
|
||||
We welcome your feedback and ideas. The AWX operator uses the same mailing list and IRC channel as AWX itself. Here's how to reach us with feedback and questions:
|
||||
|
||||
- Join the `#ansible-awx` channel on irc.libera.chat
|
||||
- Join the [mailing list](https://groups.google.com/forum/#!forum/awx-project)
|
||||
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
|
||||
```
|
||||
2
docs/index.md
Normal file
2
docs/index.md
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
The AWX operator is meant to provide a more Kubernetes-native installation method for AWX via an AWX Custom Resource Definition (CRD).
|
||||
152
docs/installation/basic-install.md
Normal file
152
docs/installation/basic-install.md
Normal file
@@ -0,0 +1,152 @@
|
||||
### Basic Install
|
||||
|
||||
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/ )
|
||||
|
||||
There is a make target you can run:
|
||||
```
|
||||
make deploy
|
||||
```
|
||||
|
||||
If you have a custom operator image you have built, you can specify it with:
|
||||
```
|
||||
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:
|
||||
|
||||
```
|
||||
$ 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:
|
||||
|
||||
```
|
||||
$ 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`:
|
||||
|
||||
```
|
||||
$ kubectl config set-context --current --namespace=awx
|
||||
```
|
||||
|
||||
Next, create a file named `awx-demo.yaml` 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
|
||||
```
|
||||
|
||||
> 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](#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.yaml
|
||||
...
|
||||
```
|
||||
|
||||
Finally, apply the changes to create the AWX instance in your cluster:
|
||||
|
||||
```
|
||||
kubectl apply -k .
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
$ kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager
|
||||
```
|
||||
|
||||
After a few seconds, you should see the operator begin to create new resources:
|
||||
|
||||
```
|
||||
$ 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
|
||||
```
|
||||
|
||||
Once deployed, the AWX instance will be accessible by running:
|
||||
|
||||
```
|
||||
$ minikube service -n awx awx-demo-service --url
|
||||
```
|
||||
|
||||
By default, the admin user is `admin` and the password is available in the `<resourcename>-admin-password` secret. To retrieve the admin password, run:
|
||||
|
||||
```
|
||||
$ 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!!!
|
||||
|
||||
For an example using the Nginx Ingress Controller in Minikube, don't miss our [demo video](https://asciinema.org/a/416946).
|
||||
50
docs/installation/creating-a-minikube-cluster-for-testing.md
Normal file
50
docs/installation/creating-a-minikube-cluster-for-testing.md
Normal file
@@ -0,0 +1,50 @@
|
||||
### 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.
|
||||
|
||||
```
|
||||
$ 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.
|
||||
|
||||
```
|
||||
$ 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:
|
||||
|
||||
```
|
||||
$ alias kubectl="minikube kubectl --"
|
||||
```
|
||||
29
docs/installation/helm-install-on-existing-cluster.md
Normal file
29
docs/installation/helm-install-on-existing-cluster.md
Normal file
@@ -0,0 +1,29 @@
|
||||
### Helm Install on existing cluster
|
||||
|
||||
For those that wish to use [Helm](https://helm.sh/) to install the awx-operator to an existing K8s cluster:
|
||||
|
||||
The helm chart is generated from the `helm-chart` Makefile section using the starter files in `.helm/starter`. Consult [the documentation](https://github.com/ansible/awx-operator/blob/devel/.helm/starter/README.md) on how to customize the AWX resource with your own values.
|
||||
|
||||
```bash
|
||||
$ helm repo add awx-operator https://ansible.github.io/awx-operator/
|
||||
"awx-operator" has been added to your repositories
|
||||
|
||||
$ helm repo update
|
||||
Hang tight while we grab the latest from your chart repositories...
|
||||
...Successfully got an update from the "awx-operator" chart repository
|
||||
Update Complete. ⎈Happy Helming!⎈
|
||||
|
||||
$ helm search repo awx-operator
|
||||
NAME CHART VERSION APP VERSION DESCRIPTION
|
||||
awx-operator/awx-operator 0.17.1 0.17.1 A Helm chart for the AWX Operator
|
||||
|
||||
$ helm install -n awx --create-namespace my-awx-operator awx-operator/awx-operator
|
||||
NAME: my-awx-operator
|
||||
LAST DEPLOYED: Thu Feb 17 22:09:05 2022
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
TEST SUITE: None
|
||||
NOTES:
|
||||
Helm Chart 0.17.1
|
||||
```
|
||||
2
docs/installation/index.md
Normal file
2
docs/installation/index.md
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
This Kubernetes Operator is meant to be deployed in your Kubernetes cluster(s) and can manage one or more AWX instances in any namespace.
|
||||
@@ -34,7 +34,7 @@ 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>
|
||||
12
docs/requirements.txt
Normal file
12
docs/requirements.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
cairosvg==2.7.0
|
||||
markdown-exec>=1.6.0
|
||||
mkdocs-ansible>=0.1.6
|
||||
mkdocs-gen-files>=0.4.0
|
||||
mkdocs-material-extensions>=1.1.1
|
||||
mkdocs-material>=9.1.18
|
||||
mkdocs
|
||||
mkdocstrings-python>=1.1.0
|
||||
mkdocstrings>=0.22.0
|
||||
pillow==9.5.0
|
||||
pipdeptree==2.7.1
|
||||
pymdown-extensions==10.0.1
|
||||
127
docs/troubleshooting/debugging.md
Normal file
127
docs/troubleshooting/debugging.md
Normal file
@@ -0,0 +1,127 @@
|
||||
# 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:
|
||||
|
||||
```
|
||||
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
|
||||
|
||||
And if installing via OperatorHub and OLM:
|
||||
* subscription
|
||||
* csv
|
||||
* installPlan
|
||||
* catalogSource
|
||||
|
||||
To inspect these resources you can use these commands
|
||||
|
||||
```
|
||||
# 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:
|
||||
|
||||
```
|
||||
---
|
||||
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](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
|
||||
```
|
||||
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
|
||||
service_type: nodeport
|
||||
image: $DEV_DOCKER_TAG_BASE/awx_kube_devel
|
||||
image_pull_policy: Always
|
||||
image_version: $COMPOSE_TAG
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
12
docs/uninstall/uninstall.md
Normal file
12
docs/uninstall/uninstall.md
Normal file
@@ -0,0 +1,12 @@
|
||||
### 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:
|
||||
|
||||
```
|
||||
$ 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.
|
||||
55
docs/upgrade/upgrading.md
Normal file
55
docs/upgrade/upgrading.md
Normal file
@@ -0,0 +1,55 @@
|
||||
### 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 `image_version` variable in `roles/installer/defaults/main.yml` for that particular release.
|
||||
|
||||
Apply the awx-operator.yml for that release to upgrade 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-13-<deployment-name>-postgres-13-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
|
||||
```
|
||||
|
||||
|
||||
#### 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
|
||||
|
||||
Delete your old AWX Operator and existing `awx-operator` service account, role and role binding in `default` namespace first:
|
||||
|
||||
```
|
||||
$ 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](#basic-install-on-existing-cluster). 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,90 @@
|
||||
#### 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 specificying 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 | postgres |
|
||||
| postgres_image_version | Image version to pull | 13 |
|
||||
| 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
|
||||
```
|
||||
35
docs/user-guide/advanced-configuration/auto-upgrade.md
Normal file
35
docs/user-guide/advanced-configuration/auto-upgrade.md
Normal file
@@ -0,0 +1,35 @@
|
||||
#### 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
|
||||
```
|
||||
$ kubectl -n awx delete deployment <yourInstanceName>
|
||||
```
|
||||
- wait until the instance gets redeployed
|
||||
@@ -0,0 +1,64 @@
|
||||
#### Containers HostAliases Requirements
|
||||
|
||||
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>
|
||||
```
|
||||
|
||||
#### 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: 100m, memory: 128Mi} |
|
||||
|
||||
Example of customization could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
web_resource_requirements:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 2Gi
|
||||
ephemeral-storage: 100M
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 4Gi
|
||||
ephemeral-storage: 500M
|
||||
task_resource_requirements:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 1Gi
|
||||
ephemeral-storage: 100M
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 2Gi
|
||||
ephemeral-storage: 500M
|
||||
ee_resource_requirements:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 100Mi
|
||||
ephemeral-storage: 100M
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 2Gi
|
||||
ephemeral-storage: 500M
|
||||
```
|
||||
@@ -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,159 @@
|
||||
#### 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
|
||||
custom.py: |
|
||||
INSIGHTS_URL_BASE = "example.org"
|
||||
AWX_CLEANUP_PATHS = True
|
||||
```
|
||||
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: custom-py
|
||||
configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: custom.py
|
||||
path: custom.py
|
||||
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
|
||||
|
||||
task_extra_volume_mounts: |
|
||||
- name: custom-py
|
||||
mountPath: /etc/tower/conf.d/custom.py
|
||||
subPath: custom.py
|
||||
- name: shared-volume
|
||||
mountPath: /shared
|
||||
```
|
||||
|
||||
> :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)
|
||||
|
||||
|
||||
##### Custom Favicon
|
||||
|
||||
You can 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
|
||||
$ oc 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
|
||||
```
|
||||
@@ -0,0 +1,43 @@
|
||||
#### 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`
|
||||
```
|
||||
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
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
#### Deploying a specific version of AWX
|
||||
|
||||
There are a few 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:latest |
|
||||
| redis_image | Path of the image to pull | docker.io/redis |
|
||||
| redis_image_version | Image version to pull | latest |
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
**Note**: 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.
|
||||
45
docs/user-guide/advanced-configuration/disable-ipv6.md
Normal file
45
docs/user-guide/advanced-configuration/disable-ipv6.md
Normal file
@@ -0,0 +1,45 @@
|
||||
### 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
|
||||
```
|
||||
|
||||
### Adding Execution Nodes
|
||||
Starting with AWX Operator v0.30.0 and AWX v21.7.0, standalone execution nodes can be added to your deployments.
|
||||
See [AWX execution nodes docs](https://github.com/ansible/awx/blob/devel/docs/execution_nodes.md) for information about this feature.
|
||||
|
||||
#### 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
|
||||
```
|
||||
|
||||
**Important Note**, 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,57 @@
|
||||
#### Enabling LDAP Integration at AWX bootstrap
|
||||
|
||||
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
|
||||
|
||||
> **NOTE:** These values are inserted into a Python file, so pay close attention to which values need quotes and which do not.
|
||||
|
||||
```yaml
|
||||
- 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,30 @@
|
||||
#### 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
|
||||
```
|
||||
26
docs/user-guide/advanced-configuration/extra-settings.md
Normal file
26
docs/user-guide/advanced-configuration/extra-settings.md
Normal file
@@ -0,0 +1,26 @@
|
||||
#### Extra Settings
|
||||
|
||||
With`extra_settings`, you can pass multiple custom settings via the `awx-operator`. The parameter `extra_settings` will be appended to the `/etc/tower/settings.py` and can be an alternative to the `extra_volumes` parameter.
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------- | -------------- | ------- |
|
||||
| extra_settings | Extra settings | '' |
|
||||
|
||||
**Note:** Parameters configured in `extra_settings` 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.
|
||||
|
||||
Example configuration of `extra_settings` parameter
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
extra_settings:
|
||||
- setting: MAX_PAGE_SIZE
|
||||
value: "500"
|
||||
|
||||
- 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.
|
||||
@@ -0,0 +1,28 @@
|
||||
#### Labeling operator managed objects
|
||||
|
||||
In certain situations labeling of Kubernetes objects managed by the operator
|
||||
might be desired (e.g. for owner identification purposes). For that
|
||||
`additional_labels` parameter could be used
|
||||
|
||||
| Name | Description | Default |
|
||||
| --------------------------- | ---------------------------------------------------------------------------------------- | ------- |
|
||||
| additional_labels | Additional labels defined on the resource, which should be propagated to child resources | [] |
|
||||
|
||||
Example configuration where only `my/team` and `my/service` labels will be
|
||||
propagated to child objects (`Deployment`, `Secret`s, `ServiceAccount`, etc):
|
||||
|
||||
```yaml
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
labels:
|
||||
my/team: "foo"
|
||||
my/service: "bar"
|
||||
my/do-not-inherit: "yes"
|
||||
spec:
|
||||
additional_labels:
|
||||
- my/team
|
||||
- my/service
|
||||
...
|
||||
```
|
||||
13
docs/user-guide/advanced-configuration/no-log.md
Normal file
13
docs/user-guide/advanced-configuration/no-log.md
Normal file
@@ -0,0 +1,13 @@
|
||||
#### No Log
|
||||
Configure no_log for tasks with no_log
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------ | -------------------- | ------- |
|
||||
| no_log | No log configuration | 'true' |
|
||||
|
||||
Example configuration of `no_log` parameter
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
no_log: true
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
#### Persisting Projects Directory
|
||||
|
||||
In cases which you want to persist the `/var/lib/projects` directory, there are few variables that are customizable for the `awx-operator`.
|
||||
|
||||
| Name | Description | Default |
|
||||
| ---------------------------- | ---------------------------------------------------------------------------------------------- | ------------- |
|
||||
| projects_persistence | Whether or not the /var/lib/projects directory will be persistent | false |
|
||||
| projects_storage_class | Define the PersistentVolume storage class | '' |
|
||||
| projects_storage_size | Define the PersistentVolume size | 8Gi |
|
||||
| projects_storage_access_mode | Define the PersistentVolume access mode | ReadWriteMany |
|
||||
| projects_existing_claim | Define an existing PersistentVolumeClaim to use (cannot be combined with `projects_storage_*`) | '' |
|
||||
|
||||
Example of customization when the `awx-operator` automatically handles the persistent volume could be:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
projects_persistence: true
|
||||
projects_storage_class: rook-ceph
|
||||
projects_storage_size: 20Gi
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
#### Pods termination grace period
|
||||
|
||||
During deployment restarts or new rollouts, when old ReplicaSet Pods are being
|
||||
terminated, the corresponding jobs which are managed (executed or controlled)
|
||||
by old AWX Pods may end up in `Error` state as there is no mechanism to
|
||||
transfer them to the newly spawned AWX Pods. To work around the problem one
|
||||
could set `termination_grace_period_seconds` in AWX spec, which does the
|
||||
following:
|
||||
|
||||
* It sets the corresponding
|
||||
[`terminationGracePeriodSeconds`](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
|
||||
Pod spec of the AWX Deployment to the value provided
|
||||
|
||||
> The grace period is the duration in seconds after the processes running in
|
||||
> the pod are sent a termination signal and the time when the processes are
|
||||
> forcibly halted with a kill signal
|
||||
|
||||
* It adds a
|
||||
[`PreStop`](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution)
|
||||
hook script, which will keep AWX Pods in terminating state until it finished,
|
||||
up to `terminationGracePeriodSeconds`.
|
||||
|
||||
> This grace period applies to the total time it takes for both the PreStop
|
||||
> hook to execute and for the Container to stop normally
|
||||
|
||||
While the hook script just waits until the corresponding AWX Pod (instance)
|
||||
no longer has any managed jobs, in which case it finishes with success and
|
||||
hands over the overall Pod termination process to normal AWX processes.
|
||||
|
||||
One may want to set this value to the maximum duration they accept to wait for
|
||||
the affected Jobs to finish. Keeping in mind that such finishing jobs may
|
||||
increase Pods termination time in such situations as `kubectl rollout restart`,
|
||||
AWX upgrade by the operator, or Kubernetes [API-initiated
|
||||
evictions](https://kubernetes.io/docs/concepts/scheduling-eviction/api-eviction/).
|
||||
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------------------------- | --------------------------------------------------------------- | ------- |
|
||||
| termination_grace_period_seconds | Optional duration in seconds pods needs to terminate gracefully | not set |
|
||||
17
docs/user-guide/advanced-configuration/priority-classes.md
Normal file
17
docs/user-guide/advanced-configuration/priority-classes.md
Normal file
@@ -0,0 +1,17 @@
|
||||
#### Priority Classes
|
||||
|
||||
The AWX and Postgres pods can be assigned a custom PriorityClass to rank their importance compared to other pods in your cluster, which determines which pods get evicted first if resources are running low.
|
||||
First, [create your PriorityClass](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass) if needed.
|
||||
Then set the name of your priority class to the control plane and postgres pods as shown below.
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
metadata:
|
||||
name: awx-demo
|
||||
spec:
|
||||
...
|
||||
control_plane_priority_class: awx-demo-high-priority
|
||||
postgres_priority_class: awx-demo-medium-priority
|
||||
```
|
||||
18
docs/user-guide/advanced-configuration/privileged-tasks.md
Normal file
18
docs/user-guide/advanced-configuration/privileged-tasks.md
Normal file
@@ -0,0 +1,18 @@
|
||||
#### Privileged Tasks
|
||||
|
||||
Depending on the type of tasks that you'll be running, you may find that you need the task pod to run as `privileged`. This can open yourself up to a variety of security concerns, so you should be aware (and verify that you have the privileges) to do this if necessary. In order to toggle this feature, you can add the following to your custom resource:
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
task_privileged: true
|
||||
```
|
||||
|
||||
If you are attempting to do this on an OpenShift cluster, you will need to grant the `awx` ServiceAccount the `privileged` SCC, which can be done with:
|
||||
|
||||
```
|
||||
$ oc adm policy add-scc-to-user privileged -z awx
|
||||
```
|
||||
|
||||
Again, this is the most relaxed SCC that is provided by OpenShift, so be sure to familiarize yourself with the security concerns that accompany this action.
|
||||
@@ -0,0 +1,13 @@
|
||||
#### Redis container capabilities
|
||||
|
||||
Depending on your kubernetes cluster and settings you might need to grant some capabilities to the redis container so it can start. Set the `redis_capabilities` option so the capabilities are added in the deployment.
|
||||
|
||||
```yaml
|
||||
---
|
||||
spec:
|
||||
...
|
||||
redis_capabilities:
|
||||
- CHOWN
|
||||
- SETUID
|
||||
- SETGID
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user