Skip to content
Merged
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 python/src/mas/cli/aiservice/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ def install(self, argv):
aiserviceConfig=self.aiserviceConfigSecret,
slack_token=self.getParam("slack_token"),
slack_channel=self.getParam("slack_channel"),
ibm_entitlement_key=self.getParam("ibm_entitlement_key"),
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)

self.setupApprovals(pipelinesNamespace)
Expand Down
8 changes: 7 additions & 1 deletion python/src/mas/cli/backup/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .argParser import backupArgParser
from mas.devops.ocp import createNamespace, getConsoleURL, getStorageClasses
from mas.devops.mas import listMasInstances, getDefaultStorageClasses, getWorkspaceId
from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelines, updateTektonDefinitions, launchBackupPipeline
from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelines, updateTektonDefinitions, launchBackupPipeline, prepareBackupSecrets

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -249,6 +249,12 @@ def backup(self, argv):
createBackupPVC=True,
backupStorageSize=backupStorageSize,
)
prepareBackupSecrets(
dynClient=self.dynamicClient,
namespace=pipelinesNamespace,
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)
h.stop_and_persist(symbol=self.successIcon, text=f"Namespace is ready ({pipelinesNamespace})")

with Halo(text=f"Installing latest Tekton definitions (v{self.version})", spinner=self.spinner) as h:
Expand Down
3 changes: 3 additions & 0 deletions python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3165,6 +3165,9 @@ def install(self, argv):
aiserviceConfig=self.aiserviceConfigSecret,
slack_token=self.getParam("slack_token"),
slack_channel=self.getParam("slack_channel"),
ibm_entitlement_key=self.getParam("ibm_entitlement_key"),
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)

self.setupApprovals(pipelinesNamespace)
Expand Down
9 changes: 8 additions & 1 deletion python/src/mas/cli/restore/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,14 @@ def restore(self, argv):
)

# Apply config file secrets to the namespace
prepareRestoreSecrets(dynClient=self.dynamicClient, namespace=pipelinesNamespace, restoreConfigs=self.configSecret)
prepareRestoreSecrets(
dynClient=self.dynamicClient,
namespace=pipelinesNamespace,
restoreConfigs=self.configSecret,
ibm_entitlement_key=self.getParam("ibm_entitlement_key"),
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)

h.stop_and_persist(symbol=self.successIcon, text=f"Namespace is ready ({pipelinesNamespace})")

Expand Down
2 changes: 2 additions & 0 deletions python/src/mas/cli/update/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ def update(self, argv):
slack_token=self.getParam("slack_token"),
slack_channel=self.getParam("slack_channel"),
db2LicenseFile=self.db2LicenseFileSecret,
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)

with Halo(text=f"Installing latest Tekton definitions (v{self.version})", spinner=self.spinner) as h:
Expand Down
16 changes: 15 additions & 1 deletion python/src/mas/cli/upgrade/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@
getInstalledApps,
)
from mas.devops.utils import isVersionEqualOrAfter
from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelines, updateTektonDefinitions, launchUpgradePipeline, lookupPipelineStorageClass
from mas.devops.tekton import (
preparePipelinesNamespace,
installOpenShiftPipelines,
updateTektonDefinitions,
launchUpgradePipeline,
lookupPipelineStorageClass,
prepareUpgradeSecrets,
)
from mas.devops.pre_install import applyPreInstallMASRBAC
from ..rbac_utils import evaluatePreinstallRBACAccess

Expand Down Expand Up @@ -594,6 +601,13 @@ def channelOrder(ch):
storageClass=self.pipelineStorageClass,
accessMode=self.pipelineStorageAccessMode,
)
prepareUpgradeSecrets(
dynClient=self.dynamicClient,
namespace=pipelinesNamespace,
ibm_entitlement_key=self.getParam("ibm_entitlement_key"),
artifactory_token=self.getParam("artifactory_token"),
artifactory_username=self.getParam("artifactory_username"),
)
h.stop_and_persist(symbol=self.successIcon, text=f"Namespace is ready ({pipelinesNamespace})")

with Halo(text=f"Installing latest Tekton definitions (v{self.version})", spinner=self.spinner) as h:
Expand Down
5 changes: 0 additions & 5 deletions tekton/src/params/backup.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@
default: ""
description: Required for DRO installation during restore

- name: ibm_entitlement_key
type: string
default: ""
description: Required for DRO installation during restore

