Skip to content

Commit

Permalink
fixing issue with k3s
Browse files Browse the repository at this point in the history
  • Loading branch information
nandajavarma committed Jun 29, 2022
1 parent 73233fc commit ca8985f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .werft/eks-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ pod:
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
printf '{{ toJson . }}' > context.json
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
npx ts-node .werft/installer-tests.ts "STANDARD_EKS_TEST"
# The bit below makes this a cron job
Expand Down
27 changes: 16 additions & 11 deletions .werft/installer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
"STANDARD_GKE_CLUSTER",
"CERT_MANAGER",
"GCP_MANAGED_DNS",
"CLUSTER_ISSUER",
"GENERATE_KOTS_CONFIG",
"INSTALL_GITPOD",
"CHECK_INSTALLATION",
Expand All @@ -49,6 +50,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
PHASES: [
"STANDARD_GKE_CLUSTER",
"CERT_MANAGER",
"CLUSTER_ISSUER",
"GCP_MANAGED_DNS",
"GENERATE_KOTS_CONFIG",
"INSTALL_GITPOD",
Expand All @@ -66,11 +68,12 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
PHASES: [
"STANDARD_K3S_CLUSTER_ON_GCP",
"CERT_MANAGER",
"CLUSTER_ISSUER",
"GENERATE_KOTS_CONFIG",
"INSTALL_GITPOD",
"RESULTS",
"CHECK_INSTALLATION",
"RUN_INTEGRATION_TESTS",
"RESULTS",
"DESTROY",
],
},
Expand All @@ -80,6 +83,7 @@ const TEST_CONFIGURATIONS: { [name: string]: TestConfig } = {
PHASES: [
"STANDARD_K3S_CLUSTER_ON_GCP",
"CERT_MANAGER",
"CLUSTER_ISSUER",
"GENERATE_KOTS_CONFIG",
"INSTALL_GITPOD",
"CHECK_INSTALLATION",
Expand Down Expand Up @@ -169,18 +173,18 @@ const INFRA_PHASES: { [name: string]: InfraConfig } = {
description: `Generate KOTS Config file`,
},
CLUSTER_ISSUER: {
phase: `setup-azure-cluster-issuer cloud=${cloud}`,
makeTarget: "azure-issuer",
description: "Deploys ClusterIssuer for azure",
phase: "setup-cluster-issuer",
makeTarget: `cluster-issuer cloud=${cloud}`,
description: `Deploys ClusterIssuer for ${cloud}`,
},
EXTERNALDNS: {
phase: "external-dns",
makeTarget: `external-dns cloud=${cloud}`,
description: `Deploys external-dns with ${cloud} provider`,
},
ADD_NS_RECORD: {
phase: `add-ns-record cloud=${cloud}`,
makeTarget: "add-ns-record",
phase: "add-ns-record",
makeTarget: `add-ns-record cloud=${cloud}`,
description: "Adds NS record for subdomain under gitpod-self-hosted.com",
},
INSTALL_GITPOD_IGNORE_PREFLIGHTS: {
Expand Down Expand Up @@ -246,8 +250,7 @@ export async function installerTests(config: TestConfig) {
}

function callMakeTargets(phase: string, description: string, makeTarget: string) {
werft.phase(phase, `${description}`);
werft.log(phase, `calling ${makeTarget}`);
werft.phase(phase, description);

const response = exec(`make -C ${makefilePath} ${makeTarget}`, {
slice: "call-make-target",
Expand All @@ -257,12 +260,14 @@ function callMakeTargets(phase: string, description: string, makeTarget: string)
if (response.code) {
console.error(`Error: ${response.stderr}`);
werft.fail(phase, "Operation failed");
} else {
werft.log(phase, response.stdout.toString());
werft.done(phase);
return response.code;
}

werft.log(phase, response.stdout.toString());
werft.done(phase);

return response.code;

}

function randomize(resource: string, platform: string): string {
Expand Down
5 changes: 1 addition & 4 deletions install/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ k3s-standard-cluster:
terraform workspace new $(TF_VAR_TEST_ID) || terraform workspace select $(TF_VAR_TEST_ID) && \
terraform apply -target=module.k3s -var kubeconfig=${KUBECONFIG} --auto-approve

CLUSTER_ISSUER_CLOUD_DNS := "./manifests/gcp-issuer.yaml"

.PHONY:
## cert-manager: Installs cert-manager, optionally create secret for cloud-dns access
cert-manager:
Expand All @@ -77,8 +75,7 @@ cert-manager:
## managed-dns: Installs external-dns, and setup up CloudDNS access
managed-dns: check-env-sub-domain
terraform workspace select $(TF_VAR_TEST_ID) && \
terraform apply -target=module.clouddns-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve && \
kubectl --kubeconfig=${KUBECONFIG} apply -f ${CLUSTER_ISSUER_CLOUD_DNS}
terraform apply -target=module.clouddns-externaldns -var kubeconfig=${KUBECONFIG} --auto-approve

cloud ?= "azure"
.PHONY:
Expand Down
14 changes: 14 additions & 0 deletions install/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ module "k3s" {
domain_name = "${var.TEST_ID}.gitpod-self-hosted.com"
}

module "gcp-issuer" {
source = "../infra/terraform/tools/issuer"
kubeconfig = var.kubeconfig
issuer_name = "cloudDNS"
cert_manager_issuer = {
project = "dns-for-playgrounds"
serviceAccountSecretRef = {
name = "clouddns-dns01-solver"
key = "keys.json"
}
}
}


module "aks" {
# source = "github.com/gitpod-io/gitpod//install/infra/terraform/aks?ref=main" # we can later use tags here
source = "../infra/terraform/aks"
Expand Down

0 comments on commit ca8985f

Please sign in to comment.