Skip to content

Commit

Permalink
Merge pull request #89 from openinfradev/multiple_infra_provider
Browse files Browse the repository at this point in the history
support multiple infra provider
  • Loading branch information
zugwan authored Jun 24, 2022
2 parents 4f1c2af + ba5ce7f commit 5027dfb
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 38 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/render-cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
32 changes: 0 additions & 32 deletions decapod-reference/tks-cluster-aws/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions decapod-reference/tks-cluster-common/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../base

transformers:
- site-values.yaml
44 changes: 44 additions & 0 deletions decapod-reference/tks-cluster-common/site-values.yaml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 5027dfb

Please sign in to comment.