Skip to content

Commit

Permalink
Add Pulp.Spec.*.DeploymentAnnotations
Browse files Browse the repository at this point in the history
Allow users to annotate the deployments created by the pulp-operator.

closes #1190
  • Loading branch information
cognifloyd authored and openshift-merge-bot[bot] committed Jan 18, 2024
1 parent e508741 commit 4aec35f
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGES/1190.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow annotating Deployments
25 changes: 25 additions & 0 deletions apis/repo-manager.pulpproject.org/v1beta2/pulp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ type Api struct {

// Environment variables to add to pulpcore-api container
EnvVars []corev1.EnvVar `json:"env_vars,omitempty"`

// Annotations for the api deployment
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
DeploymentAnnotations map[string]string `json:"deployment_annotations,omitempty"`
}

// Content defines desired state of pulpcore-content resources
Expand Down Expand Up @@ -544,6 +549,11 @@ type Content struct {

// Environment variables to add to pulpcore-content container
EnvVars []corev1.EnvVar `json:"env_vars,omitempty"`

// Annotations for the content deployment
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
DeploymentAnnotations map[string]string `json:"deployment_annotations,omitempty"`
}

// Worker defines desired state of pulpcore-worker resources
Expand Down Expand Up @@ -608,6 +618,11 @@ type Worker struct {

// Environment variables to add to pulpcore-worker container
EnvVars []corev1.EnvVar `json:"env_vars,omitempty"`

// Annotations for the worker deployment
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
DeploymentAnnotations map[string]string `json:"deployment_annotations,omitempty"`
}

// Web defines desired state of pulpcore-web (reverse-proxy) resources
Expand Down Expand Up @@ -666,6 +681,11 @@ type Web struct {

// Environment variables to add to pulpcore-web container
EnvVars []corev1.EnvVar `json:"env_vars,omitempty"`

// Annotations for the web deployment
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
DeploymentAnnotations map[string]string `json:"deployment_annotations,omitempty"`
}

// Database defines desired state of postgres
Expand Down Expand Up @@ -849,6 +869,11 @@ type Cache struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:updateStrategy","urn:alm:descriptor:com.tectonic.ui:advanced"}
Strategy appsv1.DeploymentStrategy `json:"strategy,omitempty"`

// Annotations for the cache deployment
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
DeploymentAnnotations map[string]string `json:"deployment_annotations,omitempty"`
}

// Telemetry defines the configuration for OpenTelemetry used by Pulp
Expand Down
35 changes: 35 additions & 0 deletions apis/repo-manager.pulpproject.org/v1beta2/zz_generated.deepcopy.go

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

27 changes: 26 additions & 1 deletion bundle/manifests/pulp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ metadata:
capabilities: Full Lifecycle
categories: Integration & Delivery
containerImage: quay.io/pulp/pulp-operator:devel
createdAt: "2023-12-20T11:42:34Z"
createdAt: "2024-01-18T17:07:51Z"
description: Pulp is a platform for managing repositories of software packages
and making them available to a large number of consumers.
operators.operatorframework.io/builder: operator-sdk-v1.29.0
Expand Down Expand Up @@ -320,6 +320,11 @@ spec:
path: api.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the api deployment
displayName: Deployment Annotations
path: api.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The timeout for the gunicorn process. Default: 90'
displayName: Gunicorn Timeout
path: api.gunicorn_timeout
Expand Down Expand Up @@ -409,6 +414,11 @@ spec:
path: cache.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the cache deployment
displayName: Deployment Annotations
path: cache.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'Defines if cache should be enabled. Default: true'
displayName: Enabled
path: cache.enabled
Expand Down Expand Up @@ -509,6 +519,11 @@ spec:
path: content.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the content deployment
displayName: Deployment Annotations
path: content.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The timeout for the gunicorn process. Default: 90'
displayName: Gunicorn Timeout
path: content.gunicorn_timeout
Expand Down Expand Up @@ -1022,6 +1037,11 @@ spec:
path: web
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Annotations for the web deployment
displayName: Deployment Annotations
path: web.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Periodic probe of container liveness. Container will be restarted
if the probe fails.
displayName: Liveness Probe
Expand Down Expand Up @@ -1083,6 +1103,11 @@ spec:
path: worker.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the worker deployment
displayName: Deployment Annotations
path: worker.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The image name for the container. By default, if not provided,
it will use the same image from .Spec.Image. WARN: defining a different
image than the one used by API pods can cause unexpected behaviors!'
Expand Down
25 changes: 25 additions & 0 deletions bundle/manifests/repo-manager.pulpproject.org_pulps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the api deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-api container
items:
Expand Down Expand Up @@ -3002,6 +3007,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the cache deployment
type: object
enabled:
default: true
description: 'Defines if cache should be enabled. Default: true'
Expand Down Expand Up @@ -4355,6 +4365,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the content deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-content
container
Expand Down Expand Up @@ -7375,6 +7390,11 @@ spec:
description: Web defines desired state of pulpcore-web (reverse-proxy)
resources
properties:
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the web deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-web container
items:
Expand Down Expand Up @@ -8885,6 +8905,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the worker deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-worker container
items:
Expand Down
25 changes: 25 additions & 0 deletions config/crd/bases/repo-manager.pulpproject.org_pulps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the api deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-api container
items:
Expand Down Expand Up @@ -3003,6 +3008,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the cache deployment
type: object
enabled:
default: true
description: 'Defines if cache should be enabled. Default: true'
Expand Down Expand Up @@ -4356,6 +4366,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the content deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-content
container
Expand Down Expand Up @@ -7376,6 +7391,11 @@ spec:
description: Web defines desired state of pulpcore-web (reverse-proxy)
resources
properties:
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the web deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-web container
items:
Expand Down Expand Up @@ -8886,6 +8906,11 @@ spec:
type: array
type: object
type: object
deployment_annotations:
additionalProperties:
type: string
description: Annotations for the worker deployment
type: object
env_vars:
description: Environment variables to add to pulpcore-worker container
items:
Expand Down
25 changes: 25 additions & 0 deletions config/manifests/bases/pulp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ spec:
path: api.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the api deployment
displayName: Deployment Annotations
path: api.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The timeout for the gunicorn process. Default: 90'
displayName: Gunicorn Timeout
path: api.gunicorn_timeout
Expand Down Expand Up @@ -405,6 +410,11 @@ spec:
path: cache.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the cache deployment
displayName: Deployment Annotations
path: cache.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'Defines if cache should be enabled. Default: true'
displayName: Enabled
path: cache.enabled
Expand Down Expand Up @@ -505,6 +515,11 @@ spec:
path: content.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the content deployment
displayName: Deployment Annotations
path: content.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The timeout for the gunicorn process. Default: 90'
displayName: Gunicorn Timeout
path: content.gunicorn_timeout
Expand Down Expand Up @@ -1018,6 +1033,11 @@ spec:
path: web
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Annotations for the web deployment
displayName: Deployment Annotations
path: web.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Periodic probe of container liveness. Container will be restarted
if the probe fails.
displayName: Liveness Probe
Expand Down Expand Up @@ -1079,6 +1099,11 @@ spec:
path: worker.affinity
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Annotations for the worker deployment
displayName: Deployment Annotations
path: worker.deployment_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: 'The image name for the container. By default, if not provided,
it will use the same image from .Spec.Image. WARN: defining a different
image than the one used by API pods can cause unexpected behaviors!'
Expand Down
Loading

0 comments on commit 4aec35f

Please sign in to comment.