diff --git a/Dockerfile b/Dockerfile index 1146e01..23da403 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,6 @@ RUN sed -i.bak 's/listen\(.*\)80;/listen 8081;/' /etc/nginx/conf.d/default.conf RUN mkdir /usr/local/openresty/nginx/conf/kubeinvaders COPY nginx/nginx.conf /etc/nginx/nginx.conf - COPY scripts/metrics.lua /usr/local/openresty/nginx/conf/kubeinvaders/metrics.lua COPY scripts/pod.lua /usr/local/openresty/nginx/conf/kubeinvaders/pod.lua COPY scripts/node.lua /usr/local/openresty/nginx/conf/kubeinvaders/node.lua @@ -51,7 +50,12 @@ COPY scripts/chaos-containers.lua /usr/local/openresty/nginx/conf/kubeinvaders/c COPY scripts/programming_mode.lua /usr/local/openresty/nginx/conf/kubeinvaders/programming_mode.lua COPY scripts/config_kubeinv.lua /usr/local/openresty/lualib/config_kubeinv.lua COPY scripts/programming_mode /opt/programming_mode/ +COPY scripts/metrics_loop /opt/metrics_loop/ +COPY scripts/logs_loop /opt/logs_loop/ + RUN pip3 install -r /opt/programming_mode/requirements.txt +RUN pip3 install -r /opt/programming_mode/requirements.txt + COPY nginx/KubeInvaders.conf /etc/nginx/conf.d/KubeInvaders.conf RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx /var/www/html /etc/nginx/conf.d diff --git a/dev-tools/shell.sh b/dev-tools/shell.sh new file mode 100644 index 0000000..63333fb --- /dev/null +++ b/dev-tools/shell.sh @@ -0,0 +1,3 @@ +#! /bin/bash +kubectl exec -it $(kubectl get pods -n kubeinvaders | grep 'kubeinvaders-' | awk '{ print $1 }') -n kubeinvaders bash + diff --git a/entrypoint.sh b/entrypoint.sh index b723569..384f64c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,4 +10,10 @@ fi # TODO: use a sidecar redis-server /etc/redis/redis.conf & +# TODO: use a sidecar +bash /opt/metrics_loop/start.sh & +bash /opt/logs_loop/start.sh & + +echo '

waiting for logs...

' > /var/www/html/chaoslogs.html + nginx -c /etc/nginx/nginx.conf -g 'daemon off;' diff --git a/helm-charts/kubeinvaders/templates/rbac-cluster.yaml b/helm-charts/kubeinvaders/templates/rbac-cluster.yaml index bb4aba9..926bcf8 100644 --- a/helm-charts/kubeinvaders/templates/rbac-cluster.yaml +++ b/helm-charts/kubeinvaders/templates/rbac-cluster.yaml @@ -12,12 +12,12 @@ metadata: rules: - apiGroups: [""] resources: ["pods", "pods/log"] - verbs: ["get", "watch", "list", "delete"] + verbs: ["delete"] - apiGroups: ["batch", "extensions"] resources: ["jobs"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] -- apiGroups: [""] - resources: ["nodes"] +- apiGroups: ["*"] + resources: ["*"] verbs: ["get", "watch", "list"] {{- end -}} {{- if or .Values.clusterRole.create .Values.clusterRole.name }} diff --git a/html5/index.html b/html5/index.html index a744662..7b0727d 100644 --- a/html5/index.html +++ b/html5/index.html @@ -44,7 +44,7 @@