CNAME (alias) Check for Domain/-s via Bash Script

Hits: 99

#!/bin/bash
#set -x

print_usage() {
  printf "Usage: aliastest.sh -a alis-domain.tld -d domain.tld domain2.tld" 
}

# Get the options
while getopts ":h:a:d:" option; do
   case $option in
      h) # display Help
         print_usage
         exit;;
      a) # The alias hostname for check
         hostname=$OPTARG
         ;;
      d) # Domain or domains
         domains=$OPTARG
         ;;
   esac
done

for domain in $domains
do
        echo "Check for $domain:" 
        echo "-------------------" 
        CNAME=$(dig +short CNAME $domain)
        if [ "${CNAME}" == "${hostname}." ]; then
                echo "$domain is alias for $hostname" 
        else
                echo "$domain is NOT alias for $hostname" 

        fi
done

Cert-Manager – Kubernetes NGINX Ingress with Cert-Manager

Hits: 146

Install

Cert-manager is easy to install with Helm Package Manager. The first step is add Jetstack repository in our repository and becoming the package info with update

helm repo add jetstack https://charts.jetstack.io
helm repo update

Now we can install Cert-Manager with CRDs into our cluster:

helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true

Cert-manager have also a kubectl plugin to easily manage configs and resources

OS=$(go env GOOS); ARCH=$(go env GOARCH); curl -sSL -o kubectl-cert-manager.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.7.2/kubectl-cert_manager-$OS-$ARCH.tar.gz
tar xzf kubectl-cert-manager.tar.gz
sudo mv kubectl-cert_manager /usr/local/bin

Configure for The Let’s Encrypt Certificate

Continue reading “Cert-Manager – Kubernetes NGINX Ingress with Cert-Manager”