Skip to content

Commit

Permalink
Merge pull request #47 from OpenNMS/deejgregor/make-cert-manager-ngin…
Browse files Browse the repository at this point in the history
…x-optional

Make cert-manager optional, add ingress-nginx, tweak workflows
  • Loading branch information
deejgregor authored Nov 17, 2023
2 parents 1c74660 + 833f4d1 commit f8d8280
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,15 @@ jobs:
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --chart-dirs . --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false
run: ct lint --chart-dirs . --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Setup dependencies
if: steps.list-changed.outputs.changed == 'true'
run: |
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx --create-namespace
cd scripts
./start-dependencies.sh
cd ..
run: scripts/start-dependencies.sh

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main

# Make sure only one copy of this workflow can run at a time.
concurrency: ${{ github.workflow }}

jobs:
release:
runs-on: ubuntu-latest
Expand Down
11 changes: 0 additions & 11 deletions scripts/k8s_on_docker_desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,6 @@ printf "\033[36m%s\033[0m:\033[0m\033[33m %s\n\033[0m" "Step 1" "Modifying depen
sed -rie 's/(host: kafka(-0)?).*/\1'$our_kafka_domain'/g' "${root_path}dependencies/kafka.yaml"
echo ""

# Ingress is not really active/installed, lets install it
printf "\033[36m%s\033[0m:\033[0m\033[33m %s\n\033[0m" "Step 2" "Check/Install Ingress"
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx --create-namespace >> $log_file 2>&1
checkRC

sleep 10

echo ""

# Start the dependencies
printf "\033[36m%s\033[0m:\033[0m\033[33m %s\n\033[0m" "Step 3" "Starting Dependencies"
${root_path}scripts/start-dependencies.sh >> $log_file 2>&1
Expand Down
20 changes: 16 additions & 4 deletions scripts/start-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ INSTALL_MIMIR=${INSTALL_MIMIR:-false} # needed for Cortex testing
INSTALL_LOKI=${INSTALL_LOKI:-false} # needed for log aggregation together with promtail in containers; make sure dependencies.loki.hostname='' for the helm chart if this is disabled

# Required dependencies (if you don't install them here, they need to be running somewhere else)
INSTALL_CERT_MANAGER=${INSTALL_CERT_MANAGER:-true}
INSTALL_INGRESS_NGINX=${INSTALL_INGRESS_NGINX:-true}
INSTALL_POSTGRESQL=${INSTALL_POSTGRESQL:-true}

NAMESPACE="shared"
Expand Down Expand Up @@ -49,11 +51,21 @@ helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

# Install Cert-Manager
helm upgrade --install cert-manager jetstack/cert-manager --version v1.10.1 \
--namespace cert-manager --create-namespace --set installCRDs=true --wait
kubectl apply -f ca -n cert-manager
if [ "$INSTALL_CERT_MANAGER" == "true" ]; then
helm upgrade --install cert-manager jetstack/cert-manager --version v1.10.1 \
--namespace cert-manager --create-namespace --set installCRDs=true --wait
kubectl apply -f ca -n cert-manager
fi

# Install ingress-nginx
if [ "$INSTALL_INGRESS_NGINX" == "true" ]; then
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--version 4.8.3 \
--namespace ingress-nginx --create-namespace
fi

# Create a namespace for most of the dependencies except for cert-manager (above), and the postgres and elastic operators (added below).
# Create a namespace for most of the dependencies except for cert-manager and ingress-nginx (above), and the postgres and elastic operators (added below).
kubectl create namespace $NAMESPACE --dry-run=client -o yaml | kubectl apply -f -

# Install Grafana Loki
Expand Down

0 comments on commit f8d8280

Please sign in to comment.