Commit Graph

298 Commits

Author SHA1 Message Date
Tadas Sutkaitis 1e5ca80385
helm-toolkit: Enable custom secret annotations
Enable custom annotations for secrets [registry, tls]

Change-Id: I811d5553f51ad2b26ea9d73db945c043ee2e7a10
2024-04-09 02:08:18 +03:00
Doug Goldstein 929ebf5200
add custom job annotations snippet and use it
Add the ability for charts that use helm-toolkit to allow the users to
set custom annotations on jobs. Use the snippet in a generic way in the
job templates provided by helm-toolkit.

Change-Id: I5d60fe849e172c19d865b614c3c44ea618f92f20
Depends-On: I3991d6984563813d5a3a776eabd52e2e89933bd8
Signed-off-by: Doug Goldstein <doug.goldstein@rackspace.com>
2024-04-05 18:52:53 -05:00
Tadas Sutkaitis b968a788ca
Add custom secret annotations helm-toolkit snippet
Change-Id: Ic61afcb78495b35ee42232b435f54344f0a0a057
2024-03-26 01:05:18 +02:00
Vladimir Kozhukalov 68ae97277e Add custom pod annotations helm-toolkit snippet
Change-Id: I898afae7945c03aec909e5edcd1c760c4d8ff9d6
2024-03-21 18:46:32 -05:00
Ritchie, Frank (fr801x) 5b72041fd9 Change default ingress path type to prefix
Due to CVE-2022-4886 the default pathType for an ingress should be
either "Exact" or "Prefix". This allows for more strict path validation by
the admission controller. This PS changes the default pathType to Prefix.
This value can be overridden.

In a separate PS I will add the pathType parameter to the ingressOpts
for all helm charts that create an ingress.

See:

https://github.com/kubernetes/ingress-nginx/issues/10570

Change-Id: I8f1df594f0c86f2de6cdd7cf2ee56637bd508565
2024-01-17 13:18:25 -05:00
Sergiy Markin 13c1d8cd38 [backups] Add throttlling of remote backups
This PS adds a possibility to limit (to throttle) the number of
simultaneously uploaded backups while keeping the logic on the client
side using flag files on remote side. The main idea is to have an
ability to limit number of simultaneous remote backups upload sessions.

Change-Id: I5464004d4febfbe20df9cd41ca62ceb9fd6f0c0d
2023-12-18 20:39:45 +00:00
Sergiy Markin f66c924b2f [backups] Mariadb backups improvements
This PS removes mariadb-verify-server sidecar container from
mariadb-backup cronjob in order to make backup process more resilient.

Change-Id: I2517c2de435ead34397ca0483610f511c8035bdf
2023-12-15 16:18:35 +00:00
Sergiy Markin 4a95f75b6b [backups] Added staggered backups
This PS adds staggered backups possibility by adding anti-affinity rules
to backups cronjobs that can be followed across several namespaces to
decrease load on remote backup destination server making sure that at
every moment in time there is only one backup upload is in progress.

Change-Id: If49791f866a73a08fb98fa0e0b4854042d079c66
2023-12-05 04:10:22 +00:00
Vladimir Kozhukalov 7f783dba51 Update elasticsearch chart to work with Rook Ceph
When using Rook for managing Ceph we can use
Rook CRDs to create S3 buckets and users.

This PR adds bucket claim template to the
elasticsearch chart. Rook creates a bucket for
a bucket claim and also creates a secret
containing the credentials to get access to this
bucket. So we also add a snippet to expose
these credentials via environment variables to
containers where they are needed.

Change-Id: Ic5cd35a5c64a914af97d2b3cfec21dbe399c0f14
2023-11-26 19:34:42 -06:00
Anselme, Schubert 51c70e48df
Deprecating the Ingress Class Annotation
This PS replaces deprecated kubernetes.io/ingress.class annotation  with
spec.ingressClassName field that is a reference to an IngressClass
resource that contains additional Ingress configuration, including the
name of the Ingress controller.

https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#deprecating-the-ingress-class-annotation

Change-Id: I9953d966b4f9f7b1692b39f36f434f5055317025
Co-authored-by: Sergiy Markin <smarkin@mirantis.com>
Co-authored-by: Leointii Istomin <listomin@mirantis.com>
Signed-off-by: Anselme, Schubert (sa246v) <sa246v@att.com>
2023-08-26 00:39:34 +00:00
root 1ab2bcfd3a Fix dependency resolver
There is a condition check for dependencyKey when dependencyMixinParam
is a string value, but not when a slice value.
It requires to add an empty section in dependencies.dynamic.targeted
even if there is no dynamic dependency requirements.
This patch adds a condition check to avoid the dummy values.

