Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky-sideburn committed Sep 11, 2024
1 parent 28939cd commit 7074222
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
36 changes: 35 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
FROM 10.10.10.3:5000/local/kubeinvaders_base:develop
FROM nginx:stable

# Update repo and install some utilities and prerequisites
RUN apt-get update -y
RUN apt-get -y install wget at procps gnupg ca-certificates jq openssl task-spooler apt-transport-https python3 python3-pip redis libssl-dev python3-yaml python3-kubernetes python3-redis python3-requests

# Install kubectl
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin/kubectl

# Install Openresty
RUN wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -
RUN codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release` && echo "deb http://openresty.org/package/debian $codename openresty" | tee /etc/apt/sources.list.d/openresty.list
RUN apt-get update -y
RUN apt-get -y install openresty
RUN chmod 777 /usr/local/openresty/nginx

# Install LUA Module
RUN apt-get -y install luarocks lua-json lua-socket libyaml-dev
RUN apt-get update --fix-missing

RUN for pkg in luasec lunajson lyaml; do luarocks install $pkg; done

# Install kube-linter
RUN curl -L -O https://github.com/stackrox/kube-linter/releases/download/0.6.0/kube-linter-linux.tar.gz
RUN tar -xvf kube-linter-linux.tar.gz && rm -f kube-linter-linux.tar.gz
RUN cp kube-linter /usr/local/bin/ && chmod 775 /usr/local/bin/kube-linter
RUN mkdir /tmp/kube-linter-pods && chmod 777 /tmp/kube-linter-pods

# Installl parser script for kubelinter
COPY kube-linter/kube-linter-parser.sh /opt/kube-linter-parser.sh
RUN chmod +x /opt/kube-linter-parser.sh

# Install KubeInvaders (html and js)
COPY html5/ /var/www/html
Expand Down Expand Up @@ -39,4 +71,6 @@ COPY ./entrypoint.sh /

RUN chmod a+rwx ./entrypoint.sh

RUN apt clean && rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/entrypoint.sh"]
11 changes: 5 additions & 6 deletions Dockerfile_full
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM nginx:stable

# Update repo and install some utilities and prerequisites
RUN apt-get update -y
RUN apt-get -y install git vim wget curl at gnupg procps
RUN apt-get -y install ca-certificates jq openssl task-spooler apt-transport-https python3 python3-pip redis libssl-dev
RUN apt-get -y install python3-yaml python3-kubernetes python3-redis python3-requests
RUN apt-get -y install wget at procps gnupg ca-certificates jq openssl task-spooler apt-transport-https python3 python3-pip redis libssl-dev python3-yaml python3-kubernetes python3-redis python3-requests

# Install kubectl
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
Expand All @@ -21,9 +19,8 @@ RUN chmod 777 /usr/local/openresty/nginx
# Install LUA Module
RUN apt-get -y install luarocks lua-json lua-socket libyaml-dev
RUN apt-get update --fix-missing
RUN luarocks install luasec
RUN luarocks install lunajson
RUN luarocks install lyaml

RUN for pkg in luasec lunajson lyaml; do luarocks install $pkg; done

# Install kube-linter
RUN curl -L -O https://github.com/stackrox/kube-linter/releases/download/0.6.0/kube-linter-linux.tar.gz
Expand Down Expand Up @@ -74,4 +71,6 @@ COPY ./entrypoint.sh /

RUN chmod a+rwx ./entrypoint.sh

RUN apt clean && rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/entrypoint.sh"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,15 @@ helm repo update

kubectl create namespace kubeinvaders

# With ingress and TLS enabled
helm install kubeinvaders --set-string config.target_namespace="namespace1\,namespace2" \
-n kubeinvaders kubeinvaders/kubeinvaders --set ingress.enabled=true --set ingress.hostName=kubeinvaders.io --set deployment.image.tag=latest

# With ingress enabled but TLS disabled (in case you have a reverse-proxy that does TLS termination and nginx controller in http)

helm install kubeinvaders --set-string config.target_namespace="namespace1\,namespace2" \
-n kubeinvaders kubeinvaders/kubeinvaders --set ingress.enabled=true --set ingress.tls_enabled=false --set ingress.hostName=kubeinvaders.io --set deployment.image.tag=latest

```

### Example for K3S
Expand Down
Binary file added helm-charts/kubeinvaders/kubeinvaders-1.9.7.tgz
Binary file not shown.
2 changes: 2 additions & 0 deletions helm-charts/kubeinvaders/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ metadata:
spec:
ingressClassName: {{ .Values.ingress.className }}
tls:
{{- if .Values.ingress.tls_enabled -}}
- hosts:
- {{ .Values.ingress.hostName | quote }}
secretName: {{ .Values.ingress.secretName }}
{{- end }}
rules:
- host: {{ .Values.ingress.hostName }}
http:
Expand Down
1 change: 1 addition & 0 deletions helm-charts/kubeinvaders/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ingress:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hostName: ""
tls: {}
tls_enabled: true

# Use route_host only if ingress is disabled - please specify also the port like route_host: "kubeinvaders.example.com:8080"
# The port must be the same of the NodePort service
Expand Down

0 comments on commit 7074222

Please sign in to comment.