-
Notifications
You must be signed in to change notification settings - Fork 260
ci: add azure ip masq merger to pipeline #3739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7672127
add ip masq merger to pipeline yaml
QxBytes 9f902bb
add azure ip masq merger to signed binaries (acn official build) pipe…
QxBytes 1f0741b
add script and changes to signed pipeline
QxBytes bd622aa
add README to azure ip masq merger
QxBytes 72cc8c6
modify dockerfile to be consistent with binary naming
QxBytes d9541a4
update dockerfiles
QxBytes 97759a5
remove unused dockerfile components
QxBytes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| ARG ARCH | ||
|
|
||
| FROM scratch AS linux | ||
| ARG ARTIFACT_DIR | ||
|
|
||
| COPY ${ARTIFACT_DIR}/bin/azure-ip-masq-merger /azure-ip-masq-merger | ||
| ENTRYPOINT ["/azure-ip-masq-merger"] |
This file contains hidden or 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 hidden or 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,18 @@ | ||
| #!/bin/bash | ||
| set -eux | ||
|
|
||
| [[ $OS =~ windows ]] && { echo "azure-ip-masq-merger is not supported on Windows"; exit 1; } | ||
| FILE_EXT='' | ||
|
|
||
| export CGO_ENABLED=0 | ||
|
|
||
| mkdir -p "$OUT_DIR"/bin | ||
| mkdir -p "$OUT_DIR"/files | ||
|
|
||
| pushd "$REPO_ROOT"/azure-ip-masq-merger | ||
| GOOS="$OS" go build -v -a -trimpath \ | ||
| -o "$OUT_DIR"/bin/azure-ip-masq-merger"$FILE_EXT" \ | ||
| -ldflags "-X github.com/Azure/azure-container-networking/azure-ip-masq-merger/internal/buildinfo.Version=$AZURE_IP_MASQ_MERGER_VERSION -X main.version=$AZURE_IP_MASQ_MERGER_VERSION" \ | ||
| -gcflags="-dwarflocationlists=true" \ | ||
| . | ||
| popd |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,69 @@ | ||
| # azure-ip-masq-merger | ||
|
|
||
| `azure-ip-masq-merger` is a utility for merging multiple ip-masq-agent configuration files into a single, valid configuration for use in Kubernetes clusters. | ||
|
|
||
| ## Description | ||
|
|
||
| The goal of this program is to periodically scan a directory for configuration fragments (YAML or JSON files starting with `ip-masq`), validate and merge them, and write the resulting configuration to a target directory for consumption. This allows us to combine non-masquerade CIDRs and related options between multiple files, for example if we had one ip masq config managed by the cloud provider and another supplied by the user. | ||
|
|
||
| ## Usage | ||
|
|
||
| Follow the steps below to build and run the program: | ||
|
|
||
| 1. Build the binary using `make`: | ||
| ```bash | ||
| make azure-ip-masq-merger | ||
| ``` | ||
| or make an image: | ||
| ```bash | ||
| make azure-ip-masq-merger-image | ||
| ``` | ||
|
|
||
| 2. Deploy or copy the binary to your node(s). | ||
|
|
||
| 3. Prepare your configuration fragments in the input directory (see below for defaults). Each file should be named with the prefix `ip-masq` and contain valid YAML or JSON for the ip-masq-agent config. | ||
|
|
||
| 4. Start the program with: | ||
| ```bash | ||
| ./azure-ip-masq-merger --input=/etc/config/ --output=/etc/merged-config/ | ||
| ``` | ||
| - The `--input` flag specifies the directory to scan for config fragments. Default: `/etc/config/` | ||
| - The `--output` flag specifies where to write the merged config. Default: `/etc/merged-config/` | ||
|
|
||
| 5. The merged configuration will be written to the output directory as `ip-masq-agent`. If no valid configs are found, any existing merged config will be removed. | ||
|
|
||
| ## Manual Testing | ||
|
|
||
| You can test the merger locally by creating sample config files in your input directory and running the merger. | ||
|
|
||
| ## Configuration File Format | ||
|
|
||
| Each config fragment should be a YAML or JSON file that may have the following fields: | ||
| ```yaml | ||
| nonMasqueradeCIDRs: | ||
| - 10.0.0.0/8 | ||
| - 192.168.0.0/16 | ||
| masqLinkLocal: true | ||
| masqLinkLocalIPv6: false | ||
| ``` | ||
| - `nonMasqueradeCIDRs`: List of CIDRs that should not be masqueraded. Appended between configs. | ||
| - `masqLinkLocal`: Boolean to enable/disable masquerading of link-local addresses. OR'd between configs. | ||
| - `masqLinkLocalIPv6`: Boolean to enable/disable masquerading of IPv6 link-local addresses. OR'd between configs. | ||
|
|
||
| ## Debugging | ||
|
|
||
| Logs are output to standard error. Increase verbosity with the `-v` flag: | ||
| ```bash | ||
| ./azure-ip-masq-merger -v 2 | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| To run tests: | ||
| ```bash | ||
| go test ./... | ||
| ``` | ||
| or at the repository level: | ||
| ```bash | ||
| make test-azure-ip-masq-merger | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.