Skip to content

Commit

Permalink
build(deploy): update laf cluster image to deploy laf in a sealos clu…
Browse files Browse the repository at this point in the history
…ster. (#1419)

* unset apisix hostnetwork and set minio sc.

* fix minio http schema

* add env to adapt laf deploy on sealos.
  • Loading branch information
lingdie authored Jul 26, 2023
1 parent 2ec2929 commit f490bc4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions build/Kubefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ COPY start.sh ./start.sh
ENV DOMAIN=127.0.0.1.nip.io
ENV NAMESPACE=laf-system
ENV REGION=default
ENV HTTP_SCHEMA=http
ENV EXTERNAL_HTTP_SCHEMA=https
ENV INTERNAL_HTTP_SCHEMA=http
ENV ENABLE_APISIX_HOST_NETWORK=true


ENV DB_PV_SIZE=10Gi
ENV OSS_PV_SIZE=20Gi

CMD ["DOMAIN=$(DOMAIN) REGION=$(REGION) NAMESPACE=$(NAMESPACE) HTTP_SCHEMA=$(HTTP_SCHEMA) DB_PV_SIZE=$(DB_PV_SIZE) OSS_PV_SIZE=$(OSS_PV_SIZE) sh start.sh"]
CMD ["DOMAIN=$(DOMAIN) REGION=$(REGION) NAMESPACE=$(NAMESPACE) EXTERNAL_HTTP_SCHEMA=$(EXTERNAL_HTTP_SCHEMA) INTERNAL_HTTP_SCHEMA=$(INTERNAL_HTTP_SCHEMA) ENABLE_APISIX_HOST_NETWORK=$(ENABLE_APISIX_HOST_NETWORK) DB_PV_SIZE=$(DB_PV_SIZE) OSS_PV_SIZE=$(OSS_PV_SIZE) sh start.sh"]
18 changes: 11 additions & 7 deletions build/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ fi
# *************** Environment Variables ************** #

## envs - global
HTTP_SCHEMA=${HTTP_SCHEMA:-http}
EXTERNAL_HTTP_SCHEMA=${EXTERNAL_HTTP_SCHEMA:-https}
INTERNAL_HTTP_SCHEMA=${INTERNAL_HTTP_SCHEMA:-http}

ENABLE_APISIX_HOST_NETWORK=${ENABLE_APISIX_HOST_NETWORK:-true}

NAMESPACE=${NAMESPACE:-laf-system}
PASSWD_OR_SECRET=$(tr -cd 'a-z0-9' </dev/urandom |head -c32)

Expand Down Expand Up @@ -38,7 +42,7 @@ APISIX_API_KEY=$PASSWD_OR_SECRET
helm install apisix -n ${NAMESPACE} \
--set apisix.kind=DaemonSet \
--set apisix.securityContext.runAsUser=0 \
--set apisix.hostNetwork=true \
--set apisix.hostNetwork="${ENABLE_APISIX_HOST_NETWORK}" \
--set admin.credentials.admin=${APISIX_API_KEY} \
--set etcd.enabled=true \
--set etcd.host[0]="http://apisix-etcd:2379" \
Expand All @@ -47,8 +51,8 @@ helm install apisix -n ${NAMESPACE} \
--set ingress-controller.config.apisix.adminKey="${APISIX_API_KEY}" \
--set ingress-controller.config.apisix.serviceNamespace=${NAMESPACE} \
--set gateway.http.containerPort=80 \
--set gateway.stream.enabled=true \
--set gateway.tls.enabled=true \
--set gateway.stream.enabled=true \
--set gateway.tls.enabled=true \
--set gateway.tls.containerPort=443 \
./charts/apisix

Expand All @@ -57,8 +61,8 @@ helm install apisix -n ${NAMESPACE} \
MINIO_ROOT_ACCESS_KEY=minio-root-user
MINIO_ROOT_SECRET_KEY=$PASSWD_OR_SECRET
MINIO_DOMAIN=oss.${DOMAIN}
MINIO_EXTERNAL_ENDPOINT="${HTTP_SCHEMA}://${MINIO_DOMAIN}"
MINIO_INTERNAL_ENDPOINT="${HTTP_SCHEMA}://minio.${NAMESPACE}.svc.cluster.local:9000"
MINIO_EXTERNAL_ENDPOINT="${EXTERNAL_HTTP_SCHEMA}://${MINIO_DOMAIN}"
MINIO_INTERNAL_ENDPOINT="${INTERNAL_HTTP_SCHEMA}://minio.${NAMESPACE}.svc.cluster.local:9000"

helm install minio -n ${NAMESPACE} \
--set rootUser=${MINIO_ROOT_ACCESS_KEY} \
Expand All @@ -79,7 +83,7 @@ helm install server -n ${NAMESPACE} \
--set meteringDatabaseUrl=${METERING_DATABASE_URL} \
--set jwt.secret=${SERVER_JWT_SECRET} \
--set apiServerHost=api.${DOMAIN} \
--set apiServerUrl=${HTTP_SCHEMA}://api.${DOMAIN} \
--set apiServerUrl=${EXTERNAL_HTTP_SCHEMA}://api.${DOMAIN} \
--set siteName=${DOMAIN} \
--set default_region.database_url=${DATABASE_URL} \
--set default_region.minio_domain=${MINIO_DOMAIN} \
Expand Down

0 comments on commit f490bc4

Please sign in to comment.