-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create console/operator roles for OS Stack (#610)
* Create console/operator roles for OS Stack Signed-off-by: Matthew B White <whitemat@uk.ibm.com> * Cleanup dockerfile Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
- Loading branch information
Showing
70 changed files
with
9,586 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
--- | ||
- name: Deploy Opensource custom resource definitions and operator | ||
hosts: localhost | ||
vars_files: | ||
- vars.yml | ||
vars: | ||
state: present | ||
wait_timeout: 3600 | ||
roles: | ||
- ibm.blockchain_platform.fabric_operator_crds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
--- | ||
- name: Deploy Opensource Console | ||
hosts: localhost | ||
vars_files: | ||
- vars.yml | ||
vars: | ||
state: present | ||
wait_timeout: 3600 | ||
roles: | ||
- ibm.blockchain_platform.fabric_console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Open-source Fabric Stack | ||
|
||
The two playbooks in this example install the [Fabric Operations Console](https://github.com/hyperledger-labs/fabric-operations-console) and the [Fabric Operator](https://github.com/hyperledger-labs/fabric-operator) | ||
|
||
## Usage | ||
|
||
As this function should be considered beta, it has not been published to Ansible Galaxy, or an image to DockerHub. Therefore please follow the installation instructions on installing from source. | ||
|
||
In brief, | ||
|
||
- Clone this repository | ||
- Use `poetry` to create a development shell `poetry shell` | ||
- Run these commands to build locally | ||
``` | ||
ansible-galaxy collection build -f | ||
ansible-galaxy collection install $(ls -1 | grep ibm-blockchain_platform) -f | ||
``` | ||
|
||
You can then run the playbooks as needed | ||
|
||
### Pre-requistie tools | ||
|
||
In addition you will need the `kubectl` and `git` installed. | ||
## Kubernetes Connection | ||
|
||
The playbooks assume that the kubectl context in the current shell is set to the cluster you wish to install to. NOTE that this has been initially tested using a KIND cluster (see the `sample-network` example in the [Fabric Operator](https://github.com/hyperledger-labs/fabric-operator) for creating a KIND instance) | ||
|
||
`vars.yml` contains the essential configuration for naming and initial identities. | ||
|
||
## Post-creation actions | ||
|
||
Once installed, you've the choice of using the Console to create Fabric resources. | ||
Alternatively you can use the other Ansible modules to create resources. | ||
|
||
It helps to create an API key rather than use the username/password. | ||
|
||
For example, assuming the naming as used in the example's `vars.yml` and a local KIND cluster. | ||
|
||
``` | ||
AUTH=$(curl -X POST https://fabricinfra-hlf-console-console.localho.st:443/ak/api/v2/permissions/keys -u admin:password -k -H 'Content-Type: application/json' -d '{"roles": ["writer", "manager"],"description": "newkey"}') | ||
KEY=$(echo $AUTH | jq .api_key | tr -d '"') | ||
SECRET=$(echo $AUTH | jq .api_secret | tr -d '"') | ||
echo "Writing authentication file for Ansible based IBP (Software) network building" | ||
cat << EOF > auth-vars.yml | ||
api_key: $KEY | ||
api_endpoint: http://fabricinfra-hlf-console-console.localho.st/ | ||
api_authtype: basic | ||
api_secret: $SECRET | ||
EOF | ||
``` | ||
|
||
The `auth-vars.yml` can be included in any other playbooks or added in the `ansible-playbook` cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
--- | ||
# The type of K8S cluster this is using | ||
target: kind | ||
arch: amd64 | ||
|
||
# k8s namespace for the operator and console | ||
namespace: fabricinfra | ||
|
||
# Console name/domain | ||
console_name: hlf-console | ||
console_domain: localho.st | ||
|
||
# default configuration for the console | ||
# password reset will be required on first login | ||
console_email: admin | ||
console_default_password: password | ||
|
||
# different k8s clusters will be shipped with differently named default storage providers | ||
# or none at all. KIND for example has one called 'standard' | ||
console_storage_class: standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.