Compare commits
2 Commits
ea6635f716
...
0b156f5b48
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b156f5b48 | ||
|
|
9efb2a0a15 |
@@ -11,7 +11,7 @@ Ingress fqdn has to be configured by either:
|
||||
|
||||
*replicas* and *content-git-repo* in *config* folder can be customized by modifying files or applying kustomize patch
|
||||
|
||||
Connntent git will be displayed in an iframe with node name on top.
|
||||
Content git will be displayed in an iframe with node name on top. If it's empty, it will display a blank page with node name.
|
||||
|
||||
Node name is displayed on the top of the page and also in kube-node.json and on kube-node.txt
|
||||
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
#!/bin/sh
|
||||
git_retries=20
|
||||
try=0
|
||||
export GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
|
||||
until timeout 10 git clone --recurse-submodules ${CONTENT_GIT_REPO} /app ; do
|
||||
echo "Retry git pull after error ($try / $git_retries)"
|
||||
try=$((try+1))
|
||||
if [ $try -eq $git_retries ]; then
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
if [ -n "${CONTENT_GIT_REPO}" ] ; then
|
||||
export GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
|
||||
until timeout 10 git clone --recurse-submodules ${CONTENT_GIT_REPO} /app ; do
|
||||
echo "Retry git pull after error ($try / $git_retries)"
|
||||
try=$((try+1))
|
||||
if [ $try -eq $git_retries ]; then
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
cd /app
|
||||
if [ -e index.html ] ; then
|
||||
mv index.html index-embedded.html
|
||||
fi
|
||||
|
||||
cat <<EOF >index.html
|
||||
<html>
|
||||
<head>
|
||||
@@ -24,15 +28,26 @@ cat <<EOF >index.html
|
||||
From node ${KUBE_NODE_NAME}<br />
|
||||
as <a href="./kube-node.json">json</a> - <a href="./kube-node.txt">text</a>
|
||||
</p>
|
||||
EOF
|
||||
|
||||
if [ -n "${CONTENT_GIT_REPO}" ] ; then
|
||||
cat <<EOF >>index.html
|
||||
<iframe
|
||||
id="embeddedcontent"
|
||||
title="embeddedcontent"
|
||||
width="100%"
|
||||
height="90%"
|
||||
src="./index-embedded.html" />
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat <<EOF >>index.html
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
ls -l
|
||||
cat index.html
|
||||
|
||||
echo '{"node": "'${KUBE_NODE_NAME}'"}' > kube-node.json
|
||||
echo -n ${KUBE_NODE_NAME} > kube-node.txt
|
||||
|
||||
@@ -7,22 +7,27 @@ spec:
|
||||
replicas: 1
|
||||
template:
|
||||
spec:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app.kubernetes.io/instance
|
||||
operator: In
|
||||
values:
|
||||
- html-kube-tester
|
||||
topologyKey: kubernetes.io/hostname
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: html-kube-tester
|
||||
matchLabelKeys:
|
||||
- pod-template-hash
|
||||
- maxSkew: 1
|
||||
topologyKey: kubernetes.io/hostname
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: html-kube-tester
|
||||
matchLabelKeys:
|
||||
- pod-template-hash
|
||||
initContainers:
|
||||
- name: content-generator
|
||||
image: quay.io/simbelmas/alpine-tools:stable
|
||||
@@ -61,21 +66,9 @@ spec:
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 10Mi
|
||||
cpu: 10m
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
livenessProbe: &html-kube-tester-probe
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8080
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 15
|
||||
failureThreshold: 10
|
||||
readinessProbe:
|
||||
<<: *html-kube-tester-probe
|
||||
periodSeconds: 2
|
||||
cpu: 40m
|
||||
volumes:
|
||||
- name: init
|
||||
configMap:
|
||||
|
||||
@@ -18,6 +18,7 @@ resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
||||
#- resourceQuotas.yaml
|
||||
|
||||
replacements:
|
||||
- source:
|
||||
|
||||
8
resourceQuotas.yaml
Normal file
8
resourceQuotas.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: compute-resources
|
||||
spec:
|
||||
hard:
|
||||
requests.cpu: "100m"
|
||||
limits.cpu: "50m"
|
||||
Reference in New Issue
Block a user