diff --git a/.github/workflows/render-cd.sh b/.github/workflows/render-cd.sh index 0edccea..0c11f5a 100755 --- a/.github/workflows/render-cd.sh +++ b/.github/workflows/render-cd.sh @@ -6,7 +6,7 @@ GITHUB_IMAGE_REPO="ghcr.io" outputdir="output" rm -rf decapod-base-yaml -site_list=$(ls -d */ | sed 's/\///g' | grep -v 'docs' | grep -v 'output' | grep -v 'offline') +site_list=$(ls -d */ | sed 's/\///g' | grep -v 'docs' | grep -v $outputdir | grep -v 'offline') function usage { echo -e "\nUsage: $0 [--site TARGET_SITE] [--base_url DECAPOD_BASE_URL] [--registry REGISTRY_URL]" @@ -75,12 +75,14 @@ do done # Post processes for the customized action - # Action1. change the namespace for aws-cluster-resouces from argo to cluster-name - echo "Almost finished: changing namespace for aws-cluster-resouces from argo to cluster-name.." + # Action1. change the namespace for cluster-resouces from argo to cluster-name + echo "Almost finished: changing namespace for cluster-resouces from argo to cluster-name.." sudo sed -i "s/ namespace: argo/ namespace: $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/* - sudo sed -i "s/ - argo/ - $site/g" $(pwd)/output/$site/tks-cluster-aws/cluster-api-aws/* + sudo sed -i "s/ - argo/ - $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/* + sudo sed -i "s/ namespace: argo/ namespace: $site/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/* + sudo sed -i "s/ - argo/ - $site/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/* # It's possible besides of two above but very tricky!! - # sudo sed -i "s/ argo$/ $site/g" $(pwd)/output/$site/tks-cluster-aws/cluster-api-aws/* + # sudo sed -i "s/ argo$/ $site/g" $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/* echo "--- apiVersion: v1 kind: Namespace @@ -91,7 +93,8 @@ metadata: # It bring the secret 'dacapod-argocd-config' using kubed decapod-argocd-config: enabled " > Namespace_aws_rc.yaml - sudo mv Namespace_aws_rc.yaml $(pwd)/output/$site/tks-cluster-aws/cluster-api-aws/ + sudo cp Namespace_aws_rc.yaml $(pwd)/$outputdir/$site/tks-cluster-aws/cluster-api-aws/ + sudo cp Namespace_aws_rc.yaml $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/ # End of Post process done diff --git a/decapod-reference/tks-cluster-aws/site-values.yaml b/decapod-reference/tks-cluster-aws/site-values.yaml index 166330e..5f6becb 100644 --- a/decapod-reference/tks-cluster-aws/site-values.yaml +++ b/decapod-reference/tks-cluster-aws/site-values.yaml @@ -44,37 +44,5 @@ charts: size: 50 type: gp2 -- name: kubernetes-addons - override: - cni.calico.enabled: true - - name: aws-ebs-csi-driver override: - -- name: ingress-nginx - override: - controller: - nodeSelector: - taco-lma: enabled - resources: - requests: - cpu: 2000m - memory: 4Gi - service: - annotations: - service.beta.kubernetes.io/aws-load-balancer-type: "nlb" - externalTrafficPolicy: Local - type: LoadBalancer - config: - enable-underscores-in-headers: "true" - proxy-body-size: "10m" - -- name: cluster-autoscaler - override: - discoveryNamespace: $(clusterName) - discoveryClusterName: $(clusterName) - -- name: cluster-autoscaler-rbac - override: - deployMgmtRbacOnly: - targetNamespace: $(clusterName) diff --git a/decapod-reference/tks-cluster-common/kustomization.yaml b/decapod-reference/tks-cluster-common/kustomization.yaml new file mode 100644 index 0000000..4d8d8ae --- /dev/null +++ b/decapod-reference/tks-cluster-common/kustomization.yaml @@ -0,0 +1,5 @@ +resources: + - ../base + +transformers: + - site-values.yaml diff --git a/decapod-reference/tks-cluster-common/site-values.yaml b/decapod-reference/tks-cluster-common/site-values.yaml new file mode 100644 index 0000000..c0fbe02 --- /dev/null +++ b/decapod-reference/tks-cluster-common/site-values.yaml @@ -0,0 +1,44 @@ +apiVersion: openinfradev.github.com/v1 +kind: HelmValuesTransformer +metadata: + name: site + +global: + # These values are replaced on cluster creation by workflow + clusterName: cluster.local +charts: +- name: kubernetes-addons + override: + cni.calico.enabled: true + +- name: ingress-nginx + override: + controller: + nodeSelector: + taco-lma: enabled + resources: + requests: + cpu: 2000m + memory: 4Gi + service: + annotations: + service.beta.kubernetes.io/aws-load-balancer-type: "nlb" + externalTrafficPolicy: Local + annotations: + service.beta.kubernetes.io/aws-load-balancer-name: "taco-ingress-nlb" + service.beta.kubernetes.io/aws-load-balancer-type: "nlb" + service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*" + type: LoadBalancer + config: + enable-underscores-in-headers: "true" + proxy-body-size: "10m" + +- name: cluster-autoscaler + override: + discoveryNamespace: $(clusterName) + discoveryClusterName: $(clusterName) + +- name: cluster-autoscaler-rbac + override: + deployMgmtRbacOnly: + targetNamespace: $(clusterName)