forked from redhat-ztp/ztp-ran-manifests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite_gen.sh
executable file
·61 lines (56 loc) · 1.55 KB
/
site_gen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
CLUSTER_NAME=$1
PROFILE=$2
if [ $PROFILE == "cu" ]; then
cp -rf manifests/sites/sample-site-cu manifests/sites/${CLUSTER_NAME}
sed -i "s/sample-site-cu/$CLUSTER_NAME/g" manifests/sites/${CLUSTER_NAME}/*
elif [ $PROFILE == "du" ]; then
cp -rf manifests/sites/sample-site-du manifests/sites/${CLUSTER_NAME}
sed -i "s/sample-site-du/$CLUSTER_NAME/g" manifests/sites/${CLUSTER_NAME}/*
else
echo "Profile should be either cu or du. Profile=" $PROFILE
exit 0
fi
cat << EOF > ./spoke_clusters/$CLUSTER_NAME.yaml
apiVersion: v1
kind: Namespace
metadata:
name: $CLUSTER_NAME-cluster
---
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
metadata:
labels:
cloud: auto-detect
vendor: auto-detect
name: $CLUSTER_NAME-cluster
profile: $PROFILE
name: $CLUSTER_NAME-cluster
spec:
hubAcceptsClient: true
---
apiVersion: agent.open-cluster-management.io/v1
kind: KlusterletAddonConfig
metadata:
name: $CLUSTER_NAME-cluster
namespace: $CLUSTER_NAME-cluster
spec:
clusterName: $CLUSTER_NAME-cluster
clusterNamespace: $CLUSTER_NAME-cluster
clusterLabels:
cloud: auto-detect
vendor: auto-detect
applicationManager:
enabled: true
policyController:
enabled: true
searchCollector:
enabled: true
certPolicyController:
enabled: true
iamPolicyController:
enabled: true
version: 2.1.0
EOF
echo " - "$CLUSTER_NAME".yaml" >> ./spoke_clusters/kustomization.yaml
echo "still need to modify sites/"$CLUSTER_NAME"/04_sriov_network_node_policy.yaml with intf names that match your cluster info"