276 Commits

Author SHA1 Message Date
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
Lo, Chi (cl566n)
f7fde88b6e Remove env variable from s3 bucket job
Remove the TLS_OPTION env from helm-toolkit s3-bucket job. There
can be different option for tls connection, depending on whether
the rgw server is local or remote. This change allows the
create-s3-bucket script to customize its connection argument
which can be pulled from values.yaml.

Change-Id: I2a34c1698e02cd71905bc6ef66f4aefcd5e25e44
2021-05-14 15:12:15 -07:00
Lo, Chi (cl566n)
fd4bf57211 Enable TLS for Elasticsearch
The change enables:

(1) TLS for the Elasticsearch transport networking layer. The
    transport networking layer is used for internal communication
    between nodes in a cluster.

(2) TLS path between Elasticsearch and Ceph-rgw host.

Change-Id: Ifb6cb5db19bc5db2c8cb914f6a5887cf3d0f9434
2021-05-03 19:39:32 -07:00
Gage Hugo
4ed2a6fe53 Remove hook-delete-policy default settings from HTK
These hooks were added as part of a previous change, however tiller
does not handle these correctly, and jobs get deleted without being
recreated. This change removes the hook from default htk annotations.

Change-Id: I2aa7bb241ebbb7b54c5dc9cf21cd5ba290b7e5fd
2021-04-23 21:39:17 +00:00
Steven Fitzpatrick
d3c6069be3 Elasticsearch: Make templates job more robust
This change primarily changes the type of the api_objects yaml structure
to a map, which allows for additional objects to be added by values
overrides (Arrays/Lists are not mutable like this)

Also, in the previous change, some scripts in HTK were modified, while
other were copied over to the Elasticsearch chart. To simplify the chart's
structure, this change also moves the create_s3_bucket script to Elasticsearch,
and reverts the changes in HTK.

Those HTK scripts are no longer referenced by osh charts, and could be candidates
for removal if that chart needed to be pruned

Change-Id: I7d8d7ef28223948437450dcb64bd03f2975ad54d
2021-04-12 18:40:11 +00:00
Steven Fitzpatrick
6de864110e Elasticsearch S3 Update
This change updates how the Elasticsearch chart handles
S3 configuration and snapshot repository registration.

This allows for
  - Multiple snapshot destinations to be configued
  - Repositories to use a specific placement target
  - Management of multiple account credentials

Change-Id: I12de918adc5964a4ded46f6f6cd3fa94c7235112
2021-04-06 15:12:34 +00:00
Chris Wedgwood
20cf2db961 [htk] Jobs; put labels only in the template spec
This is an update to address a behavior change introduced with
0ae8f4d21a.

Job labels if empty/unspecified are taken from the template.  If (any)
labels are specified on the job we do not get this behavior.

Specifically if we *apply*:

    apiVersion: batch/v1
    kind: Job
    metadata:
      # no "labels:" here
      name: placement-db-init
      namespace: openstack
    spec:
      template:
        metadata:
          labels:
            application: placement
            component: db-init
            release_group: placement
        spec:
          containers:
          # do stuffs

then *query* we see:

    apiVersion: batch/v1
    kind: Job
    metadata:
      # k8s did this for us!
      labels:
        application: placement
        component: db-init
        job-name: placement-db-init
        release_group: placement
      name: placement-db-init
      namespace: openstack
    spec:
      template:
        metadata:
          labels:
            application: placement
            component: db-init
            release_group: placement
        spec:
          containers:
          # do stuffs

The aforementioned change causes objects we apply and query to look
like:

    apiVersion: batch/v1
    kind: Job
    metadata:
      # k8s did this for us!
      labels:
        application: placement
        # nothing else!
      name: placement-db-init
      namespace: openstack
    spec:
      template:
        metadata:
          labels:
            application: placement
            component: db-init
            release_group: placement
        spec:
          containers:
          # do stuffs