Change-Id: I1db9156741959acb074d86a3ae900e8be31170f7
2023-07-29 02:28:24 +10:00
Jose Bautista 1775e1bea6 Update create db user queries
Using GRANT to create users was deprecated in 5.7. The current
query to create user fails with new versions of mysql.

Change-Id: If991778763dc0961508e8466244955fd71b47591
2023-03-31 01:47:47 +11:00
Sergiy Markin a7cd689280 [backups] Database backups
This PS resolves several issues in database backup script in HTK chart:

- decreases random delay before uploading remote backup to up to 30s
- removes additional random delay before remote backup verification
- switches remote backup verification protocol from sha256 to md5

The main goal for the changes above is decreasing network load on remote
backup storages by eliminating the need of remote file download right
after uploading in order to be able to calculate sha256 checksum.

Change-Id: Ic01a37d8814283a2e9a11dac94d6909d34edc937
2023-03-01 19:48:22 +00:00
Markin, Sergiy fa8916f5bc [helm-toolkit] Added a random delay to remote backup operations
This PS adds a random delay up to 300 seconds to remote backup upload
and download actions to spread the network load in time. Backup process
failure may happen if many sites are pushing their backups at the same
time. It was OK previously but now with added remote bakup sha256
checksum verification we need to download the backup we just uploaded.
So the network load already doubled. And this PS mitigates the impact
of that.

Change-Id: Ibc2a8f8287e20aeb56ad1f9c604b47db2d0eb06c
2023-01-23 16:52:07 -06:00
Cedric Hnyda 6c903f6092 [helm-toolkit]: Allow tls for external ingress without specifying key and crt
It will allow using letsencrypt for a specific endpoint.
For example:

  network:
    use_external_ingress_controller: true
    api:
      ingress:
        classes:
          namespace: "nginx"
          cluster: "nginx-cluster"
        annotations:
          nginx.ingress.kubernetes.io/rewrite-target: /
          cert-manager.io/cluster-issuer: "letsencrypt"
  endpoints:
    cluster_domain_suffix: cluster.local
    image:
      port:
        api:
          public: 443
      scheme:
        public: https
      hosts:
        default: glance
        public: glance-public
      host_fqdn_override:
        public:
          host: glance.example.com
          tls:
            dnsNames:
              - glance.example.com
          issuerRef:
            name: letsencrypt
            kind: ClusterIssuer

Signed-off-by: Cedric Hnyda <ced.hnyda@gmail.com>
Change-Id: I5065213bbc25464bef596003c9967258489db455
2023-01-03 10:58:25 +01:00
ju217q a480a58da5 [RabbitMQ] Remove guest admin account
Moved removal of guest user account to init for security
and best practices.

Change-Id: I333f2a0e3124646cf7432e742978a0f3d2277a51
2022-10-10 20:09:56 +00:00
Markin, Sergiy (sm515x) 5c4056ad34 [DATABASE] Add verify databases backup
HTK - added verify_databases_backup_in_directory function that is
going to be defined inside mariadb/postgresql/etcd charts.

Mariadb chart - added verify_databases_backup_archives function
implementation.

Added mariadb-verify container to mariadb-backup cronjob to run
verification process.

Added remove backup verification pocess - comparition of local and remote file md5 hashes.

PostgreSQL chart - added empty implementation of verify_databases_backup_archives() function. This is a subject for future realization.

Change-Id: I361cdb92c66b0b27539997d697adfd1e93c9a29d
2022-09-09 01:41:00 +00:00
Terekhin, Alexey (at4945) 54055938e6 Adjusting of getting kibana ingress value parameters.
This change fixed getting network kibana ingress parameters.

Change-Id: I0d6609e6785566a4b6f341be0113ea80b184f7ae
2022-08-29 15:28:26 -07:00
Terekhin, Alexey (at4945) a10c1b0c6c Fix for getting kibana ingress parameters.
This change fixed getting network kibana ingress parameters
from override value files.

Change-Id: If9931267edad2c1196e395168c562ef0d0d380d6
2022-08-15 13:36:37 -07:00
Yanos Angelopoulos a4a2b5803b Modify use_external_ingress_controller place in openstack-helm
Having the "use_external_ingress_controller" field in
"network.server.ingress" yaml path is not a good choice as there are
services such neutron that use this path to define backend service,
named "server", options. We propose moving it to the root of the
path "network".

