Compare commits

..

3 Commits

Author SHA1 Message Date
niusmallnan
72df772c20 Bump steve and dashboard for Rancher v2.6.11 2023-03-20 11:02:41 +08:00
niusmallnan
585cf9c8a6 Use --scanners instead of --security-checks 2023-03-20 11:02:12 +08:00
niusmallnan
f448fc1de0 Bump upx 4.0.2 2023-03-20 10:59:27 +08:00
14 changed files with 31 additions and 114 deletions

View File

@@ -1,23 +1,28 @@
FROM registry.suse.com/bci/golang:1.19
FROM golang:1.19
ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
RUN zypper -n install ca-certificates git-core wget curl unzip tar vim less file xz
RUN zypper install -y -f docker
ENV UPX_VERSION 4.0.2
RUN curl -sL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${ARCH}_linux.tar.xz | tar xvJf - --strip-components=1 -C /tmp && \
RUN apt-get update && \
apt-get install -y ca-certificates git wget curl xz-utils && \
rm -f /bin/sh && ln -s /bin/bash /bin/sh && \
curl -sL https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-${ARCH}_linux.tar.xz | tar xvJf - --strip-components=1 -C /tmp && \
mv /tmp/upx /usr/bin/
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.49.0; \
fi
ENV GIT_COMMIT="5d9667043a7b0b1541743dad47949df489b8ad04" \
GIT_BRANCH="ke/v0.3" \
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \
DOCKER_URL=DOCKER_URL_${ARCH}
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
ENV GIT_COMMIT="3eb3cd09ee51c80f56f3f4fc8674d985b6e2f4e0" \
GIT_BRANCH="ke/v0.2" \
GIT_SOURCE=${GOPATH}/src/github.com/rancher/steve \
CATTLE_DASHBOARD_UI_VERSION="v2.7.5-kube-explorer-ui-rc7"
CATTLE_DASHBOARD_UI_VERSION="v2.6.11-kube-explorer-ui-rc1"
ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS
ENV DAPPER_SOURCE /opt/kube-explorer

View File

View File

@@ -1,12 +0,0 @@
## Access Control Via Basic Auth
Deploy the kube-explorer workload:
```
kubectl create -f .
```
Configure for different IngressClass:
- [Nginx Ingress](./nginx-auth)
- [Traefik Ingress](./traefik-v2-auth)

View File

@@ -13,9 +13,9 @@ htpasswd -nb username password | base64
To install this mode, just run this script:
```
kubectl create -f ./secret.yaml
export MY_IP=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl create -f -
kubectl apply -f ./secret.yaml
export MY_XIP_IO=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl apply -f -
```
For more infos: https://kubernetes.github.io/ingress-nginx/examples/auth/basic/

View File

@@ -1,8 +1,8 @@
# Note: please replace the host first
# To use sslip.io: https://sslip.io/
# To use xip.io: http://xip.io/
# To get your public IP: curl ipinfo.io/ip
apiVersion: networking.k8s.io/v1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: kube-explorer
@@ -10,18 +10,16 @@ metadata:
labels:
app: kube-explorer
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: kube-explorer
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - kube-explorer'
spec:
rules:
- host: "${MY_IP}.sslip.io"
- host: "${MY_XIP_IO}.xip.io"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kube-explorer
port:
number: 8989
serviceName: kube-explorer
servicePort: 8989

View File

@@ -13,9 +13,9 @@ htpasswd -nb username password | base64
To install this mode, just run this script:
```
kubectl create -f ./secret.yaml
export MY_IP=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl create -f -
kubectl apply -f ./secret.yaml
export MY_XIP_IO=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl apply -f -
```
For more infos: https://doc.traefik.io/traefik/v1.7/configuration/backends/kubernetes/

View File

@@ -1,5 +1,5 @@
# Note: please replace the host first
# To use sslip.io: https://sslip.io/
# To use xip.io: http://xip.io/
# To get your public IP: curl ipinfo.io/ip
apiVersion: networking.k8s.io/v1beta1
@@ -16,7 +16,7 @@ metadata:
ingress.kubernetes.io/auth-remove-header: "true"
spec:
rules:
- host: "${MY_IP}.sslip.io"
- host: "${MY_XIP_IO}.xip.io"
http:
paths:
- path: /

View File

@@ -1,21 +0,0 @@
## Traefik Auth
This can be used in K3s, as K3s use traefik as the default ingress class.
We use `basic-auth` to control the access of kube-explorer. The auth token is stored in the secret.
The default user is `niusmallnan`, and password is `dagedddd`. You can replace to another value with `htpasswd` tool.
```
htpasswd -nb username password | base64
```
To install this mode, just run this script:
```
kubectl create -f ./middleware.yaml
export MY_IP=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl create -f -
```
For more infos: https://doc.traefik.io/traefik/middlewares/http/basicauth/

View File

@@ -1,25 +0,0 @@
# Note: please replace the host first
# To use sslip.io.io: https://sslip.io.io/
# To get your public IP: curl ipinfo.io/ip
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kube-explorer
namespace: kube-system
labels:
app: kube-explorer
annotations:
traefik.ingress.kubernetes.io/router.middlewares: kube-system-kube-explorer@kubernetescrd
spec:
rules:
- host: "${MY_IP}.sslip.io"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kube-explorer
port:
number: 8989

View File

@@ -1,28 +0,0 @@
# The definitions below require the definitions for the Middleware and IngressRoute kinds.
# https://doc.traefik.io/traefik/reference/dynamic-configuration/kubernetes-crd/#definitions
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: kube-explorer
namespace: kube-system
labels:
app: kube-explorer
spec:
basicAuth:
secret: kube-explorer
removeHeader: true
---
# To create an encoded user:password pair, the following command can be used:
# htpasswd -nb user password | base64
apiVersion: v1
kind: Secret
metadata:
name: kube-explorer
namespace: kube-system
labels:
app: kube-explorer
data:
auth: bml1c21hbGxuYW46JGFwcjEkbDdUZjJOdWskbmNXajYubHYvMGNkcXM0NFoyelVQLgoK
type: Opaque

View File

@@ -1,4 +1,4 @@
FROM registry.suse.com/bci/bci-minimal:15.5
FROM registry.suse.com/bci/bci-minimal:15.4
COPY kube-explorer entrypoint.sh /usr/bin/
ENTRYPOINT ["entrypoint.sh"]

View File

@@ -40,7 +40,7 @@ else
fi
for f in $(ls ./bin/); do
if [[ $f != *darwin* ]]; then
if [[ $f != *darwin-arm64 ]]; then
upx -o $DAPPER_SOURCE/bin/$f bin/$f || true
fi
if [ -f $DAPPER_SOURCE/bin/$f ]; then

View File

@@ -10,7 +10,7 @@ git reset --hard ${GIT_COMMIT}
mkdir -p pkg/ui/ui/dashboard
cd pkg/ui/ui/dashboard
curl -sL https://pandaria-dashboard-ui.s3.ap-southeast-2.amazonaws.com/release-2.7-cn/kube-explorer-ui/${CATTLE_DASHBOARD_UI_VERSION}.tar.gz | tar xvzf - --strip-components=2
curl -sL https://pandaria-dashboard-ui.s3.ap-southeast-2.amazonaws.com/release-2.6-cn/kube-explorer-ui/${CATTLE_DASHBOARD_UI_VERSION}.tar.gz | tar xvzf - --strip-components=2
cp index.html ../index.html
popd