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"}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mas_devops-12.2.0.tar.gz
(120.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
mas_devops-12.2.0-py3-none-any.whl
(268.8 kB
view details)
File details
Details for the file mas_devops-12.2.0.tar.gz.
File metadata
- Download URL: mas_devops-12.2.0.tar.gz
- Upload date:
- Size: 120.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49cb444f7d7c176af0ae1b73f85b15bacac86795497037abfcbd319e0634321a
|
|
| MD5 |
f79e7f0d6099e986eabdde00b8515688
|
|
| BLAKE2b-256 |
7153d29e28097f740523edc48c2f7ad13891f1c8bdd7a04a58759a073b1d06ad
|
File details
Details for the file mas_devops-12.2.0-py3-none-any.whl.
File metadata
- Download URL: mas_devops-12.2.0-py3-none-any.whl
- Upload date:
- Size: 268.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f092f54f8bc8a81ed491063d6db45fb191c7c8a5f6d38bda7477d6fa4bcfa6f
|
|
| MD5 |
da24f5e01c8d0d254e6aeb1fbe1411b2
|
|
| BLAKE2b-256 |
f9e50f98fd0a79f1c5485a2334a0d61885da96ae35c786cad1ffed73b6105b61
|