Change-Id: If98d6555a9c012872d3fb1a38b370a3195ea49ab
2022-07-29 16:43:19 +03:00
Brian Haley f31cfb2ef9 support image registries with authentication
Based on spec in openstack-helm repo,
support-OCI-image-registry-with-authentication-turned-on.rst

Each Helm chart can configure an OCI image registry and
credentials to use. A Kubernetes secret is then created with these
info. Service Accounts then specify an imagePullSecret specifying
the Secret with creds for the registry. Then any pod using one
of these ServiceAccounts may pull images from an authenticated
container registry.

Change-Id: Iebda4c7a861aa13db921328776b20c14ba346269
2022-07-20 14:28:47 -05:00
Yanos Angelopoulos 772198f15d Support having a single external ingress controller
This change allows creating a single ingress resource using the
public fqdn of the service, instead of two (cluster and namespace)
that is currently the case. Every openstack-helm chart can have a
network.server.ingress.use_external_ingress_controller boolean
field to choose the creation of a single ingress resource
(ingressName-namespace-fqdn).

Signed-off-by: Yanos Angelopoulos <yanos@admin.grnet.gr>
Change-Id: I46da850fccc3fee76595a2e6c49d51197a282c3e
2022-07-05 22:32:50 +00:00
Vladimir Sigunov (vs422h) 89d290d3da [Database] Remote backup should keep given number of backup days
Fixes minor issue with naming of variables which prevents the script to
be compliant the backup retention policy.

Change-Id: Ic241310a66af92ee423f5c762c413af7d6d53f0b
2022-05-03 13:51:41 -04:00
Sigunov, Vladimir (vs422h) a50d3da394 [DATABASE] Fixes archive name parsing issues
Added a parser for archive names to cover the situation when an archive
name could be represented in two different formats
1) <database name>.<namespace>.<table name | all>.<date-time>.tar.gz
2) <database name>.<namespace>.<table name | all>.<backup mode>.<date-time>.tar.gz

The first format is what is using at the moment,
the second format is recommended for future use.

Change-Id: I6b631b3b938c0a0242c5a8870284995b2cd8f27b
2022-03-30 15:57:16 -04:00
Graham Steffaniak b5c285ae98 Revert chart naming to .Release.Name expression
CHG required for existing deployments to be
	 upgraded in place.

Change-Id: Ife4278f17601358dcd853c29977f5e2e88e521dc
2022-03-28 19:35:14 +00:00
Graham Steffaniak a4f39d7753 Remove helmv2 tillerVersion from helm-toolkit
Needed since the chart fails to lint with tillerVersion included.

Change-Id: If5ce0ffa3d5abbef0d91e0e667d1b30c866fa020
2022-03-25 15:00:57 -05:00
Tran, Huy (ht095u) a22b71446e [DATABASE] Minor change to list local archive files
Minor change to list archive directory with files in sub-directory
as below. Without the change, only the directory name 'quarantine'
is displayed.

All Local Archives
==============================================
mariadb.openstack.all.2022-03-20T18:00:17Z.tar.gz
mariadb.openstack.all.2022-03-21T00:00:16Z.tar.gz
mariadb.openstack.all.2022-03-21T06:00:12Z.tar.gz
mariadb.openstack.all.2022-03-21T12:00:13Z.tar.gz
mariadb.openstack.all.2022-03-21T18:00:11Z.tar.gz
quarantine/mariadb.openstack.all.2022-03-23T00:00:12Z.tar.gz
quarantine/mariadb.openstack.all.2022-03-23T06:00:11Z.tar.gz
quarantine/mariadb.openstack.all.2022-03-23T12:00:14Z.tar.gz
quarantine/mariadb.openstack.all.2022-03-23T14:24:04Z.tar.gz

Change-Id: Ic47a30884b82cdecedbfff8ddf1d85fc00d89acc
2022-03-24 12:58:00 -05:00
Graham Steffaniak 8e3c97714b Updated chart naming for subchart compatibility
CHG: - reno-check script to ignore subchart
     - .Release.Name to match .Chart.Name instead:
       - mariadb
       - rabbitmq
       - memcached

Change-Id: Ieaecd5537c2843357b2787f6f59405b672ce8b8a
2022-03-23 17:24:05 -05:00
Thiago Brito 0d5b16cabb Enable taint toleration for helm-toolkit
This adds taint toleration support for openstack jobs

Signed-off-by: Lucas Cavalcante <lucasmedeiros.cavalcante@windriver.com>
Change-Id: I168837f962465d1c89acc511b7bf4064ac4b546c
2022-03-23 10:30:59 -03:00
Sigunov, Vladimir (vs422h) f845081bb5 [DATABASE] Code improvement
This is to cover some relatively rare sutuation, when backups
of different databases can share the same storage.

