Skip to content

Commit

Permalink
Merge pull request #258 from gthiemonge/amphora-upload
Browse files Browse the repository at this point in the history
Add a deployment that uploads/updates the amphora image
  • Loading branch information
beagles authored Mar 18, 2024
2 parents d81f1e5 + fcbc618 commit ba81127
Show file tree
Hide file tree
Showing 16 changed files with 3,002 additions and 2 deletions.
67 changes: 67 additions & 0 deletions api/bases/octavia.openstack.org_octavias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ spec:
- name
type: object
type: array
amphoraImageContainerImage:
description: Octavia Container Image URL
type: string
apacheContainerImage:
description: Apache Container Image URL
type: string
customServiceConfig:
default: '# add your customization here'
description: CustomServiceConfig - customize the service config using
Expand Down Expand Up @@ -1078,10 +1084,63 @@ spec:
description: RabbitMQ instance name Needed to request a transportURL
that is created and used in Octavia
type: string
resources:
description: Resources - Compute Resources required by this service
(Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
secret:
description: Secret containing OpenStack password information for
octavia's keystone password; no longer used for database password
type: string
serviceAccount:
description: ServiceAccount - service account name used internally
to provide Octavia services the default SA name
type: string
serviceUser:
default: octavia
description: ServiceUser - service user name
Expand All @@ -1097,11 +1156,19 @@ spec:
description: LoadBalancerSSHPubKey - The name of the ConfigMap containing
the pubilc key for connecting to the amphorae via SSH
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources
type: string
required:
- apacheContainerImage
- databaseInstance
- octaviaAPI
- rabbitMqClusterName
- secret
- serviceAccount
- tenantName
type: object
status:
description: OctaviaStatus defines the observed state of Octavia
Expand Down
29 changes: 29 additions & 0 deletions api/v1beta1/octavia_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1beta1
import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -36,6 +37,10 @@ const (

// OctaviaWorkerContainerImage is the fall-back container image for OctaviaWorker
OctaviaWorkerContainerImage = "quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified"

// ApacheImage - default fall-back image for Apache
// TODO(gthiemonge) need a more recent image?
ApacheContainerImage = "registry.redhat.io/rhel8/httpd-24:latest"
)

// OctaviaSpec defines the desired state of Octavia
Expand Down Expand Up @@ -170,6 +175,28 @@ type OctaviaSpecBase struct {
// +kubebuilder:default={}
// AmphoraCustomFlavors - User-defined flavors for Octavia
AmphoraCustomFlavors []OctaviaAmphoraFlavor `json:"amphoraCustomFlavors,omitempty"`

// +kubebuilder:validation:Required
// ServiceAccount - service account name used internally to provide Octavia services the default SA name
ServiceAccount string `json:"serviceAccount"`

// +kubebuilder:validation:Optional
// Resources - Compute Resources required by this service (Limits/Requests).
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
Resources corev1.ResourceRequirements `json:"resources,omitempty"`

// +kubebuilder:validation:Optional
// Octavia Container Image URL
AmphoraImageContainerImage string `json:"amphoraImageContainerImage"`

// +kubebuilder:validation:Required
// Apache Container Image URL
ApacheContainerImage string `json:"apacheContainerImage"`

// +kubebuilder:validation:Required
// +kubebuilder:default=service
// TenantName - the name of the OpenStack tenant that controls the Octavia resources
TenantName string `json:"tenantName"`
}

// PasswordSelector to identify the DB and AdminUser password from the Secret
Expand Down Expand Up @@ -292,6 +319,8 @@ func SetupDefaults() {
HousekeepingContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT", OctaviaHousekeepingContainerImage),
HealthManagerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_HEALTHMANAGER_IMAGE_URL_DEFAULT", OctaviaHealthManagerContainerImage),
WorkerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT", OctaviaWorkerContainerImage),
ApacheContainerImageURL: util.GetEnvVar("RELATED_IMAGE_OCTAVIA_APACHE_IMAGE_URL_DEFAULT", ApacheContainerImage),
// No default for AmphoraImageContainerImageURL
}

SetupOctaviaDefaults(octaviaDefaults)
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/octavia_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type OctaviaDefaults struct {
HousekeepingContainerImageURL string
HealthManagerContainerImageURL string
WorkerContainerImageURL string
ApacheContainerImageURL string
}

var octaviaDefaults OctaviaDefaults
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/octaviaapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const (

// DeploymentHash hash used to detect changes
DeploymentHash = "deployment"

// ImageUploadHash hash
ImageUploadHash = "image-upload"
)

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions config/crd/bases/octavia.openstack.org_octavias.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ spec:
- name
type: object
type: array
amphoraImageContainerImage:
description: Octavia Container Image URL
type: string
apacheContainerImage:
description: Apache Container Image URL
type: string
customServiceConfig:
default: '# add your customization here'
description: CustomServiceConfig - customize the service config using
Expand Down Expand Up @@ -1078,10 +1084,63 @@ spec:
description: RabbitMQ instance name Needed to request a transportURL
that is created and used in Octavia
type: string
resources:
description: Resources - Compute Resources required by this service
(Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
secret:
description: Secret containing OpenStack password information for
octavia's keystone password; no longer used for database password
type: string
serviceAccount:
description: ServiceAccount - service account name used internally
to provide Octavia services the default SA name
type: string
serviceUser:
default: octavia
description: ServiceUser - service user name
Expand All @@ -1097,11 +1156,19 @@ spec:
description: LoadBalancerSSHPubKey - The name of the ConfigMap containing
the pubilc key for connecting to the amphorae via SSH
type: string
tenantName:
default: service
description: TenantName - the name of the OpenStack tenant that controls
the Octavia resources
type: string
required:
- apacheContainerImage
- databaseInstance
- octaviaAPI
- rabbitMqClusterName
- secret
- serviceAccount
- tenantName
type: object
status:
description: OctaviaStatus defines the observed state of Octavia
Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ spec:
value: quay.io/podified-antelope-centos9/openstack-octavia-health-manager:current-podified
- name: RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified
- name: RELATED_IMAGE_OCTAVIA_APACHE_IMAGE_URL_DEFAULT
value: registry.redhat.io/rhel8/httpd-24:latest
Loading

0 comments on commit ba81127

Please sign in to comment.