Current users rely on this behavior and deployment systems use job
labels for synchronization, those labels being only specified in the
template and propagating to the job.

This change preserves functionality added recently and restores the
previous behavior.

The explicit "application" label is no longer needed as the
helm-toolkit.snippets.kubernetes_metadata_labels macro provides it.

Change-Id: I1582d008217b8848103579b826fae065c538aaf0
2021-04-02 16:54:03 -05:00
Gupta, Sangeet (sg774j)
f4ce1c8681 HTK: Override the expiry of Ingress TLS certificate
v1.2.0 of cert-manager noew supports overriding the default value
of ingress certificate expiry via annotations. This PS add the
required annotation.

Change-Id: Ic81e47f24d4e488eb4fc09688c36a6cea324e9e2
2021-03-25 22:18:57 +00:00
Neely, Travis (tn720x)
2300e76904 Replace brace expansion with more standardized Posix approach
There is also an extra . which causes the expansion to fail.

Change-Id: Id0c02e2f293a72048e33078548a588d5cf1b62ce
2021-03-09 16:01:02 -06:00
okozachenko
0ae8f4d21a Add metadata in job templates
- Add application label using service name
- Add before-hook-creation delete policy as a default
  (It is a default one in helmv3)
- Add custom metadata by passing params

Change-Id: Ie09f8491800031b9ff051a63feb3e018cb283342
2021-03-01 17:31:21 +02:00
Nafiz Haider
6ee06562c8 Re-enable "feat(tls): Change Issuer to ClusterIssuer""
This reverts commit 8a79d7c51b.

Reason for revert: resolved bug with cluster issuer versioning

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

Change-Id: I047cbfaa5aa9e7285a23e603074429180495557d
2021-02-24 20:50:24 +00:00
Neely, Travis (tn720x)
69c525d791 Added detailed FiXME for ks-service script bug and code changes in [0]
On somewhat rare occasions the openstack service list call fails with
a connection aborted OSError 104 ECONNRESET. During an upgrade this failure
causes the script to think that the service it is checking for does not
exist and therefore it recreates the script. In turn this causes further
issues when other services try to use this duplicate service.
This is a temporary change in order to alliviate the issue while the root
cause is investigated.

[0] https://review.opendev.org/c/openstack/openstack-helm-infra/+/772416

Change-Id: Id0971a95eb54eca9486a9811f7ec6f603a007cbb
2021-01-29 13:50:15 -06:00
Neely, Travis (tn720x)
ff3b0aa9e0 Allow openstack service list to retry in event of keystone connection issues
We've seen a few cases where the openstack service list is unable
to establish a connection with keystone thus causing the check to fail.
When this happens, an additional service is created unnecessarily.
When the addtional service is created, it tends to cause issues since
there are no endpoints asscociated with the new service.

Allow this check to retry several times.

Change-Id: I5a1985c680e90de71549177ffc3faf848a831bfa
2021-01-28 12:10:10 -06:00
Travis Neely
8a79d7c51b Revert "feat(tls): Change Issuer to ClusterIssuer"
This reverts commit f60c94fc16.

Reason for revert: This introduced a bug:
https://cert-manager.io/docs/installation/upgrading/upgrading-0.15-0.16/#issue-with-older-versions-of-kubectl

Older versions of kubectl will have issues with the nested CRDs.

Change-Id: I322fc1382fe3d0a4517e4c7c5982ea50a721a1f7
2021-01-27 16:59:01 -06:00
sgupta
f60c94fc16 feat(tls): Change Issuer to ClusterIssuer
ClusterIssuer does not belong to a single namespace (unlike Issuer)
and can be referenced by Certificate resources from multiple different
namespaces. When internal TLS is added to multiple namespaces, same
ClusterIssuer can be used instead of one Issuer per namespace.