Change-Id: I0770e1baf3d33e2d56c34558a9a97a99a01e5e04
2022-03-22 14:43:27 -04:00
Sigunov, Vladimir (vs422h) 1da245f608 [DATABASE] Maintain minimum given number of backups
Modifies the backup script in the way that there will always be
a minimum given number of days of backups in both local, and remote
(if applicable) locations, regardless the date that the backups
are taken.

Change-Id: I19d5e592905ce83acdba043f68ca4d0b042de065
2022-02-28 14:46:04 -05:00
Lo, Chi (cl566n) 2fc1ce4a14 Removing -x from database backup script
The set -x has produced 6 identical log strings every time the
log_backup_error_exit function is called.  Prometheus is using
the occurrence and number of some logs over a period of time to
evaluate database backup failure or not.  Only one log should be
generated when a particular database backup scenario failed.

Upon discussion with database backup and restore SME, it is
recommended to remove the set -x once and for all.

Change-Id: I846b5c16908f04ac40ee8f4d87d3b7df86036512
2022-02-23 16:42:29 -08:00
Sigunov, Vladimir (vs422h) 728c340dc0 [CEPH] Discovering ceph-mon endpoints
This is a code improvement to reuse ceph monitor doscovering function
in different templates. Calling the mentioned above function from
a single place (helm-infra snippets) allows less code maintenance
and simlifies further development.

Rev. 0.1 Charts version bump for ceph-client, ceph-mon, ceph-osd,
ceph-provisioners and helm-toolkit
Rev. 0.2 Mon endpoint discovery functionality added for
the rados gateway. ClusterRole and ClusterRoleBinding added.
Rev. 0.3 checkdns is allowed to correct ceph.conf for RGW deployment.
Rev. 0.4 Added RoleBinding to the deployment-rgw.
Rev. 0.5 Remove _namespace-client-ceph-config-manager.sh.tpl and
         the appropriate job, because of duplicated functionality.
         Related configuration has been removed.
Rev. 0.6 RoleBinding logic has been changed to meet rules:
    checkdns namespace - HAS ACCESS -> RGW namespace(s)

Change-Id: Ie0af212bdcbbc3aa53335689deed9b226e5d4d89
2022-02-11 14:30:43 -07:00
Sophie Huang 11ac37056b [helm-toolkit] add log strings for alert generation
Log string prefixes are added to different error logs
for the generation of alert.

Change-Id: I483cf08e09b2b56a68414f4cc3ade4c3e3cdd9aa
2022-01-08 00:00:16 +00:00
Marlin Cremers 9d7baa9aa8 feat(helm-toolkit): add support for image pull secrets
At the moment it is very difficult to pull images from a private
registry that hasn't been configured on Kubernetes nodes as there
is no way to specify imagePullSecrets on pods.

This change introduces a snippet that can return a set of image
pull secrets using either a default or a per pod value. It also
adds this new snippet to the manifests for standard job types.

Change-Id: I710e1feffdf837627b80bc14320751f743e048cb
2021-12-21 09:03:08 +01:00
Gupta, Sangeet (sg774j) 47795919cb Mariadb: Enhance mariadb backup
* Add capability to retry uploading backup to remote server configured
  number of times and delay the retires randomly between configured
  minimum/maximum seconds.
* Enhanced error checking, logging and retrying logic.

Change-Id: Ida3649420bdd6d39ac6ba7412c8c7078a75e0a10
2021-11-20 02:06:28 +00:00
PRIYA, FNU (fp048v) fddbb0a059 Set Security Context to ks-user job
We need flexibility to add securityContext to ks-user job at pod and containerlevel,
so that it can be executed without elevated privileges.

Change-Id: Ibd8abdc10906ca4648bfcaa91d0f122e56690606
2021-11-08 09:45:11 -06:00
Gupta, Sangeet (sg774j) 186155c296 Correct private key size input for Certificates and remove minor version support
In cert-manager v1 API, the private key size "keySize" was updated to "size"
under "privateKey".
Support of minor (less than v1) API version is also removed for certificates.

Change-Id: If3fa0e296b8a1c2ab473e67b24d4465fe42a5268
2021-11-03 14:27:23 +00:00
Gage Hugo 55e7706f7e Revert "Set Security Context to ks-user job"
This reverts commit 5407b547bb.

Reason for revert: This outputs duplicate securityContext entries,
breaking the yamllinter in osh. This needs a slight rework.

