Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWXMeshIngress custom resource (require ansible/awx#14640 to function) #1578

Merged
merged 18 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: ansible.com
layout:
- ansible.sdk.operatorframework.io/v1
Expand Down Expand Up @@ -27,4 +31,11 @@ resources:
group: awx
kind: AWXRestore
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: ansible.com
group: awx
kind: AWXMeshIngress
version: v1alpha1
version: "3"
7 changes: 7 additions & 0 deletions awxmeshingress-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: awx.ansible.com/v1beta1
kind: AWXMeshIngress
metadata:
name: awx-demo
spec:
deployment_name: awx-demo
81 changes: 81 additions & 0 deletions config/crd/bases/awx.ansible.com_awxmeshingresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: awxmeshingresses.awx.ansible.com
spec:
group: awx.ansible.com
names:
kind: AWXMeshIngress
listKind: AWXMeshIngressList
plural: awxmeshingresses
singular: awxmeshingress
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: AWXMeshIngress is the Schema for the awxmeshingresses API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of AWXMeshIngress
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- deployment_name
properties:
deployment_name:
description: Name of the AWX deployment to create the Mesh Ingress for.
type: string
external_hostname:
description: External hostname to use for the Mesh Ingress.
type: string
external_ipaddress:
description: External IP address to use for the Mesh Ingress.
type: string
ingress_type:
description: The ingress type to use to reach the deployed instance
type: string
enum:
- none
- Ingress
- ingress
- IngressRouteTCP
- ingressroutetcp
- Route
- route
ingress_api_version:
description: The Ingress API version to use
type: string
ingress_annotations:
description: Annotations to add to the Ingress Controller
type: string
ingress_class_name:
description: The name of ingress class to use instead of the cluster default.
type: string
ingress_controller:
description: Special configuration for specific Ingress Controllers
type: string
status:
description: Status defines the observed state of AWXMeshIngress
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ resources:
- bases/awx.ansible.com_awxs.yaml
- bases/awx.ansible.com_awxbackups.yaml
- bases/awx.ansible.com_awxrestores.yaml
- bases/awx.ansible.com_awxmeshingresses.yaml
#+kubebuilder:scaffold:crdkustomizeresource
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
- --leader-elect
- --leader-election-id=awx-operator
image: controller:latest
imagePullPolicy: Always
name: awx-manager
env:
- name: ANSIBLE_GATHERING
Expand Down
31 changes: 31 additions & 0 deletions config/rbac/awxmeshingress_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# permissions for end users to edit awxmeshingresses.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: awxmeshingress-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: awx-operator
app.kubernetes.io/part-of: awx-operator
app.kubernetes.io/managed-by: kustomize
name: awxmeshingress-editor-role
rules:
- apiGroups:
- awx.ansible.com
resources:
- awxmeshingresses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- awx.ansible.com
resources:
- awxmeshingresses/status
verbs:
- get
27 changes: 27 additions & 0 deletions config/rbac/awxmeshingress_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# permissions for end users to view awxmeshingresses.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: awxmeshingress-viewer-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: awx-operator
app.kubernetes.io/part-of: awx-operator
app.kubernetes.io/managed-by: kustomize
name: awxmeshingress-viewer-role
rules:
- apiGroups:
- awx.ansible.com
resources:
- awxmeshingresses
verbs:
- get
- list
- watch
- apiGroups:
- awx.ansible.com
resources:
- awxmeshingresses/status
verbs:
- get
13 changes: 13 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,16 @@ rules:
- awxrestores
verbs:
- '*'
- apiGroups:
- traefik.containo.us
- traefik.io
resources:
- ingressroutetcps
verbs:
- get
- list
- create
- delete
- patch
- update
- watch
8 changes: 8 additions & 0 deletions config/samples/awx_v1alpha1_awxmeshingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Placeholder to pass CI and allow bundle generation
---
apiVersion: awx.ansible.com/v1alpha1
kind: AWXMeshIngress
metadata:
name: example-awx-mesh-ingress
spec:
deployment_name: example-awx
1 change: 1 addition & 0 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ resources:
- awx_v1beta1_awx.yaml
- awx_v1beta1_awxbackup.yaml
- awx_v1beta1_awxrestore.yaml
- awx_v1alpha1_awxmeshingress.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
19 changes: 19 additions & 0 deletions molecule/default/tasks/awxmeshingress_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TODO: Add tests for AWXMeshIngress
Copy link
Member

@rooftopcellist rooftopcellist Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this out of CI runs for now. @TheRealHaoLiu will address this in a future PR.

This bit will resolve that.

# ---
# - name: Create the awx.ansible.com/v1alpha1.AWXMeshIngress
# k8s:
# state: present
# namespace: '{{ namespace }}'
# definition: "{{ lookup('template', '/'.join([samples_dir, cr_file])) | from_yaml }}"
# wait: yes
# wait_timeout: 300
# wait_condition:
# type: Successful
# status: "True"
# vars:
# cr_file: 'awx_v1alpha1_awxmeshingress.yaml'

# - name: Add assertions here
# assert:
# that: false
# fail_msg: FIXME Add real assertions for your operator
15 changes: 15 additions & 0 deletions roles/mesh_ingress/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
deployment_type: awx

ingress_type: none
ingress_api_version: 'networking.k8s.io/v1'
ingress_annotations: ''
ingress_class_name: ''
ingress_controller: ''

set_self_owneref: true

_control_plane_ee_image: quay.io/ansible/awx-ee:latest
_image_pull_policy: Always

finalizer_run: false
Loading
Loading