# Restore-specific Configuration
# -----------------------------------------------------------------------------
- name: mas_domain_on_restore
Expand Down
14 changes: 6 additions & 8 deletions tekton/src/params/common.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
default: IfNotPresent
description: Pull policy for pipeline container images

# Development Build Support
- name: artifactory_username
default: ""
type: string
description: Required to install development MAS catalogs
- name: artifactory_token
default: ""
# Registry Credentials Secret
# "mas-secrets" as default avoids empty-string secretKeyRef.name which Kubernetes rejects at pod scheduling
# even with optional: true. Taskdefs with registry-secret-param.yml.j2 always override this except FVTs tasks.
- name: pipeline_registry_secret_name
type: string
description: Required to install development MAS catalogs
default: "mas-secrets"
description: Name of the per-pipeline Kubernetes Secret holding registry credentials (IBM_ENTITLEMENT_KEY, ARTIFACTORY_TOKEN, ARTIFACTORY_USERNAME)

# Custom Labels
- name: custom_labels
Expand Down
6 changes: 0 additions & 6 deletions tekton/src/params/install-common.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
default: ""
description: ReadWriteMany storage class

# Entitlement
# -----------------------------------------------------------------------------
- name: ibm_entitlement_key
type: string
description: IBM Entitlement Key

# Pipeline config
# -----------------------------------------------------------------------------
- name: skip_pre_check
Expand Down
1 change: 1 addition & 0 deletions tekton/src/pipelines/aiservice-upgrade.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- name: aiservice-upgrade
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}
- name: aiservice_instance_id
value: $(params.aiservice_instance_id)
- name: aiservice_channel
Expand Down
19 changes: 10 additions & 9 deletions tekton/src/pipelines/mas-backup.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: devops_suite_name
value: backup-ibm-catalogs
Expand All @@ -87,11 +88,6 @@ spec:
- name: ibm_catalogs_action
value: backup

- name: artifactory_username
value: $(params.artifactory_username)
- name: artifactory_token
value: $(params.artifactory_token)

taskRef:
kind: Task
name: mas-devops-ibm-catalogs
Expand All @@ -107,6 +103,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: devops_suite_name
value: backup-cert-manager
Expand Down Expand Up @@ -134,6 +131,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: devops_suite_name
value: backup-mongodb
Expand Down Expand Up @@ -173,6 +171,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -208,6 +207,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -240,6 +240,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -288,6 +289,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -322,6 +324,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -370,6 +373,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -404,6 +408,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: backup_version
value: $(params.backup_version)
Expand All @@ -423,10 +428,6 @@ spec:
value: $(params.s3_endpoint_url)

# Artifactory parameters
- name: artifactory_username
value: $(params.artifactory_username)
- name: artifactory_token
value: $(params.artifactory_token)
- name: artifactory_url
value: $(params.artifactory_url)
- name: artifactory_repository
Expand Down
18 changes: 12 additions & 6 deletions tekton/src/pipelines/mas-restore.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -121,10 +122,6 @@ spec:
value: $(params.s3_endpoint_url)

# Artifactory parameters
- name: artifactory_username
value: $(params.artifactory_username)
- name: artifactory_token
value: $(params.artifactory_token)
- name: artifactory_url
value: $(params.artifactory_url)
- name: artifactory_repository
Expand All @@ -150,6 +147,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -177,6 +175,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -204,6 +203,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand All @@ -230,6 +230,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -272,6 +273,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -310,6 +312,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand All @@ -329,8 +332,6 @@ spec:
value: "$(params.dro_contact_firstname)"
- name: dro_contact_lastname
value: "$(params.dro_contact_lastname)"
- name: ibm_entitlement_key
value: $(params.ibm_entitlement_key)
- name: dro_namespace
value: $(params.dro_namespace)
- name: dro_storage_class
Expand All @@ -356,6 +357,7 @@ spec:
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/backup-restore/restore-params.yml.j2') | indent(8) }}

Expand Down Expand Up @@ -418,6 +420,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: db2_action
value: restore
Expand Down Expand Up @@ -457,6 +460,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down Expand Up @@ -497,6 +501,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: db2_action
value: restore
Expand Down Expand Up @@ -536,6 +541,7 @@ spec:
values: ["true", "True"]
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/registry-secret-param.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand Down
Loading
Loading