@leverege/build-tools 2.28.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.28.0",
3
+ "version": "2.29.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
File without changes
@@ -0,0 +1,43 @@
1
+ #
2
+ # cluster-issuer.yaml.ovh
3
+ #
4
+ apiVersion: cert-manager.io/v1
5
+ kind: ClusterIssuer
6
+ metadata:
7
+ name: letsencrypt-prd
8
+ spec:
9
+ acme:
10
+ # You must replace this email address with your own.
11
+ # Let's Encrypt will use this to contact you about expiring
12
+ # certificates, and issues related to your account.
13
+ email: devops@leverege.com
14
+ server: https://acme-v02.api.letsencrypt.org/directory
15
+ privateKeySecretRef:
16
+ # Secret resource used to store the account's private key.
17
+ name: issuer-account-key
18
+ # Add a single challenge solver, HTTP01 using nginx
19
+ solvers:
20
+ - dns01:
21
+ cloudflare:
22
+ email: devops@leverege.com
23
+ apiTokenSecretRef:
24
+ name: cloudflare
25
+ key: dns-token
26
+ selector:
27
+ dnsZones:
28
+ - 'OVH:<HOST>.com'
29
+ ---
30
+ #
31
+ # this-service.yaml.ovh
32
+ #
33
+ apiVersion: cert-manager.io/v1
34
+ kind: Certificate
35
+ metadata:
36
+ name: OVH:<PROJECT_ID>
37
+ spec:
38
+ secretName: OVH:<PROJECT_ID>-cert
39
+ dnsNames:
40
+ - '*.OVH:<HOST>.com'
41
+ issuerRef:
42
+ name: letsencrypt-prd
43
+ kind: ClusterIssuer
@@ -0,0 +1 @@
1
+ cert-manager-local.yaml
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+ #
3
+ addHelmRepo jetstack https://charts.jetstack.io
4
+ [ -z "$CERT_MANAGER_CHART_VERSION" ] && CERT_MANAGER_CHART_VERSION="v1.10"
5
+ helm upgrade --install cert-manager jetstack/cert-manager \
6
+ --namespace cert-manager --set installCRDs=true \
7
+ --version $CERT_MANAGER_CHART_VERSION
8
+
9
+ cat<<DELAY
10
+
11
+ `color y "20 second delay to allow cert-manager to stabilize before proceeding...\n"`
12
+
13
+ DELAY
14
+
15
+ sleep 20
16
+ kubectl -n cert-manager apply -f cert-manager
17
+
18
+ if [[ $? -eq 1 ]];
19
+ then
20
+
21
+ `color y "***WARNING: cert-manager components still coming up"`
22
+
23
+ Try rerunning this apply again in 30 seconds:
24
+ `color g "kubectl -n cert-manager apply -f cert-manager"`
25
+ fi
26
+
27
+ cat<<HINTS
28
+
29
+ fetch certs: `color g "kubectl -n cert-manager get certificate"`
30
+ check certs: `color g "kubectl -n cert-manager describe certificate"`
31
+
32
+ HINTS
33
+ removeHelmRepo jetstack
@@ -6,7 +6,7 @@ TRAEFIK_NAMESPACE="traefik"
6
6
 
7
7
  addHelmRepo traefik https://helm.traefik.io/traefik
8
8
 
9
- [ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="20"
9
+ [ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="21"
10
10
  helm upgrade --install traefik traefik/traefik \
11
11
  --namespace $TRAEFIK_NAMESPACE --create-namespace \
12
12
  --values traefik/traefik-local.yaml \
package/src/helmup CHANGED
@@ -391,6 +391,33 @@ OLDER_GKE
391
391
  fi
392
392
  }
393
393
 
394
+ function installCertManagerSecret() {
395
+ showInstalling "Cert Managment"
396
+ createNamespaceIfNeeded cert-manager
397
+
398
+ kubectl get secret cloudflare --namespace cert-manager &>/dev/null
399
+ if [[ $? -eq 1 ]];
400
+ then
401
+ cat<<NEED_MANAGED_SECRET
402
+ $RED_ERROR missing secret: `color y cloudflare` namespace: `color y cert-manager`
403
+
404
+ This secret will be fetched from the leverege-docker-images cluster and
405
+ injected into this cluster.
406
+ NEED_MANAGED_SECRET
407
+ #yesToContinue "to copy and inject the cloudflare secret"
408
+ TOKEN=$(getManagedSecret "CLOUDFLARE_API_TOKEN")
409
+ if [ $? -ne 0 ];
410
+ then
411
+ printf "$RED_ERROR getManagedSecret reponse=>[$TOKEN]"
412
+ exitOnError 1 "Failed to fetch the secret from leverege-docker-images"
413
+ fi
414
+ printf "\nInjecting=[$TOKEN] into cloudflare secret\n"
415
+ kubectl create secret generic cloudflare \
416
+ --namespace cert-manager \
417
+ --from-literal=dns-token=$TOKEN
418
+ fi
419
+ }
420
+
394
421
  function installTraefikEnvironment() {
395
422
  showInstalling "Traefik Namespace and Cloudflare Secret"
396
423
  createNamespaceIfNeeded traefik
@@ -615,6 +642,11 @@ function doInstall() {
615
642
  doInstall "${SYSTEM[@]}"
616
643
  ;;
617
644
 
645
+ "cert-manager")
646
+ installCertManagerSecret
647
+ bootstrapLocalSetup $SERVICE
648
+ ;;
649
+
618
650
  "cronZombieKiller"|"zombie-killer")
619
651
  installCronZombieKiller # eradicate the gke 1.20+ zombies
620
652
  ;;