@@ -36,7 +36,7 @@ if ! kind get clusters -q | grep -q $KIND_CLUSTER_NAME; then
36
36
# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration
37
37
# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md
38
38
info " Creating a Kind/Kubernetes cluster"
39
- cat << EOF | kind create cluster --name $KIND_CLUSTER_NAME --image=kindest/node:v1.28.0 @sha256:9f3ff58f19dcf1a0611d11e8ac989fdb30a28f40f236f59f0bea31fb956ccf5c --config=-
39
+ cat << EOF | kind create cluster --name $KIND_CLUSTER_NAME --image=kindest/node:v1.29.4 @sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8 --config=-
40
40
kind: Cluster
41
41
apiVersion: kind.x-k8s.io/v1alpha4
42
42
nodes:
@@ -127,25 +127,29 @@ if ! kubectl get namespace | grep -q projectcontour; then
127
127
# https://tanzu.vmware.com/developer/guides/service-routing-contour-refarch/
128
128
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
129
129
# https://kind.sigs.k8s.io/docs/user/ingress/
130
- kubectl patch daemonsets -n projectcontour envoy -p ' {"spec":{"template":{"spec":{"nodeSelector":{"ingress-ready":"true"},"tolerations":[{"key":"node-role.kubernetes.io/control-plane","operator":"Equal","effect":"NoSchedule"},{"key":"node-role.kubernetes.io/master","operator":"Equal","effect":"NoSchedule"}] }}}}'
130
+ kubectl patch daemonsets -n projectcontour envoy -p ' {"spec":{"template":{"spec":{"nodeSelector":{"ingress-ready":"true"}}}}}'
131
131
info " waiting for resource deployment to finish..."
132
132
kubectl --namespace projectcontour rollout status deployments
133
133
fi
134
134
135
135
if ! kubectl get namespace | grep -q chaos-mesh; then
136
- info " Installing Chaos Mesh to enable fault simulation within K8S"
137
- curl -sSL https://mirrors.chaos-mesh.org/v2.6.2/install.sh | bash -s -- --local kind
136
+ # see: https://chaos-mesh.org/
137
+ helm repo add chaos-mesh https://charts.chaos-mesh.org
138
+ kubectl create ns chaos-mesh
139
+ helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/k3s/containerd/containerd.sock --version 2.6.3
140
+
138
141
info " waiting for resource deployment to finish..."
139
142
kubectl --namespace chaos-mesh rollout status deployments
143
+ kubectl --namespace chaos-mesh get po
140
144
fi
141
145
142
146
if kubectl get namespace | grep -q " ${NAMESPACE} " ; then
143
- info " Remove any lingering persistent volume claims in the ${NAMESPACE} "
144
- kubectl --namespace ${NAMESPACE} delete pvc --all
145
- if helm list --namespace ds --no-headers --short | grep -q openldap; then
147
+ if helm list --namespace ${NAMESPACE} --no-headers --short | grep -q openldap; then
146
148
info " Uninstall previous deployment of OpenLDAP chart"
147
- helm -n ds uninstall openldap
149
+ helm -n ${NAMESPACE} uninstall openldap
148
150
fi
151
+ info " Remove any lingering persistent volume claims in the ${NAMESPACE} "
152
+ kubectl --namespace ${NAMESPACE} delete pvc --all
149
153
info " Removing namespace ${NAMESPACE} "
150
154
kubectl delete namespace ${NAMESPACE}
151
155
fi
@@ -154,28 +158,31 @@ kubectl create namespace ${NAMESPACE}
154
158
155
159
# kubectl delete jobs --all-namespaces --field-selector status.successful=1
156
160
157
- if ! kubectl --namespace $NAMESPACE get secret custom-cert > /dev/null 2>&1 ; then
161
+ if ! kubectl --namespace ${ NAMESPACE} get secret myval-certs > /dev/null 2>&1 ; then
158
162
if [ -f " ${CERT_DIR} /tls.crt" ] && [ -f " ${CERT_DIR} /tls.key" ] && [ -f " ${CERT_DIR} /ca.crt" ]
159
163
then :
160
164
else
161
165
! [ -d " ${CERT_DIR} " ] && mkdir -p " ${CERT_DIR} "
162
- # For "customTLS " we need to provide a certificate, so make one now.
166
+ # For "initTLSSecret " we need to provide a certificate, so make one now.
163
167
info " Creating TLS certs in ${CERT_DIR} "
164
- openssl req -x509 -newkey rsa:4096 -nodes -subj ' /CN=example.com ' -keyout " ${CERT_DIR} " /tls.key -out " ${CERT_DIR} " /tls.crt -days 365 > /dev/null 2>&1
168
+ openssl req -x509 -newkey rsa:4096 -nodes -subj ' /CN=example.org ' -keyout " ${CERT_DIR} " /tls.key -out " ${CERT_DIR} " /tls.crt -days 365 > /dev/null 2>&1
165
169
cp " ${CERT_DIR} " /tls.crt " ${CERT_DIR} " /ca.crt
166
170
fi
167
171
168
- info " Installing certificate materials into the Kubernets cluster as secrets named 'custom-cert' which we use in the 'myval.yaml' values file."
169
- kubectl --namespace " ${NAMESPACE} " create secret generic custom-cert --from-file=" ${CERT_DIR} " /tls.crt --from-file=" ${CERT_DIR} " /tls.key --from-file=" ${CERT_DIR} " /ca.crt
172
+ info " Installing certificate materials into the Kubernets cluster as secrets named 'myval-certs' which we use in the 'myval.yaml' values file."
173
+ kubectl --namespace " ${NAMESPACE} " create secret generic myval-certs --from-file=" ${CERT_DIR} " /tls.crt --from-file=" ${CERT_DIR} " /tls.key --from-file=" ${CERT_DIR} " /ca.crt
174
+ # kubectl get secret myval-certs -n "${NAMESPACE}" -o yaml
170
175
fi
171
176
172
177
if ! helm --namespace " ${NAMESPACE} " list | grep -q openldap; then
173
178
info " Install openldap chart with 'myval.yaml' testing config"
174
- helm install --namespace " ${NAMESPACE} " openldap -f .bin/myval.yaml openldap
179
+ helm install --namespace " ${NAMESPACE} " --values .bin/myval.yaml openldap .
180
+ # kubectl --namespace ds create secret generic my-super-secret --from-literal=LDAP_ADMIN_PASSWORD=Not@SecurePassw0rd --from-literal=LDAP_CONFIG_ADMIN_PASSWORD=Not@SecurePassw0rd
181
+ # helm install --namespace "${NAMESPACE}" --values .bin/singleNode.yaml openldap .
175
182
info " waiting for helm deployment to finish..."
176
- # kubectl --namespace ds get events --watch &
177
- # ( kubectl --namespace ${NAMESPACE} wait --for=condition=Ready --timeout=30s pod/openldap-0 || \
178
- # kubectl --namespace ${NAMESPACE} logs -l app.kubernetes.io/name=openldap --all-containers=true --timestamps=true --prefix=true --tail=-1 --ignore-errors --follow ) &
183
+ kubectl --namespace ${NAMESPACE} get events --watch &
184
+ ( kubectl --namespace ${NAMESPACE} wait --for=condition=Ready --timeout=30s pod/openldap-0 || \
185
+ kubectl --namespace ${NAMESPACE} logs -l app.kubernetes.io/name=openldap --all-containers=true --timestamps=true --prefix=true --tail=-1 --ignore-errors --follow ) &
179
186
kubectl --namespace " ${NAMESPACE} " rollout status sts openldap
180
187
fi
181
188
0 commit comments