Change-Id: I1576f486f30d693c4bc6b15e25c238d8004b4568
2021-01-15 18:46:09 +00:00
jh629g
67618474ce Update default Kubernetes API for use with Helm v3
Updated Kubernetes api from extensions/v1beta1 to
networking.k8s.io/v1beta1 per docs[0] for kubernetes
1.16 deprecations as helm v3 linting will fail
when it parses extensions/v1beta1 seen here[1]

[0] https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/
[1] https://zuul.opendev.org/t/openstack/build/82f92508fb31418aa377f91d62e0d42e

Change-Id: I0439272587a2afbccc4d7c49ef6ad053c8b305e7
2021-01-05 16:43:38 +00:00
Parsons, Cliff (cp769u)
2d1fe882bb Add capability to delete a backup archive
This patchset adds the capability to delete any archives that are stored
in the local file system or archives that are stored on the remote RGW
data store.

Change-Id: I68cade39e677f895e06ec8f2204f55ff913ce327
2020-10-28 16:19:31 +00:00
okozachenko
63b7a0cd0f Update ingress tpl in helmtoolkit
- Check issuer type to distinguish the annotation between
clusterissuer and issuer
- Add one more annotation "certmanager.k8s.io/xx" for old version

Change-Id: I320c1fe894c84ac38a2878af33e41706fb067422
2020-10-28 07:06:51 +00:00
Gage Hugo
cddf665c16 Fix ks-user script case matching for domain
Some services attempt to recreate the default domain
with both the values of "default" and "Default". Since this
domain already exists when keystone is deployed, this
creates redundant API calls that only result in conflicts.

This change enables nocasematch for string checking in order
to avoid making multiple unnecessary calls to keystone.

Change-Id: I698fd420dc41eae211a511269cb021d4ab7a5bfc
2020-10-19 05:03:58 +00:00
Parsons, Cliff (cp769u)
fc8d855a43 Make database backups work with openstack Train
This PS fixes a problem with the main backup script in the helm-toolkit,
which tries to create a swift container using the SWIFT_URL. The problem
is that the SWIFT_URL is malformed because the call to openstack get
catalog list has a different format in Train than it did in Stein. So a
solution that works for both Train and Stein is needed. This patch will
use openstack catalog show instead and will extract the public URL from
that output.

Change-Id: Ic326b0b4717951525e6b17ab015577f28e1d321a
2020-09-28 20:04:05 +00:00
Phil Sphicas
f7ed96c701 Add extra DNS names to Ingress (helm-toolkit 0.1.1)
The existing helm-toolkit function "helm-toolkit.manifests.ingress"
will create namespace-fqdn and cluster-fqdn Ingress objects when the
host_fqdn_override parameter is used, but only for a single hostname.

This change allows additional FQDNs to be associated with the same
Ingress, including the names defined in the list:

    endpoints.$service.host_fqdn_override.$endpoint.tls.dnsNames

For example:

    endpoints:
      grafana:
        host_fqdn_override:
          public:
            host: grafana.openstackhelm.example
            tls:
              dnsNames:
                - grafana-alt.openstackhelm.example

Will produce the following:

      spec:
        tls:
          - secretName: grafana-tls-public
            hosts:
              - grafana.openstackhelm.example
              - grafana-alt.openstackhelm.example
        rules:
          - host: grafana.openstackhelm.example
            http:
              # ...
          - host: grafana-alt.openstackhelm.example
            http:
              # ...

Change-Id: I9b068f10d25923bf61220112da98d6fbfdf7ef8a
2020-09-24 23:16:32 +00:00
Mohammed Naser
c7a45f166f Run chart-testing on all charts
Added chart lint in zuul CI to enhance the stability for charts.
Fixed some lint errors in the current charts.

Change-Id: I9df4024c7ccf8b3510e665fc07ba0f38871fcbdb
2020-09-11 18:02:38 +03:00
Zuul
f29707dea2 Merge "Un-hardcode restartPolicy for ks-* jobs" 2020-08-25 23:53:08 +00:00