ansible/awx-operator

Google OAuth2 settings in extra_settings cause the deployment to fail

Open

#991 创建于 2022年7月22日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Jinja (712 fork)auto 404
help wanted

仓库指标

Star
 (1,488 star)
PR 合并指标
 (PR 指标待抓取)

描述

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

Trying to configure Google OAuth2 via extra_settings in awx-demo.yml causes the deployment to fail or loop.

AWX Operator version

0.25.0

AWX version

21.3.0

Kubernetes platform

kubernetes

Kubernetes/Platform version

client (1.24) server (1.21)

Modifications

no

Steps to reproduce

1. run kustomize build . | kubectl apply -f - with the following content:

kustomization.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=0.25.0
  # - ./awx-demo.yml

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 0.25.0

# Specify a custom namespace in which to install AWX
namespace: awx

2. run kustomize build . | kubectl apply -f - with the following content (note - ./awx-demo.yml is uncommented):

kustomization.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=0.25.0
  - ./awx-demo.yml

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 0.25.0

# Specify a custom namespace in which to install AWX
namespace: awx

awx-demo.yml

---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx-demo
spec:
  no_log: 'false'
  ingress_type: ingress
  hostname: tst-awx.domain.de
  ingress_annotations: |
    kubernetes.io/ingress.class: nginx
  ingress_tls_secret: tls-domain-de
  ingress_path: /
  admin_user: admin
  admin_password_secret: awx-demo-admin-password
  extra_settings:
    - setting: AWX_CONTAINER_GROUP_POD_PENDING_TIMEOUT
      value: '"10m"'
    - setting: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY
      value: '"xxx.apps.googleusercontent.com"'
    - setting: SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET
      value: '"xxx"'
    - setting: SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS
      value: |
        [
          "domain.com"
        ]
    - setting: SOCIAL_AUTH_ORGANIZATION_MAP
      value: |
        {
        "MyOrg": {
          "admins": [
            "/^(user1|user2|user3)@domain\\.com$/i"
            ],
          "remove_users": true,
          "users": [
            "/^(user1|user2|user3)@domain\\.com$/i"
            ]
          }
        }
    - setting: SOCIAL_AUTH_TEAM_MAP
      value: |
        {
          "DevOps": {
            "organization": "MyOrg",
            "remove": true,
            "users": [
              "/^(user1|user2|user3)@domain\\.com$/i"
            ]
          }
        }
    - setting: SOCIAL_AUTH_USER_FIELDS
      value: "null"

Expected results

The awx instance is deployed, Google OAuth2 login is configured

Actual results

The ansible-run logs observable with kubectl logs -f awx-operator-controller-manager-86c5c8cb86-kd98h -c awx-manager -n awx seem to be in a loop, the deployment never completes.

Removing the lines from - setting: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY till the end of awx-demo.yml allows the deployment to finish successfully.

Additional information

The ansible logs visible through the k8s logs are a mess. The task that seems to fail is roles/installer/tasks/resources_configuration.yml:3

- name: Get the current resource pod information.
  k8s_info:
    api_version: v1
    kind: Pod
    namespace: '{{ ansible_operator_meta.namespace }}'
    label_selectors:
      - "app.kubernetes.io/name={{ ansible_operator_meta.name }}"
      - "app.kubernetes.io/managed-by={{ deployment_type }}-operator"
      - "app.kubernetes.io/component={{ deployment_type }}"
    field_selectors:
      - status.phase=Running
  register: tower_pods

Operator Logs

We would love to provide logs that are legible. Would you be able to suggest ways to get more verbosity and better formatting out of the logs?

贡献者指南