Skip to content

Commit

Permalink
missing custom-CA in argo-cd
Browse files Browse the repository at this point in the history
Signed-off-by: Salvatore Dario Minonne <sminonne@redhat.com>
  • Loading branch information
sdminonne committed Jun 21, 2023
1 parent 57c2831 commit 487dd97
Show file tree
Hide file tree
Showing 8 changed files with 5,788 additions and 216 deletions.
7 changes: 4 additions & 3 deletions 00-boostrap-minikube-infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,22 @@ do
done

log::info "Restaring minikube(s)"
for CLUSTERNAME in "${managedclusters[@]}"
for CLUSTERNAME in "${clusters[@]}"
do
minikube start -p ${CLUSTERNAME};
minikube -p ${CLUSTERNAME} addons enable ingress
wait_until "minikube_up_and_running ${CLUSTERNAME}"
done

#now starts the mgmt control plane
minikube start -p ${MGMT}
wait_until "minikube_up_and_running ${MGMT}"
#minikube start -p ${MGMT}
#wait_until "minikube_up_and_running ${MGMT}"


for c in $(minikube profile list -o json | jq -r .valid[].Name);
do echo $(minikube -p $c ip) ${c} | sudo tee -a /etc/hosts
done

echo $(minikube -p ${MGMT} ip) my-git.io | sudo tee -a /etc/hosts

exit
5 changes: 5 additions & 0 deletions 9-cleanup-minikube-infra.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/usr/bin/env bash
ROOTDIR=$(git rev-parse --show-toplevel)

. ${ROOTDIR}/common.sh

#check pre-requisities: TODO check version
command -v minikube >/dev/null 2>&1 || { log::error >&2 "can't find minikube. Aborting."; exit 1; }


log::info "Cleaning /etc/hosts"
for c in $(minikube profile list -o json | jq -r .valid[].Name);
do sudo sed -i "/$(minikube -p $c ip) ${c}/d" /etc/hosts;
done
sudo sed -i "/$(minikube -p ${MGMT} ip) my-git.io/d" /etc/hosts;

for c in $(minikube profile list -o json | jq -r .valid[].Name);
do minikube delete -p $c;
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@

To avoid messing ~/.kube/config
Prerequisites:

```shell
$ export KUBECONFIG=$(mktemp -t argoFM.XXXXXXXX.kubeconfig)
```

To create 3 minikube clusters: `mgmt`, `cluster1` and `cluster2`.
One of the main goal of this repository is to show how we can add certificates remotely. Certificates are generated locally on management cluster ${MGMT} in the `demo.sh` script and propgated through (syncrets)[] micro-controller. In order to avoid real certificates through an ACME we create a local issuer for `cert-manager`. The local issuer is based on (mini-ca)[./mini-ca].

```shell
$ ./00-boostrap-minikube-infra.sh
```

The script configure `minikube` networks to see each others.

This is optional but in case cluster pods cannot see each other you may want to chec connectivity.
```shell
$ export KUBECONFIG=$(mktemp)
$ ./01-check-minikube-infra-connectivity.sh
```

Expand All @@ -25,7 +18,7 @@ $ ./demo.sh
```


To cleanup all the `minikube`s
To cleanup all `minikube` clusters.

```shell
$ ./9-cleanup-minikube-infra.sh
Expand Down
16 changes: 14 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,21 @@ deployment_in_namespace_for_context_up_and_running() {
}


http_endpoint_is_up() {
https_endpoint_is_up() {
httpendpoint=$1
httpstatus=$(curl -I ${httpendpoint} 2>/dev/null | head -n 1 | cut -d$' ' -f2)
httpstatus=$(curl -I ${httpendpoint} 2>/dev/null | head -n 1 | cut -d$' ' -f2)
if [[ "${httpstatus}" == "200" ]]
then
echo "0"
return
fi
echo "1"
}


https_insecure_endpoint_is_up() {
httpendpoint=$1
httpstatus=$(curl -I -k ${httpendpoint} 2>/dev/null | head -n 1 | cut -d$' ' -f2)
if [[ "${httpstatus}" == "200" ]]
then
echo "0"
Expand Down
Loading

0 comments on commit 487dd97

Please sign in to comment.