mirror of
https://github.com/ansible/awx-operator.git
synced 2026-04-21 00:01:02 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
718e5cfcb9 | ||
|
|
a8153d5ffb | ||
|
|
7b0a68c2f4 | ||
|
|
1c89044be4 | ||
|
|
15ed13dd8d | ||
|
|
f2ad70678c | ||
|
|
2ec77f1e7e | ||
|
|
aa7d0b9918 | ||
|
|
38209f9720 | ||
|
|
0ba4feaf7a | ||
|
|
d4c1fda066 | ||
|
|
0d97183bbf | ||
|
|
293f0158e0 | ||
|
|
bb30b3b9fe | ||
|
|
39bebe64ba | ||
|
|
5bd84b3d3e | ||
|
|
76e315d191 | ||
|
|
dd022258b5 | ||
|
|
019fa3d356 | ||
|
|
4a968aa605 |
19
.github/workflows/feature.yml
vendored
19
.github/workflows/feature.yml
vendored
@@ -29,25 +29,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "IMAGE_TAG_BASE=ghcr.io/${OWNER_LC}/awx-operator" >>${GITHUB_ENV}
|
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
|
- name: Log in to registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|||||||
25
.github/workflows/promote.yaml
vendored
25
.github/workflows/promote.yaml
vendored
@@ -3,11 +3,26 @@ name: Promote AWX Operator image
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Name for the tag of the release.'
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
promote:
|
promote:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set TAG_NAME for workflow_dispatch event
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set TAG_NAME for release event
|
||||||
|
if: ${{ github.event_name == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
depth: 0
|
depth: 0
|
||||||
@@ -22,10 +37,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Re-tag and promote awx-operator image
|
- name: Re-tag and promote awx-operator image
|
||||||
run: |
|
run: |
|
||||||
docker pull ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
docker pull ghcr.io/${{ github.repository }}:${TAG_NAME}
|
||||||
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
docker tag ghcr.io/${{ github.repository }}:${TAG_NAME} quay.io/${{ github.repository }}:${TAG_NAME}
|
||||||
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest
|
docker tag ghcr.io/${{ github.repository }}:${TAG_NAME} quay.io/${{ github.repository }}:latest
|
||||||
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
docker push quay.io/${{ github.repository }}:${TAG_NAME}
|
||||||
docker push quay.io/${{ github.repository }}:latest
|
docker push quay.io/${{ github.repository }}:latest
|
||||||
|
|
||||||
- name: Release Helm chart
|
- name: Release Helm chart
|
||||||
@@ -33,7 +48,7 @@ jobs:
|
|||||||
ansible-playbook ansible/helm-release.yml -v \
|
ansible-playbook ansible/helm-release.yml -v \
|
||||||
-e operator_image=quay.io/${{ github.repository }} \
|
-e operator_image=quay.io/${{ github.repository }} \
|
||||||
-e chart_owner=${{ github.repository_owner }} \
|
-e chart_owner=${{ github.repository_owner }} \
|
||||||
-e tag=${{ github.event.release.tag_name }} \
|
-e tag=${TAG_NAME} \
|
||||||
-e gh_token=${{ secrets.GITHUB_TOKEN }} \
|
-e gh_token=${{ secrets.GITHUB_TOKEN }} \
|
||||||
-e gh_user=${{ github.actor }} \
|
-e gh_user=${{ github.actor }} \
|
||||||
-e repo_type=https
|
-e repo_type=https
|
||||||
|
|||||||
76
.github/workflows/publish-operator-hub.yaml
vendored
Normal file
76
.github/workflows/publish-operator-hub.yaml
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
name: Publish AWX Operator on operator-hub
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Name for the tag of the release.'
|
||||||
|
required: true
|
||||||
|
operator_hub_fork:
|
||||||
|
description: 'Fork of operator-hub where the PR will be created from. default: awx-auto'
|
||||||
|
required: true
|
||||||
|
default: 'awx-auto'
|
||||||
|
image_registry:
|
||||||
|
description: 'Image registry where the image is published to. default: quay.io'
|
||||||
|
required: true
|
||||||
|
default: 'quay.io'
|
||||||
|
image_registry_organization:
|
||||||
|
description: 'Image registry organization where the image is published to. default: ansible'
|
||||||
|
required: true
|
||||||
|
default: 'ansible'
|
||||||
|
community_operator_github_org:
|
||||||
|
description: 'Github organization for community-opeartor project. default: k8s-operatorhub'
|
||||||
|
required: true
|
||||||
|
default: 'k8s-operatorhub'
|
||||||
|
community_operator_prod_github_org:
|
||||||
|
description: 'GitHub organization for community-operator-prod project. default: redhat-openshift-ecosystem'
|
||||||
|
required: true
|
||||||
|
default: 'redhat-openshift-ecosystem'
|
||||||
|
jobs:
|
||||||
|
promote:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set TAG_NAME from workflow_dispatch event
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set TAG_NAME for release event
|
||||||
|
if: ${{ github.event_name == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Log in to image registry
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.QUAY_TOKEN }} | docker login ${{github.event.inputs.image_registry}} -u ${{ secrets.QUAY_USER }} --password-stdin
|
||||||
|
|
||||||
|
- name: Checkout awx-operator at workflow branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: awx-operator
|
||||||
|
|
||||||
|
- name: Checkout awx-opearator at TAG_NAME
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
ref: ${{ env.TAG_NAME }}
|
||||||
|
path: awx-operator-${{ env.TAG_NAME }}
|
||||||
|
|
||||||
|
- name: Copy scripts to awx-operator-${{ env.TAG_NAME }}
|
||||||
|
run: |
|
||||||
|
cp -f \
|
||||||
|
awx-operator/hack/publish-to-operator-hub.sh \
|
||||||
|
awx-operator-${{ env.TAG_NAME }}/hack/publish-to-operator-hub.sh
|
||||||
|
|
||||||
|
- name: Build and publish bundle to operator-hub
|
||||||
|
working-directory: awx-operator-${{ env.TAG_NAME }}
|
||||||
|
env:
|
||||||
|
IMG_REPOSITORY: ${{ github.event.inputs.image_registry }}/${{ github.event.inputs.image_registry_organization }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.AWX_AUTO_GITHUB_TOKEN }}
|
||||||
|
COMMUNITY_OPERATOR_GITHUB_ORG: ${{ github.event.inputs.community_operator_github_org }}
|
||||||
|
COMMUNITY_OPERATOR_PROD_GITHUB_ORG: ${{ github.event.inputs.community_operator_prod_github_org }}
|
||||||
|
run: |
|
||||||
|
git config --global user.email "awx-automation@redhat.com"
|
||||||
|
git config --global user.name "AWX Automation"
|
||||||
|
./hack/publish-to-operator-hub.sh
|
||||||
31
Makefile
31
Makefile
@@ -4,6 +4,7 @@
|
|||||||
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
|
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
|
||||||
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
|
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
|
||||||
VERSION ?= $(shell git describe --tags)
|
VERSION ?= $(shell git describe --tags)
|
||||||
|
PREV_VERSION ?= $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
|
||||||
|
|
||||||
CONTAINER_CMD ?= docker
|
CONTAINER_CMD ?= docker
|
||||||
|
|
||||||
@@ -88,6 +89,10 @@ all: docker-build
|
|||||||
help: ## Display this 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)
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
.PHONY: print-%
|
||||||
|
print-%: ## Print any variable from the Makefile. Use as `make print-VARIABLE`
|
||||||
|
@echo $($*)
|
||||||
|
|
||||||
##@ Build
|
##@ Build
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
@@ -149,6 +154,22 @@ KUSTOMIZE = $(shell which kustomize)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: operator-sdk
|
||||||
|
OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
|
||||||
|
operator-sdk: ## Download operator-sdk locally if necessary, preferring the $(pwd)/bin path over global if both exist.
|
||||||
|
ifeq (,$(wildcard $(OPERATOR_SDK)))
|
||||||
|
ifeq (,$(shell which operator-sdk 2>/dev/null))
|
||||||
|
@{ \
|
||||||
|
set -e ;\
|
||||||
|
mkdir -p $(dir $(OPERATOR_SDK)) ;\
|
||||||
|
curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/operator-sdk_$(OS)_$(ARCHA) ;\
|
||||||
|
chmod +x $(OPERATOR_SDK) ;\
|
||||||
|
}
|
||||||
|
else
|
||||||
|
OPERATOR_SDK = $(shell which operator-sdk)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: ansible-operator
|
.PHONY: ansible-operator
|
||||||
ANSIBLE_OPERATOR = $(shell pwd)/bin/ansible-operator
|
ANSIBLE_OPERATOR = $(shell pwd)/bin/ansible-operator
|
||||||
ansible-operator: ## Download ansible-operator locally if necessary, preferring the $(pwd)/bin path over global if both exist.
|
ansible-operator: ## Download ansible-operator locally if necessary, preferring the $(pwd)/bin path over global if both exist.
|
||||||
@@ -157,7 +178,7 @@ ifeq (,$(shell which ansible-operator 2>/dev/null))
|
|||||||
@{ \
|
@{ \
|
||||||
set -e ;\
|
set -e ;\
|
||||||
mkdir -p $(dir $(ANSIBLE_OPERATOR)) ;\
|
mkdir -p $(dir $(ANSIBLE_OPERATOR)) ;\
|
||||||
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.26.0/ansible-operator_$(OS)_$(ARCHA) ;\
|
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/ansible-operator_$(OS)_$(ARCHA) ;\
|
||||||
chmod +x $(ANSIBLE_OPERATOR) ;\
|
chmod +x $(ANSIBLE_OPERATOR) ;\
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -166,11 +187,11 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: bundle
|
.PHONY: bundle
|
||||||
bundle: kustomize ## Generate bundle manifests and metadata, then validate generated files.
|
bundle: kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
|
||||||
operator-sdk generate kustomize manifests -q
|
$(OPERATOR_SDK) generate kustomize manifests -q
|
||||||
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
|
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
|
||||||
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
|
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
|
||||||
operator-sdk bundle validate ./bundle
|
$(OPERATOR_SDK) bundle validate ./bundle
|
||||||
|
|
||||||
.PHONY: bundle-build
|
.PHONY: bundle-build
|
||||||
bundle-build: ## Build the bundle image.
|
bundle-build: ## Build the bundle image.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[](https://opensource.org/licenses/Apache-2.0)
|
[](https://opensource.org/licenses/Apache-2.0)
|
||||||
[](https://github.com/ansible/awx-operator/actions)
|
[](https://github.com/ansible/awx-operator/actions)
|
||||||
[](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
|
[](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
|
||||||
[](https://groups.google.com/g/awx-project)
|
[](https://groups.google.com/g/awx-project)
|
||||||
[](https://libera.chat)
|
[](https://libera.chat)
|
||||||
|
|
||||||
@@ -111,4 +111,3 @@ We welcome your feedback and ideas. The AWX operator uses the same mailing list
|
|||||||
|
|
||||||
- Join the [Ansible AWX channel on Matrix](https://matrix.to/#/#awx:ansible.com)
|
- Join the [Ansible AWX channel on Matrix](https://matrix.to/#/#awx:ansible.com)
|
||||||
- Join the [Ansible Community Forum](https://forum.ansible.com)
|
- Join the [Ansible Community Forum](https://forum.ansible.com)
|
||||||
- Join the [mailing list](https://groups.google.com/forum/#!forum/awx-project)
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ spec:
|
|||||||
capabilities:
|
capabilities:
|
||||||
drop:
|
drop:
|
||||||
- "ALL"
|
- "ALL"
|
||||||
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
|
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
|
||||||
args:
|
args:
|
||||||
- "--secure-listen-address=0.0.0.0:8443"
|
- "--secure-listen-address=0.0.0.0:8443"
|
||||||
- "--upstream=http://127.0.0.1:8080/"
|
- "--upstream=http://127.0.0.1:8080/"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ spec:
|
|||||||
path: postgres_security_context_settings
|
path: postgres_security_context_settings
|
||||||
x-descriptors:
|
x-descriptors:
|
||||||
- urn:alm:descriptor:com.tectonic.ui:advanced
|
- urn:alm:descriptor:com.tectonic.ui:advanced
|
||||||
- urn:alm:descriptor:com.tectonic.ui:hidden
|
- urn:alm:descriptor:com.tectonic.ui:hidden
|
||||||
- displayName: PostgreSQL Image
|
- displayName: PostgreSQL Image
|
||||||
path: postgres_image
|
path: postgres_image
|
||||||
x-descriptors:
|
x-descriptors:
|
||||||
|
|||||||
55
config/samples/awx_v1beta1_awx_resource_limits.yaml
Normal file
55
config/samples/awx_v1beta1_awx_resource_limits.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
apiVersion: awx.ansible.com/v1beta1
|
||||||
|
kind: AWX
|
||||||
|
metadata:
|
||||||
|
name: awx-with-limits
|
||||||
|
spec:
|
||||||
|
task_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 2000m
|
||||||
|
memory: 4Gi
|
||||||
|
web_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
|
ee_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
|
redis_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
|
rsyslog_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 2Gi
|
||||||
|
init_container_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 2Gi
|
||||||
|
postgres_init_container_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 2Gi
|
||||||
@@ -9,7 +9,7 @@ After the draft release is created, publish it and the [Promote AWX Operator ima
|
|||||||
- Publish image to Quay
|
- Publish image to Quay
|
||||||
- Release Helm chart
|
- Release Helm chart
|
||||||
|
|
||||||
After the GHA is complete, the final step is to run the [publish-to-operator-hub.sh](./hack/publish-to-operator-hub.sh) script, which will create a PR in the following repos to add the new awx-operator bundle version to OperatorHub:
|
After the GHA is complete, the final step is to run the [publish-to-operator-hub.sh](https://github.com/ansible/awx-operator/blob/devel/hack/publish-to-operator-hub.sh) script, which will create a PR in the following repos to add the new awx-operator bundle version to OperatorHub:
|
||||||
* https://github.com/k8s-operatorhub/community-operators (community operator index)
|
* https://github.com/k8s-operatorhub/community-operators (community operator index)
|
||||||
* https://github.com/redhat-openshift-ecosystem/community-operators-prod (operator index shipped with Openshift)
|
* https://github.com/redhat-openshift-ecosystem/community-operators-prod (operator index shipped with Openshift)
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ spec:
|
|||||||
service_type: nodeport
|
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).
|
> It may make sense to create and specify your own secret key for your deployment so that if the k8s secret gets deleted, it can be re-created if needed. If it is not provided, one will be auto-generated, but cannot be recovered if lost. Read more [here](../user-guide/admin-user-account-configuration.md#secret-key-configuration).
|
||||||
|
|
||||||
If you are on Openshift, you can take advantage of Routes by specifying the following your spec. This will automatically create a Route for you with a custom hostname. This can be found on the Route section of the Openshift Console.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ mkdocs-material>=9.1.18
|
|||||||
mkdocs
|
mkdocs
|
||||||
mkdocstrings-python>=1.1.0
|
mkdocstrings-python>=1.1.0
|
||||||
mkdocstrings>=0.22.0
|
mkdocstrings>=0.22.0
|
||||||
pillow==9.5.0
|
pillow==10.0.1
|
||||||
pipdeptree==2.7.1
|
pipdeptree==2.7.1
|
||||||
pymdown-extensions==10.0.1
|
pymdown-extensions==10.0.1
|
||||||
|
|||||||
@@ -26,7 +26,13 @@ The resource requirements for both, the task and the web containers are configur
|
|||||||
| -------------------------- | ------------------------------------------------ | ------------------------------------ |
|
| -------------------------- | ------------------------------------------------ | ------------------------------------ |
|
||||||
| web_resource_requirements | Web container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
| web_resource_requirements | Web container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||||
| task_resource_requirements | Task 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} |
|
| ee_resource_requirements | EE control plane container resource requirements | requests: {cpu: 50m, memory: 64Mi} |
|
||||||
|
| redis_resource_requirements | Redis container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||||
|
| postgres_resource_requirements | Postgres container resource requirements | requests: {cpu: 10m, memory: 64Mi} |
|
||||||
|
| rsyslog_resource_requirements | Rsyslog container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||||
|
| init_container_resource_requirements | Init Container resource requirements | requests: {cpu: 100m, memory: 128Mi} |
|
||||||
|
| postgres_init_container_resource_requirements | Postgres Init Container resource requirements | requests: {cpu: 10m, memory: 64Mi} |
|
||||||
|
|
||||||
|
|
||||||
Example of customization could be:
|
Example of customization could be:
|
||||||
|
|
||||||
@@ -34,31 +40,63 @@ Example of customization could be:
|
|||||||
---
|
---
|
||||||
spec:
|
spec:
|
||||||
...
|
...
|
||||||
web_resource_requirements:
|
|
||||||
requests:
|
|
||||||
cpu: 250m
|
|
||||||
memory: 2Gi
|
|
||||||
ephemeral-storage: 100M
|
|
||||||
limits:
|
|
||||||
cpu: 1000m
|
|
||||||
memory: 4Gi
|
|
||||||
ephemeral-storage: 500M
|
|
||||||
task_resource_requirements:
|
task_resource_requirements:
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 100m
|
||||||
memory: 1Gi
|
memory: 128Mi
|
||||||
ephemeral-storage: 100M
|
ephemeral-storage: 100M
|
||||||
limits:
|
limits:
|
||||||
cpu: 2000m
|
cpu: 2000m
|
||||||
memory: 2Gi
|
memory: 4Gi
|
||||||
ephemeral-storage: 500M
|
ephemeral-storage: 500M
|
||||||
|
web_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
ee_resource_requirements:
|
ee_resource_requirements:
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 64Mi
|
||||||
ephemeral-storage: 100M
|
|
||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
|
redis_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 4Gi
|
||||||
|
rsyslog_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 2Gi
|
||||||
|
init_container_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 2Gi
|
||||||
|
postgres_init_container_resource_requirements:
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
memory: 2Gi
|
memory: 2Gi
|
||||||
ephemeral-storage: 500M
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Limits and ResourceQuotas
|
||||||
|
|
||||||
|
If the cluster you are deploying in has a ResoruceQuota, you will need to configure resource limits for all of the pods deployed in that cluster. This can be done for AWX pods on the AWX spec in the manner shown above.
|
||||||
|
|
||||||
|
There is an example you can use in [`config/samples/awx_v1beta1_awx_resource_limits.yaml`](../../../config/samples/awx_v1beta1_awx_resource_limits.yaml).
|
||||||
|
|||||||
100
hack/publish-to-operator-hub.sh
Normal file → Executable file
100
hack/publish-to-operator-hub.sh
Normal file → Executable file
@@ -15,43 +15,42 @@
|
|||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# First, check out awx-operator tag you intend to release, in this case, 1.0.0
|
# First, check out awx-operator tag you intend to release, in this case, 1.0.0
|
||||||
# $ VERSION=1.1.2 PREV_VERSION=1.1.1 FORK=<your-fork> ./publish-operator.sh
|
# $ VERSION=1.1.2 PREV_VERSION=1.1.1 FORK=<your-fork> ./hack/publish-to-operator-hub.sh
|
||||||
#
|
#
|
||||||
# Remember to change update the VERSION and PREV_VERSION before running!!!
|
# Remember to change update the VERSION and PREV_VERSION before running!!!
|
||||||
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=${VERSION:-blah2}
|
VERSION=${VERSION:-$(make print-VERSION)}
|
||||||
PREV_VERSION=${PREV_VERSION:-blah1}
|
PREV_VERSION=${PREV_VERSION:-$(make print-PREV_VERSION)}
|
||||||
|
|
||||||
BRANCH=publish-awx-operator-$VERSION
|
BRANCH=publish-awx-operator-$VERSION
|
||||||
FORK=${FORK:-fork}
|
FORK=${FORK:-awx-auto}
|
||||||
|
GITHUB_TOKEN=${GITHUB_TOKEN:-$AWX_AUTO_GITHUB_TOKEN}
|
||||||
|
|
||||||
IMG=quay.io/ansible/awx-operator:$VERSION
|
IMG_REPOSITORY=${IMG_REPOSITORY:-quay.io/ansible}
|
||||||
CATALOG_IMG=quay.io/ansible/awx-operator-catalog:$VERSION
|
|
||||||
BUNDLE_IMG=quay.io/ansible/awx-operator-bundle:$VERSION
|
|
||||||
|
|
||||||
# Set path variables
|
OPERATOR_IMG=$IMG_REPOSITORY/awx-operator:$VERSION
|
||||||
OPERATOR_PATH=${OPERATOR_PATH:-~/awx-operator}
|
CATALOG_IMG=$IMG_REPOSITORY/awx-operator-catalog:$VERSION
|
||||||
|
BUNDLE_IMG=$IMG_REPOSITORY/awx-operator-bundle:$VERSION
|
||||||
|
|
||||||
# Build & Push Operator Image # Not needed because it is done as part of the GHA release automation
|
COMMUNITY_OPERATOR_GITHUB_ORG=${COMMUNITY_OPERATOR_GITHUB_ORG:-k8s-operatorhub}
|
||||||
# make docker-build docker-push IMG=$IMG
|
COMMUNITY_OPERATOR_PROD_GITHUB_ORG=${COMMUNITY_OPERATOR_PROD_GITHUB_ORG:-redhat-openshift-ecosystem}
|
||||||
|
|
||||||
# Build bundle directory
|
# Build bundle directory
|
||||||
rm -rf bundle/
|
make bundle IMG=$OPERATOR_IMG
|
||||||
make bundle IMG=$IMG
|
|
||||||
|
|
||||||
# Build bundle and catalog images
|
# Build bundle and catalog images
|
||||||
make bundle-build bundle-push BUNDLE_IMG=$BUNDLE_IMG IMG=$IMG
|
make bundle-build bundle-push BUNDLE_IMG=$BUNDLE_IMG IMG=$OPERATOR_IMG
|
||||||
make catalog-build catalog-push CATALOG_IMG=$CATALOG_IMG BUNDLE_IMGS=$BUNDLE_IMG BUNDLE_IMG=$BUNDLE_IMG IMG=$IMG
|
make catalog-build catalog-push CATALOG_IMG=$CATALOG_IMG BUNDLE_IMGS=$BUNDLE_IMG BUNDLE_IMG=$BUNDLE_IMG IMG=$OPERATOR_IMG
|
||||||
|
|
||||||
# Set containerImage & namespace variables in CSV
|
# Set containerImage & namespace variables in CSV
|
||||||
sed -i -e "s|containerImage: quay.io/ansible/awx-operator:devel|containerImage: quay.io/ansible/awx-operator:${VERSION}|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
sed -i.bak -e "s|containerImage: quay.io/ansible/awx-operator:devel|containerImage: ${OPERATOR_IMG}|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
||||||
sed -i -e "s|namespace: placeholder|namespace: awx|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
sed -i.bak -e "s|namespace: placeholder|namespace: awx|g" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
||||||
|
|
||||||
# Add replaces to dependency graph for upgrade path
|
# Add replaces to dependency graph for upgrade path
|
||||||
if ! grep -qF 'replaces: awx-operator.v${PREV_VERSION}' bundle/manifests/awx-operator.clusterserviceversion.yaml; then
|
if ! grep -qF 'replaces: awx-operator.v${PREV_VERSION}' bundle/manifests/awx-operator.clusterserviceversion.yaml; then
|
||||||
sed -i -e "/version: ${VERSION}/a \\
|
sed -i.bak -e "/version: ${VERSION}/a \\
|
||||||
replaces: awx-operator.v$PREV_VERSION" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
replaces: awx-operator.v$PREV_VERSION" bundle/manifests/awx-operator.clusterserviceversion.yaml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -60,21 +59,20 @@ mv bundle/manifests/awx-operator.clusterserviceversion.yaml bundle/manifests/awx
|
|||||||
|
|
||||||
# Set Openshift Support Range (bump minKubeVersion in CSV when changing)
|
# Set Openshift Support Range (bump minKubeVersion in CSV when changing)
|
||||||
if ! grep -qF 'openshift.versions' bundle/metadata/annotations.yaml; then
|
if ! grep -qF 'openshift.versions' bundle/metadata/annotations.yaml; then
|
||||||
sed -i -e "/annotations:/a \\
|
sed -i.bak -e "/annotations:/a \\
|
||||||
com.redhat.openshift.versions: v4.10-v4.13\n" bundle/metadata/annotations.yaml
|
com.redhat.openshift.versions: v4.11" bundle/metadata/annotations.yaml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# -- Put up community-operators PR
|
# Remove .bak files from bundle result from sed commands
|
||||||
cd $OPERATOR_PATH
|
find bundle -name "*.bak" -type f -delete
|
||||||
git clone git@github.com:k8s-operatorhub/community-operators.git
|
|
||||||
|
echo "-- Create branch on community-operators fork --"
|
||||||
|
git clone https://github.com/$COMMUNITY_OPERATOR_GITHUB_ORG/community-operators.git
|
||||||
|
|
||||||
mkdir -p community-operators/operators/awx-operator/$VERSION/
|
mkdir -p community-operators/operators/awx-operator/$VERSION/
|
||||||
cp -r bundle/* community-operators/operators/awx-operator/$VERSION/
|
cp -r bundle/* community-operators/operators/awx-operator/$VERSION/
|
||||||
cd community-operators/operators/awx-operator/$VERSION/
|
pushd community-operators/operators/awx-operator/$VERSION/
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
# Commit and push PR
|
|
||||||
git checkout -b $BRANCH
|
git checkout -b $BRANCH
|
||||||
git add ./
|
git add ./
|
||||||
git status
|
git status
|
||||||
@@ -83,26 +81,26 @@ message='operator [N] [CI] awx-operator'
|
|||||||
commitMessage="${message} ${VERSION}"
|
commitMessage="${message} ${VERSION}"
|
||||||
git commit -m "$commitMessage" -s
|
git commit -m "$commitMessage" -s
|
||||||
|
|
||||||
git remote add upstream git@github.com:$FORK/community-operators.git
|
git remote add upstream https://$GITHUB_TOKEN@github.com/$FORK/community-operators.git
|
||||||
|
|
||||||
|
git push upstream --delete $BRANCH || true
|
||||||
git push upstream $BRANCH
|
git push upstream $BRANCH
|
||||||
|
|
||||||
|
gh pr create \
|
||||||
|
--title "operator awx-operator (${VERSION})" \
|
||||||
|
--body "operator awx-operator (${VERSION})" \
|
||||||
|
--base main \
|
||||||
|
--head $FORK:$BRANCH \
|
||||||
|
--repo $COMMUNITY_OPERATOR_GITHUB_ORG/community-operators
|
||||||
|
popd
|
||||||
|
|
||||||
# -- Put up community-operators-prod PR
|
echo "-- Create branch on community-operators-prod fork --"
|
||||||
# Reset directory
|
git clone https://github.com/$COMMUNITY_OPERATOR_PROD_GITHUB_ORG/community-operators-prod.git
|
||||||
cd $OPERATOR_PATH
|
|
||||||
|
|
||||||
pwd
|
|
||||||
|
|
||||||
git clone git@github.com:redhat-openshift-ecosystem/community-operators-prod.git
|
|
||||||
|
|
||||||
mkdir -p community-operators-prod/operators/awx-operator/$VERSION/
|
mkdir -p community-operators-prod/operators/awx-operator/$VERSION/
|
||||||
cp -r bundle/* community-operators-prod/operators/awx-operator/$VERSION/
|
cp -r bundle/* community-operators-prod/operators/awx-operator/$VERSION/
|
||||||
cd community-operators-prod/operators/awx-operator/$VERSION/
|
pushd community-operators-prod/operators/awx-operator/$VERSION/
|
||||||
|
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
# Commit and push PR
|
|
||||||
git checkout -b $BRANCH
|
git checkout -b $BRANCH
|
||||||
git add ./
|
git add ./
|
||||||
git status
|
git status
|
||||||
@@ -111,15 +109,15 @@ message='operator [N] [CI] awx-operator'
|
|||||||
commitMessage="${message} ${VERSION}"
|
commitMessage="${message} ${VERSION}"
|
||||||
git commit -m "$commitMessage" -s
|
git commit -m "$commitMessage" -s
|
||||||
|
|
||||||
git remote add upstream git@github.com:$FORK/community-operators-prod.git
|
git remote add upstream https://$GITHUB_TOKEN@github.com/$FORK/community-operators-prod.git
|
||||||
|
|
||||||
|
git push upstream --delete $BRANCH || true
|
||||||
git push upstream $BRANCH
|
git push upstream $BRANCH
|
||||||
|
|
||||||
|
gh pr create \
|
||||||
# -- Print Links to Branches
|
--title "operator awx-operator (${VERSION})" \
|
||||||
echo "Commnity Operators: https://github.com/$FORK/community-operators/pull/new/$BRANCH"
|
--body "operator awx-operator (${VERSION})" \
|
||||||
echo "Commnity Operators Prod: https://github.com/$FORK/community-operators-prod/pull/new/$BRANCH"
|
--base main \
|
||||||
|
--head $FORK:$BRANCH \
|
||||||
# -- Cleanup
|
--repo $COMMUNITY_OPERATOR_PROD_GITHUB_ORG/community-operators-prod
|
||||||
|
popd
|
||||||
rm -rf $OPERATOR_PATH/community-operators
|
|
||||||
rm -rf $OPERATOR_PATH/community-operators-prod
|
|
||||||
|
|||||||
@@ -96,8 +96,26 @@
|
|||||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||||
pod: "{{ awx_task_pod_name }}"
|
pod: "{{ awx_task_pod_name }}"
|
||||||
container: "{{ ansible_operator_meta.name }}-task"
|
container: "{{ ansible_operator_meta.name }}-task"
|
||||||
command: >-
|
command: |
|
||||||
bash -c "awx-manage migrate --noinput"
|
bash -c "
|
||||||
|
function end_keepalive {
|
||||||
|
rc=$?
|
||||||
|
rm -f \"$1\"
|
||||||
|
kill $(cat /proc/$2/task/$2/children 2>/dev/null) 2>/dev/null || true
|
||||||
|
wait $2 || true
|
||||||
|
exit $rc
|
||||||
|
}
|
||||||
|
keepalive_file=\"$(mktemp)\"
|
||||||
|
while [[ -f \"$keepalive_file\" ]]; do
|
||||||
|
echo 'Database schema migration in progress...'
|
||||||
|
sleep 60
|
||||||
|
done &
|
||||||
|
keepalive_pid=$!
|
||||||
|
trap 'end_keepalive \"$keepalive_file\" \"$keepalive_pid\"' EXIT SIGINT SIGTERM
|
||||||
|
echo keepalive_pid: $keepalive_pid
|
||||||
|
awx-manage migrate --noinput
|
||||||
|
echo 'Successful'
|
||||||
|
"
|
||||||
register: migrate_result
|
register: migrate_result
|
||||||
when:
|
when:
|
||||||
- awx_task_pod_name != ''
|
- awx_task_pod_name != ''
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
keepalive_file=\"$(mktemp)\"
|
keepalive_file=\"$(mktemp)\"
|
||||||
while [[ -f \"$keepalive_file\" ]]; do
|
while [[ -f \"$keepalive_file\" ]]; do
|
||||||
echo 'Migrating data to new PostgreSQL {{ supported_postgres_version }} Database...'
|
echo 'Migrating data to new PostgreSQL {{ supported_pg_version }} Database...'
|
||||||
sleep 60
|
sleep 60
|
||||||
done &
|
done &
|
||||||
keepalive_pid=$!
|
keepalive_pid=$!
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ spec:
|
|||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if security_context_settings|length %}
|
{% if security_context_settings|length %}
|
||||||
{{ security_context_settings | to_nice_yaml | indent(10) }}
|
{{ security_context_settings | to_nice_yaml | indent(8) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if termination_grace_period_seconds is defined %}
|
{% if termination_grace_period_seconds is defined %}
|
||||||
|
|||||||
Reference in New Issue
Block a user