mas.devops
Example
from kubernetes import dynamic
from kubernetes import config
from kubernetes.client import api_client
from mas.devops.ocp import createNamespace
from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions, launchUpgradePipeline
instanceId = "mymas"
pipelinesNamespace = f"mas-{instanceId}-pipelines"
# Create an OpenShift client
dynClient = dynamic.DynamicClient(
api_client.ApiClient(configuration=config.load_kube_config())
)
# Install OpenShift Pipelines Operator
installOpenShiftPipelines(dynamicClient)
# Create the pipelines namespace and install the MAS tekton definitions
createNamespace(dynamicClient, pipelinesNamespace)
updateTektonDefinitions(dynamicClient, pipelinesNamespace, "/mascli/templates/ibm-mas-tekton.yaml")
# Launch the upgrade pipeline and print the URL to view the pipeline run
pipelineURL = launchUpgradePipeline(self.dynamicClient, instanceId)
print(pipelineURL)
mas-devops-create-initial-users
Add to /etc/hosts
127.0.0.1 tgk01-masdev.mas-tgk01-manage.svc.cluster.local
127.0.0.1 coreapi.mas-tgk01-core.svc.cluster.local
127.0.0.1 admin-dashboard.mas-tgk01-core.svc.cluster.local
SM_AWS_REGION=""
SM_AWS_ACCESS_KEY_ID=""
SM_AWS_SECRET_ACCESS_KEY=""
aws configure set default.region ${SM_AWS_REGION}
aws configure set aws_access_key_id ${SM_AWS_ACCESS_KEY_ID}
aws configure set aws_secret_access_key ${SM_AWS_SECRET_ACCESS_KEY}
oc login --token=sha256~xxx --server=https://xxx:6443
oc port-forward service/admin-dashboard 8445:443 -n mas-tgk01-core
oc port-forward service/coreapi 8444:443 -n mas-tgk01-core
oc port-forward service/tgk01-masdev 8443:443 -n mas-tgk01-manage
mas-devops-create-initial-users-for-saas \
--mas-instance-id tgk01 \
--mas-workspace-id masdev \
--log-level INFO \
--initial-users-secret-name "aws-dev/noble4/tgk01/initial_users" \
--manage-api-port 8443 \
--coreapi-port 8444 \
--admin-dashboard-port 8445
mas-devops-create-initial-users-for-saas \
--mas-instance-id tgk01 \
--mas-workspace-id masdev \
--log-level INFO \
--initial-users-yaml-file /home/tom/workspaces/notes/mascore3423/example-users-single.yaml \
--manage-api-port 8443 \
--coreapi-port 8444 \
--admin-dashboard-port 8445
Example of initial_users secret:
{"john.smith1@example.com":"primary,john1,smith1","john.smith2@example.com":"primary,john2,smith2","john.smith3@example.com":"secondary,john3,smith3"}
Metadata
Release files for mas-devops 12.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mas_devops-12.11.0.tar.gz | 130.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mas_devops-12.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 435.6 kB
Release files / mas_devops-12.11.0.tar.gz
| Download URL | mas_devops-12.11.0.tar.gz |
|---|---|
| Size | 130.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef6942a4234c9fbf299be6748c7c6e75c11cac1b9c34abc3c2b3ad23be5bac4b
|
|
BLAKE2b-256 checksum How to use checksums |
234287e996e4a47f21a0f91d0e055d060b1169611a91dd78779113b8a04b08a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / mas_devops-12.11.0-py3-none-any.whl
| Download URL | mas_devops-12.11.0-py3-none-any.whl |
|---|---|
| Size | 304.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f9f5daad9a5b8520d079bcd270505f4f1dafe3aa0cf16bf041362ce0dce69c0
|
|
BLAKE2b-256 checksum How to use checksums |
888fc99f2edcc54d1f169a91c0c843bca59bdbe7a2df65412a7a475c7a10ec1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|