Skip to content

Commit

Permalink
support multiple infra provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zugwan committed Jun 17, 2022
1 parent 4f1c2af commit 2fae312
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 35 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/render-cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ 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/ namespace: argo/ namespace: $site/g" $(pwd)/$outputdir/$site/tks-cluster-byoh/cluster-api-byoh/*
sudo sed -i "s/ - argo/ - $site/g" $(pwd)/output/$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/*
echo "---
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)/output/$site/tks-cluster-aws/cluster-api-aws/
sudo cp Namespace_aws_rc.yaml $(pwd)/output/$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
40 changes: 40 additions & 0 deletions decapod-reference/tks-cluster-common/site-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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
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 2fae312

Please sign in to comment.