-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #836 from rambohe-ch/support-mac-env
[enhancemnt] support local up openyurt on mac machine
- Loading branch information
Showing
41 changed files
with
1,128 additions
and
751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,8 +131,9 @@ jobs: | |
run: | | ||
go get sigs.k8s.io/[email protected] | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.20.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl | ||
- name: Build Images | ||
run: make docker-build | ||
- name: Local Up Openyurt Cluster With Kind | ||
run: bash hack/local_up_openyurt.sh | ||
|
||
run: make local-up-openyurt | ||
- name: Run e2e Tests | ||
run: make e2e-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
Copyright 2022 The OpenYurt Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package config | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/spf13/pflag" | ||
"k8s.io/klog/v2" | ||
|
||
"github.com/openyurtio/openyurt/pkg/node-servant/config" | ||
"github.com/openyurtio/openyurt/pkg/projectinfo" | ||
) | ||
|
||
// NewConfigCmd generates a new config command | ||
func NewConfigCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "config", | ||
Short: "manage configuration of OpenYurt cluster", | ||
RunE: cobra.OnlyValidArgs, | ||
ValidArgs: []string{"control-plane"}, | ||
Args: cobra.MaximumNArgs(1), | ||
} | ||
cmd.AddCommand(newCmdConfigControlPlane()) | ||
|
||
return cmd | ||
} | ||
|
||
func newCmdConfigControlPlane() *cobra.Command { | ||
o := config.NewControlPlaneOptions() | ||
cmd := &cobra.Command{ | ||
Use: "control-plane", | ||
Short: "configure control-plane components like kube-apiserver and kube-controller-manager", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
fmt.Printf("node-servant version: %#v\n", projectinfo.Get()) | ||
if o.Version { | ||
return nil | ||
} | ||
|
||
cmd.Flags().VisitAll(func(flag *pflag.Flag) { | ||
klog.Infof("FLAG: --%s=%q", flag.Name, flag.Value) | ||
}) | ||
|
||
if err := o.Validate(); err != nil { | ||
klog.Fatalf("validate options: %v", err) | ||
} | ||
|
||
runner, err := config.NewControlPlaneRunner(o) | ||
if err != nil { | ||
return err | ||
} | ||
if err := runner.Do(); err != nil { | ||
return fmt.Errorf("failed to config control-plane, %v", err) | ||
} | ||
|
||
klog.Info("node-servant config control-plane success") | ||
return nil | ||
}, | ||
Args: cobra.NoArgs, | ||
} | ||
o.AddFlags(cmd.Flags()) | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# multi-arch image building for yurt-controller-manager | ||
|
||
FROM --platform=${BUILDPLATFORM} golang:1.17.1 as builder | ||
ADD . /build | ||
ARG TARGETOS TARGETARCH GIT_VERSION GOPROXY MIRROR_REPO | ||
WORKDIR /build/ | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GIT_VERSION=${GIT_VERSION} make build WHAT=cmd/yurt-controller-manager | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:3.14 | ||
ARG TARGETOS TARGETARCH MIRROR_REPO | ||
RUN if [ ! -z "${MIRROR_REPO+x}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${MIRROR_REPO}/g" /etc/apk/repositories; fi && \ | ||
apk add ca-certificates bash libc6-compat && update-ca-certificates && rm /var/cache/apk/* | ||
COPY --from=builder /build/_output/local/bin/${TARGETOS}/${TARGETARCH}/yurt-controller-manager /usr/local/bin/yurt-controller-manager | ||
ENTRYPOINT ["/usr/local/bin/yurt-controller-manager"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# multi-arch image building for yurt-node-servant | ||
|
||
FROM --platform=${BUILDPLATFORM} golang:1.17.1 as builder | ||
ADD . /build | ||
ARG TARGETOS TARGETARCH GIT_VERSION GOPROXY MIRROR_REPO | ||
WORKDIR /build/ | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GIT_VERSION=${GIT_VERSION} make build WHAT=cmd/yurt-node-servant | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:3.14 | ||
ARG TARGETOS TARGETARCH MIRROR_REPO | ||
RUN if [ ! -z "${MIRROR_REPO+x}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${MIRROR_REPO}/g" /etc/apk/repositories; fi && \ | ||
apk add ca-certificates bash libc6-compat && update-ca-certificates && rm /var/cache/apk/* | ||
COPY --from=builder /build/_output/local/bin/${TARGETOS}/${TARGETARCH}/yurt-node-servant /usr/local/bin/node-servant | ||
COPY hack/lib/node-servant-entry.sh /usr/local/bin/entry.sh | ||
RUN chmod +x /usr/local/bin/entry.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# multi-arch image building for yurt-tunnel-agent | ||
|
||
FROM --platform=${BUILDPLATFORM} golang:1.17.1 as builder | ||
ADD . /build | ||
ARG TARGETOS TARGETARCH GIT_VERSION GOPROXY MIRROR_REPO | ||
WORKDIR /build/ | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GIT_VERSION=${GIT_VERSION} make build WHAT=cmd/yurt-tunnel-agent | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:3.14 | ||
ARG TARGETOS TARGETARCH MIRROR_REPO | ||
RUN if [ ! -z "${MIRROR_REPO+x}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${MIRROR_REPO}/g" /etc/apk/repositories; fi && \ | ||
apk add ca-certificates bash libc6-compat && update-ca-certificates && rm /var/cache/apk/* | ||
COPY --from=builder /build/_output/local/bin/${TARGETOS}/${TARGETARCH}/yurt-tunnel-agent /usr/local/bin/yurt-tunnel-agent | ||
ENTRYPOINT ["/usr/local/bin/yurt-tunnel-agent"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# multi-arch image building for yurt-tunnel-server | ||
|
||
FROM --platform=${BUILDPLATFORM} golang:1.17.1 as builder | ||
ADD . /build | ||
ARG TARGETOS TARGETARCH GIT_VERSION GOPROXY MIRROR_REPO | ||
WORKDIR /build/ | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GIT_VERSION=${GIT_VERSION} make build WHAT=cmd/yurt-tunnel-server | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:3.14 | ||
ARG TARGETOS TARGETARCH MIRROR_REPO | ||
RUN if [ ! -z "${MIRROR_REPO+x}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${MIRROR_REPO}/g" /etc/apk/repositories; fi && \ | ||
apk add ca-certificates bash libc6-compat iptables ip6tables && update-ca-certificates && rm /var/cache/apk/* | ||
COPY --from=builder /build/_output/local/bin/${TARGETOS}/${TARGETARCH}/yurt-tunnel-server /usr/local/bin/yurt-tunnel-server | ||
ENTRYPOINT ["/usr/local/bin/yurt-tunnel-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# multi-arch image building for yurthub | ||
|
||
FROM --platform=${BUILDPLATFORM} golang:1.17.1 as builder | ||
ADD . /build | ||
ARG TARGETOS TARGETARCH GIT_VERSION GOPROXY MIRROR_REPO | ||
WORKDIR /build/ | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GIT_VERSION=${GIT_VERSION} make build WHAT=cmd/yurthub | ||
|
||
FROM --platform=${TARGETPLATFORM} alpine:3.14 | ||
ARG TARGETOS TARGETARCH MIRROR_REPO | ||
RUN if [ ! -z "${MIRROR_REPO+x}" ]; then sed -i "s/dl-cdn.alpinelinux.org/${MIRROR_REPO}/g" /etc/apk/repositories; fi && \ | ||
apk add ca-certificates bash libc6-compat iptables ip6tables && update-ca-certificates && rm /var/cache/apk/* | ||
COPY --from=builder /build/_output/local/bin/${TARGETOS}/${TARGETARCH}/yurthub /usr/local/bin/yurthub | ||
ENTRYPOINT ["/usr/local/bin/yurthub"] |
Oops, something went wrong.