Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "containers/ironic-nautobot-client/**"
- "containers/ironic-vnc-container/**"
- "containers/shell-operator-ironic/**"
- "containers/openstack-sync-operator/**"
- "containers/understack-tests/**"
- "python/**"
- ".github/workflows/containers.yaml"
Expand Down Expand Up @@ -45,6 +46,8 @@ jobs:
prebuild_script_working_dir: containers/ironic-vnc-container/
- name: shell-operator-ironic
target: prod
- name: openstack-sync-operator
target: prod
- name: nautobot
target: prod
uses: ./.github/workflows/build-container-reuse.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- if eq (include "understack.isEnabled" (list $.Values.site "openstack_sync_operator")) "true" }}
{{- $app := $.Values.site.openstack_sync_operator }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ printf "%s-%s" $.Release.Name "openstack-sync-operator" }}
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
{{- with $app.wave }}
argocd.argoproj.io/sync-wave: {{ quote . }}
{{- end }}
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
spec:
destination:
namespace: {{ $.Values.site.openstack.namespace }}
server: {{ $.Values.cluster_server }}
project: understack
sources:
- path: components/openstack-sync-operator
ref: understack
repoURL: {{ include "understack.understack_url" $ }}
targetRevision: {{ include "understack.understack_ref" $ }}
helm:
ignoreMissingValueFiles: false
releaseName: openstack-sync-operator
valueFiles:
- $understack/components/openstack-sync-operator/values.yaml
- $deploy/{{ include "understack.deploy_path" $ }}/openstack-sync-operator/values.yaml
- ref: deploy
repoURL: {{ include "understack.deploy_url" $ }}
targetRevision: {{ include "understack.deploy_ref" $ }}
syncPolicy:
automated:
prune: true
selfHeal: true
managedNamespaceMetadata:
annotations:
argocd.argoproj.io/sync-options: Delete=false
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if eq (include "understack.isEnabled" (list $.Values.site "openstack_sync_plugins")) "true" }}
{{- $app := $.Values.site.openstack_sync_plugins }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ printf "%s-%s" $.Release.Name "openstack-sync-plugins" }}
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
{{- with $app.wave }}
argocd.argoproj.io/sync-wave: {{ quote . }}
{{- end }}
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
spec:
destination:
namespace: {{ $.Values.site.openstack.namespace }}
server: {{ $.Values.cluster_server }}
project: understack
sources:
- path: components/openstack-sync-plugins
ref: understack
repoURL: {{ include "understack.understack_url" $ }}
targetRevision: {{ include "understack.understack_ref" $ }}
- path: {{ include "understack.deploy_path" $ }}/openstack-sync-plugins
ref: deploy
repoURL: {{ include "understack.deploy_url" $ }}
targetRevision: {{ include "understack.deploy_ref" $ }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true
{{- end }}
18 changes: 18 additions & 0 deletions charts/argocd-understack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,24 @@ site:
# @default -- false
enabled: false

# -- OpenStack sync shell-operator
openstack_sync_operator:
# -- Enable/disable deploying OpenStack sync shell-operator
# @default -- false
enabled: false
# -- Sync wave for deployment ordering
# @default -- 4
wave: 4

# -- OpenStack sync custom resources
openstack_sync_plugins:
# -- Enable/disable deploying OpenStack sync custom resources
# @default -- false
enabled: false
# -- Sync wave for deployment ordering
# @default -- 5
wave: 5

# -- RabbitMQ Cluster Operator (site deployment)
rabbitmq_system:
# -- Enable/disable deploying RabbitMQ operator
Expand Down
6 changes: 6 additions & 0 deletions components/openstack-sync-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: openstack-sync-operator
description: OpenStack configuration sync shell-operator hooks
type: application
version: 0.2.0
appVersion: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: neutronrouterflavors.neutron.understack.rackspace.net
spec:
group: neutron.understack.rackspace.net
names:
kind: NeutronRouterFlavor
listKind: NeutronRouterFlavorList
plural: neutronrouterflavors
shortNames:
- nrf
singular: neutronrouterflavor
scope: Namespaced
versions:
- name: v1alpha1
served: true
storage: true
additionalPrinterColumns:
- name: Flavor
type: string
jsonPath: .spec.name
- name: ServiceType
type: string
jsonPath: .spec.service_type
- name: Driver
type: string
jsonPath: .spec.driver
- name: SyncStatus
type: string
jsonPath: .status.syncStatus
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
description: NeutronRouterFlavor defines one Neutron router flavor and its service profile.
type: object
required:
- spec
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
required:
- name
- driver
properties:
name:
description: Neutron router flavor name.
type: string
minLength: 1
maxLength: 255
pattern: ^[A-Za-z0-9._-]+$
service_type:
description: Neutron service type for the flavor.
type: string
enum:
- L3_ROUTER_NAT
minLength: 1
maxLength: 255
default: L3_ROUTER_NAT
service_provider:
description: Optional Neutron service provider name used when generating Neutron configuration.
type: string
minLength: 1
maxLength: 255
pattern: ^[A-Za-z0-9._-]+$
description:
description: Description stored on the Neutron router flavor.
type: string
maxLength: 1024
driver:
description: Service profile driver class.
type: string
minLength: 1
maxLength: 1024
pattern: ^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)+$
profile_description:
description: Description stored on the Neutron service profile.
type: string
maxLength: 1024
profile_id:
description: Existing Neutron service profile ID to attach instead of creating or discovering one.
type: string
format: uuid
meta_info:
description: Service profile metainfo payload.
type: object
properties:
resource_class:
description: Resource class consumed by a physical router provider.
type: string
minLength: 1
maxLength: 255
pattern: ^[A-Za-z0-9._:-]+$
vni_alloc:
description: VNI allocation mode for VRF router providers.
type: string
enum:
- "off"
- "on"
- auto
status:
description: NeutronRouterFlavorStatus defines the observed sync state.
type: object
properties:
syncStatus:
description: SyncStatus indicates the synchronization state with Neutron.
type: string
enum:
- Synced
- Failed
- Unknown
lastSyncTime:
description: LastSyncTime is the last time the operator attempted to sync the flavor.
type: string
format: date-time
observedGeneration:
description: ObservedGeneration is the metadata generation last processed by the operator.
type: integer
format: int64
message:
description: Message provides details about the last sync attempt.
type: string
maxLength: 2048
conditions:
description: Conditions describe current observed state.
type: array
items:
type: object
required:
- type
- status
properties:
type:
type: string
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
message:
type: string
maxLength: 2048
lastTransitionTime:
type: string
format: date-time
subresources:
status: {}
38 changes: 38 additions & 0 deletions components/openstack-sync-operator/templates/_crd.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{/*
Read hook CRD metadata used by RBAC and shell-operator environment wiring.
*/}}
{{- define "openstack-sync-operator.hookCrd" -}}
{{- $root := index . 0 -}}
{{- $hookName := index . 1 -}}
{{- $hook := index . 2 -}}
{{- $crdPath := required (printf "hooks.%s.crd is required when hook is enabled" $hookName) $hook.crd -}}
{{- $crdYaml := required (printf "hooks.%s.crd file %s is empty or missing" $hookName $crdPath) ($root.Files.Get $crdPath) -}}
{{- $crd := fromYaml $crdYaml -}}
{{- if ne $crd.kind "CustomResourceDefinition" -}}
{{- fail (printf "hooks.%s.crd must point to a CustomResourceDefinition" $hookName) -}}
{{- end -}}
{{- $group := required (printf "hooks.%s.crd spec.group is required" $hookName) $crd.spec.group -}}
{{- $kind := required (printf "hooks.%s.crd spec.names.kind is required" $hookName) $crd.spec.names.kind -}}
{{- $plural := required (printf "hooks.%s.crd spec.names.plural is required" $hookName) $crd.spec.names.plural -}}
{{- $storageVersion := "" -}}
{{- $hasStatus := false -}}
{{- range $version := required (printf "hooks.%s.crd spec.versions is required" $hookName) $crd.spec.versions }}
{{- if $version.storage -}}
{{- $storageVersion = $version.name -}}
{{- end -}}
{{- if hasKey (default dict $version.subresources) "status" -}}
{{- $hasStatus = true -}}
{{- end -}}
{{- end -}}
{{- if not $storageVersion -}}
{{- fail (printf "hooks.%s.crd must define a storage version" $hookName) -}}
{{- end -}}
{{- dict
"apiVersion" (printf "%s/%s" $group $storageVersion)
"group" $group
"hasStatus" $hasStatus
"kind" $kind
"plural" $plural
"resource" (printf "%s.%s" $plural $group)
| toYaml -}}
{{- end }}
Loading
Loading