Skip to content

Commit

Permalink
add secret to set mongo uri, delete preset from license.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Oct 18, 2023
1 parent 086a5a6 commit c28fad5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 186 deletions.
4 changes: 1 addition & 3 deletions controllers/license/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ WORKDIR /
USER 65532:65532

COPY bin/controller-licenseissuer-$TARGETARCH /manager
COPY bin/preset-$TARGETARCH /preset
COPY bin/launcher-$TARGETARCH /launcher

ENTRYPOINT ["/launcher"]
ENTRYPOINT ["/manager"]
4 changes: 1 addition & 3 deletions controllers/license/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ build: manifests generate fmt vet ## Build manager binary.
LD_FLAGS=""; \
[ -n "$(CRYPTOKEY)" ] && LD_FLAGS+="-X ${CONTROLLER_PKG}/crypto.encryptionKey=${CRYPTOKEY} -X ${CONTROLLER_PKG}/database.cryptoKey=${CRYPTOKEY}"; \
[ -n "$(LICENSE_KEY)" ] && LD_FLAGS+=" -X ${CONTROLLER_LICENSE}/util/key.EncryptionKey=${LICENSE_KEY}"; \
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -o bin/manager cmd/manager/main.go && \
CGO_ENABLED=0 GOOS=linux go build -o bin/preset-${GOARCH} cmd/preset/main.go && chmod +x bin/preset-${GOARCH} && \
CGO_ENABLED=0 GOOS=linux go build -o bin/launcher-${GOARCH} cmd/launcher/main.go && chmod +x bin/launcher-${GOARCH}
CGO_ENABLED=0 GOOS=linux go build -ldflags "$${LD_FLAGS}" -o bin/manager cmd/manager/main.go


.PHONY: run
Expand Down
35 changes: 0 additions & 35 deletions controllers/license/cmd/launcher/main.go

This file was deleted.

141 changes: 0 additions & 141 deletions controllers/license/cmd/preset/main.go

This file was deleted.

7 changes: 5 additions & 2 deletions controllers/license/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ spec:
- --leader-elect
image: controller:latest
env:
- name: MONOGOURI
value: ""
- name: MONGO_URI
valueFrom:
secretKeyRef:
name: license-secret
key: MONGO_URI
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down
7 changes: 5 additions & 2 deletions controllers/license/deploy/manifests/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ spec:
command:
- /manager
env:
- name: MONOGOURI
value: ""
- name: MONGO_URI
valueFrom:
secretKeyRef:
key: MONGO_URI
name: license-secret
image: ghcr.io/labring/sealos-license-controller:latest
livenessProbe:
httpGet:
Expand Down
7 changes: 7 additions & 0 deletions controllers/license/deploy/manifests/secret.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: license-secret
namespace: license-system
stringData:
MONGO_URI: "{{ .MONGO_URI }}"

0 comments on commit c28fad5

Please sign in to comment.