Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 2949cf0

Browse files
generate the manifests by calling the kubeadm
1 parent 6136cc8 commit 2949cf0

File tree

8 files changed

+592
-2
lines changed

8 files changed

+592
-2
lines changed

Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
4545
--mount=type=cache,target=/go/pkg/mod \
4646
--mount=type=cache,target=/root/.local/share/golang \
4747
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
48+
RUN curl -L https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubeadm -o kubeadm && chmod +x kubeadm
4849
ENTRYPOINT [ "/start.sh", "/workspace/manager" ]
4950

5051
# Use distroless as minimal base image to package the manager binary
5152
# Refer to https://github.com/GoogleContainerTools/distroless for more details
52-
FROM gcr.io/distroless/static:nonroot
53+
# FROM gcr.io/distroless/static:nonroot
54+
FROM ubuntu
5355
# Copy the controller-manager into a thin image
5456
WORKDIR /
5557
COPY --from=builder /workspace/manager .
5658
COPY controlplane/nested/component-templates/ ./component-templates/
57-
USER 65532:65532
59+
COPY --from=builder /workspace/kubeadm kubeadm
60+
# USER 65532:65532
5861
ENTRYPOINT ["/manager"]

config/rbac/role.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,14 @@ rules:
4848
- get
4949
- patch
5050
- update
51+
- apiGroups:
52+
- ""
53+
resources:
54+
- configmaps
55+
verbs:
56+
- get
57+
- patch
58+
- update
59+
- list
60+
- create
61+
- delete

controlplane/nested/controllers/consts.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ const (
2727
defaultKASStatefulSetURL = "/nested-apiserver/nested-apiserver-statefulset-template.yaml"
2828
defaultKASServiceURL = "/nested-apiserver/nested-apiserver-service-template.yaml"
2929
defaultKCMStatefulSetURL = "/nested-controllermanager/nested-controllermanager-statefulset-template.yaml"
30+
KASManifestConfigmapName = "nkas-manifest"
31+
KCMManifestConfigmapName = "nkcm-manifest"
32+
EtcdManifestConfigmapName = "netcd-manifest"
3033
)

0 commit comments

Comments
 (0)