Change-Id: I0c892be5aba7ccd6e3c378e4e45a79d2df03c06a
2021-11-01 22:35:00 +00:00
PRIYA, FNU (fp048v) 5407b547bb Set Security Context to ks-user job
We need flexibility to add securityContext to ks-user job , so that it can be executed without elevated privileges.

Change-Id: I24544015816d57d86c1e69f44b90b6b0271e76a4
2021-11-01 01:59:25 +00:00
Phil Sphicas f4972121bc Migrate Ingress resources to networking.k8s.io/v1
This change updates the helm-toolkit and ingress charts to migrate
Ingress resources to the networking.k8s.io/v1 API version, available
since v1.19. [0]

0: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

Change-Id: Ic6bd6d158b1294da26c165797c90107831dcb508
2021-10-15 04:47:00 +00:00
Sean Eagan b1a247e7f5 Helm 3 - Fix Job labels
If labels are not specified on a Job, kubernetes defaults them
to include the labels of their underlying Pod template. Helm 3
injects metadata into all resources [0] including a
`app.kubernetes.io/managed-by: Helm` label. Thus when kubernetes
sees a Job's labels they are no longer empty and thus do not get
defaulted to the underlying Pod template's labels. This is a
problem since Job labels are depended on by
- Armada pre-upgrade delete hooks
- Armada wait logic configurations
- kubernetes-entrypoint dependencies

Thus for each Job template this adds labels matching the
underlying Pod template to retain the same labels that were
present with Helm 2.

[0]: https://github.com/helm/helm/pull/7649

Change-Id: I3b6b25fcc6a1af4d56f3e2b335615074e2f04b6d
2021-09-30 16:01:31 -05:00
Marlin Cremers 4340e272d7 feat(helm-toolkit): allow setting extra labels on pods
Currently it isn't possible to set extra labels on pods that use
the labels snippet. This means users are required to fork the helm
repository for OpenStack services to add custom labels. Use cases
for this are for example injecting Istio sidecars.

This change introduces the ability to set one set of labels on all
resources that use the labels snippet.

Change-Id: Iefc8465300f434b89c07b18ba75260fee0a05ef5
2021-09-27 18:44:47 +02:00
Neely, Travis (tn720x) 4a490b894c Fix issue with db backup error return code being eaten
The return code from the send_to_remote_server function are
being eaten by an if statement and thus we never hit the elif
section of code.

Change-Id: Id3e256c991421ad6624713f65212abb4881240c1
2021-09-26 16:22:39 -05:00
zhen 6bc1f5a8b6 Modify the rbac_role to make secrets accessible
In the process of secondary development, we found
that we often need to access secrets from pod.
However, it seems that helm-tookit does not support
adding resource of secrets to role. This commit
try to fix that.

Change-Id: If384d6ccb7672a8da5a5e1403733fa655dfe40dd
2021-09-07 02:23:11 +00:00
Maximilian Weiss bc754e088e Revoke all privileges for PUBLIC role in postgres dbs
Change-Id: I98102bd9c72264c7e364b50e0683e4777b42b0e7
2021-07-30 17:16:58 +00:00
Haider, Nafiz (nh532m) adab36be22 Helm-Toolkit: Make Rabbit-init job more robust
Change-Id: I36ef7b2cdcf747ed2503ca5d27bc7803349f287d
2021-07-27 20:19:56 +00:00
Neely, Travis (tn720x) 6169504761 Update db backup/restore retry for sending to remote
There is an additional error status 'Service Unavailable' which can
indicate the service is temporary unavailable. Adding that error
status to the retry list in case the issue is resolved during the
backup timeframe.

Change-Id: I9e2fc1a9b33dea3858de06b10d512da98a635015
2021-07-20 10:47:38 -05:00
Gayathri Devi Kathiri 6d4dcc2474 Add manual mode to the created backup file name
This PS helps us understand the mode of backup taken
from the created backup file name.

Supporting PS: https://review.opendev.org/c/airship/porthole/+/793591

Change-Id: I96c8b856fc309381f8d956eaae248bfc3443d900
2021-06-11 14:10:41 +00:00
Haider, Nafiz (nh532m) 2dc83fdde7 feat(tls): Enable TLS for OpenStack RabbitMQ
Enable TLS for Openstack RabbitMQ upstream

Co-authored-by: Sangeet Gupta <sg774j@att.com>

Change-Id: I7c08d41b212bc5095facf5f5823521fbfa4d3c47
2021-05-21 12:36:23 +00:00