fabric-samples/test-network-k8s/kube/org2/org2-cc-template.yaml
destinysky 9f844e5de3
Fix namespace in k8s configuration files (#784)
Issues:
1. When the name of NETWORK_NAME or NS in file "network" (i.e., the namespace in k8s) is changed from "test-network", the resources in the k8s cluster cannot be created successfully when the command "./network up" is executed.
Error message: error: the namespace from the provided object "test-network" does not match the namespace "xxxxxx". You must pass '--namespace=test-network' to perform this operation.
2. org2-cc.yaml is not completed.

Fix:
1. Replace "test-network" in yaml files in folder "kube" with "${NS}".
2. Complete "org2-cc-template.yaml" by referring to "org1-cc-template.yaml".

Signed-off-by: destinysky <kangrui10@126.com>
2022-07-04 08:36:36 -04:00

46 lines
No EOL
1 KiB
YAML

#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: org2{{PEER_NAME}}-ccaas-{{CHAINCODE_NAME}}
spec:
replicas: 1
selector:
matchLabels:
app: org2{{PEER_NAME}}-ccaas-{{CHAINCODE_NAME}}
template:
metadata:
labels:
app: org2{{PEER_NAME}}-ccaas-{{CHAINCODE_NAME}}
spec:
containers:
- name: main
image: {{CHAINCODE_IMAGE}}
imagePullPolicy: IfNotPresent
env:
- name: CHAINCODE_SERVER_ADDRESS
value: 0.0.0.0:9999
- name: CHAINCODE_ID
value: {{CHAINCODE_ID}}
- name: CORE_CHAINCODE_ID_NAME
value: {{CHAINCODE_ID}}
ports:
- containerPort: 9999
---
apiVersion: v1
kind: Service
metadata:
name: org2{{PEER_NAME}}-ccaas-{{CHAINCODE_NAME}}
spec:
ports:
- name: chaincode
port: 9999
protocol: TCP
selector:
app: org2{{PEER_NAME}}-ccaas-{{CHAINCODE_NAME}}