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

✨ Generate the manifests by calling the kubeadm #216

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.local/share/golang \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
RUN curl -L https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubeadm -o kubeadm && chmod +x kubeadm
ENTRYPOINT [ "/start.sh", "/workspace/manager" ]

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM gcr.io/distroless/static-debian10
# Copy the controller-manager into a thin image
WORKDIR /
COPY --from=builder /workspace/manager .
COPY controlplane/nested/component-templates/ ./component-templates/
USER 65532:65532
COPY --from=builder /workspace/kubeadm kubeadm
# USER 65532:65532
ENTRYPOINT ["/manager"]
3 changes: 2 additions & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ commonLabels:
# capi system can cross reference the proper controlplane & infra refs
# https://cluster-api.sigs.k8s.io/developer/providers/v1alpha2-to-v1alpha3.html#apply-the-contract-version-label-clusterx-k8sioversion-version1_version2_version3-to-your-crds
cluster.x-k8s.io/v1alpha3: v1alpha4
cluster.x-k8s.io/v1alpha4: v1alpha4
cluster.x-k8s.io/v1alpha4: v1alpha4
cluster.x-k8s.io/v1beta1: v1alpha4
11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,14 @@ rules:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- patch
- update
- list
- create
- delete
2 changes: 2 additions & 0 deletions config/samples/infrastructure_v1alpha4_nestedcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: NestedCluster
metadata:
name: nestedcluster-sample
labels:
cluster.x-k8s.io/v1beta1: v1alpha4_v1beta1
spec:
controlPlaneEndpoint:
host: "localhost"
Expand Down
2 changes: 1 addition & 1 deletion config/samples/v1alpha4_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ spec:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: NestedCluster
name: nestedcluster-sample
namespace: default
namespace: default

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading