Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 committed Feb 2, 2023
1 parent 0e60316 commit 19bdc4e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: VPC CNI Release

on: [push, workflow_dispatch]
on:
release:
types: [published]

permissions:
contents: read
Expand All @@ -11,11 +13,12 @@ env:

jobs:
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout latest commit in the PR
uses: actions/checkout@v3
with:
ref: "refs/tags/{{ github.event.release.tag_name }}"
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
1 change: 0 additions & 1 deletion charts/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ WARNING: Substitute YOUR_HELM_RELEASE_NAME_HERE with the name of your helm relea
set -euo pipefail
# don't import the crd. Helm cant manage the lifecycle of it anyway.
for kind in daemonSet clusterRole clusterRoleBinding serviceAccount; do
echo "setting annotations and labels on $kind/aws-node"
kubectl -n kube-system annotate --overwrite $kind aws-node meta.helm.sh/release-name=YOUR_HELM_RELEASE_NAME_HERE
Expand Down
4 changes: 2 additions & 2 deletions charts/aws-vpc-cni/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ spec:
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
{{- if .Values.cniConfig.enabled }}
# the dockerfile copies the baked in config to this location, lets overwrite it with ours
# the entrypoint.sh script will then copy our config to /host/etc/cni/net.d on boot
# The dockerfile copies the baked in config to this location, so overwrite it with ours.
# The entrypoint process will then copy our config to /host/etc/cni/net.d on boot.
- name: cni-config
mountPath: /app/10-aws.conflist
subPath: 10-aws.conflist
Expand Down
36 changes: 16 additions & 20 deletions charts/cni-metrics-helper/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
apiVersion: v2
name: cni-metrics-helper
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.16

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
version: 0.1.17
appVersion: v1.12.2
description: A Helm chart for the AWS VPC CNI Metrics Helper
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
home: https://github.com/aws/amazon-vpc-cni-k8s
sources:
- https://github.com/aws/amazon-vpc-cni-k8s
keywords:
- eks
- cni
- networking
- vpc
maintainers:
- name: Jayanth Varavani
url: https://github.com/jayanthvn
email: jayanthvn@users.noreply.github.com
engine: gotpl
3 changes: 3 additions & 0 deletions charts/cni-metrics-helper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ image:
env:
USE_CLOUDWATCH: "true"
AWS_CLUSTER_ID: ""
AWS_VPC_K8S_CNI_LOGLEVEL: "INFO"

fullnameOverride: "cni-metrics-helper"

Expand All @@ -24,3 +25,5 @@ serviceAccount:
name:
annotations: {}
# eks.amazonaws.com/role-arn: arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME

resources: {}
6 changes: 3 additions & 3 deletions scripts/generate-cni-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
HELM_VERSION="3.6.3"
HELM_VERSION="3.11.0"
NAMESPACE="kube-system"

MAKEFILEPATH=$SCRIPTPATH/../Makefile
Expand Down Expand Up @@ -94,7 +94,7 @@ jq -c '.[]' $REGIONS_FILE | while read i; do
mv $BUILD_DIR/helm_annotations_removed.yaml $NEW_METRICS_RESOURCES_YAML
done

$BUILD_DIR/helm template --include-crds \
$BUILD_DIR/helm template aws-vpc-cni --include-crds \
--namespace $NAMESPACE \
--output-dir $INDV_RESOURCES_DIR/ \
$SCRIPTPATH/../charts/aws-vpc-cni/
Expand All @@ -104,7 +104,7 @@ for i in $INDV_RESOURCES_DIR/aws-vpc-cni/templates/*; do
mv $BUILD_DIR/helm_annotations_removed.yaml $i
done

$BUILD_DIR/helm template \
$BUILD_DIR/helm template cni-metrics-helper \
--namespace $NAMESPACE \
--output-dir $INDV_RESOURCES_DIR/ \
$SCRIPTPATH/../charts/cni-metrics-helper/
Expand Down
5 changes: 2 additions & 3 deletions scripts/sync-to-config-folder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -euo pipefail
set +x


SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
BUILD_DIR="${SCRIPTPATH}/../build"

Expand All @@ -17,7 +16,7 @@ BINARY_BASE=""
INCLUDE_NOTES=0
MANUAL_VERIFY=1

GH_CLI_VERSION="0.10.1"
GH_CLI_VERSION="2.22.1"
GH_CLI_CONFIG_PATH="${HOME}/.config/gh/config.yml"
KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]')
OS="${KERNEL}"
Expand Down Expand Up @@ -180,4 +179,4 @@ git push -u origin "${FORK_RELEASE_BRANCH}":$RELEASE_BRANCH
gh pr create --title "🥳 ${BINARY_BASE} ${VERSION} Automated manifest sync! 🥑" \
--body "${PR_BODY}" --repo ${REPO} --base ${RELEASE_BRANCH}

echo "✅ Manifest folder PR created for $RELEASE_BRANCH"
echo "✅ Manifest folder PR created f ${RELEASE_BRANCH}"
3 changes: 1 addition & 2 deletions scripts/sync-to-eks-charts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BINARY_BASE=""
INCLUDE_NOTES=0
MANUAL_VERIFY=1

GH_CLI_VERSION="0.10.1"
GH_CLI_VERSION="2.22.1"
GH_CLI_CONFIG_PATH="${HOME}/.config/gh/config.yml"
KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]')
OS="${KERNEL}"
Expand Down Expand Up @@ -123,7 +123,6 @@ cd "${FORK_DIR}"
git remote set-url origin https://"${GITHUB_USERNAME}":"${GITHUB_TOKEN}"@github.com/"${GITHUB_USERNAME}"/"${CHARTS_REPO_NAME}".git
DEFAULT_BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\n')


if diff -x ".*" -r "$HELM_CHART_DIR/" "${FORK_DIR}/stable/${HELM_CHART_NAME}/" &> /dev/null ; then
echo " ✅ Charts already in sync; no updates needed"
exit
Expand Down
1 change: 0 additions & 1 deletion scripts/upload-resources-to-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set -euo pipefail
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
VERSION=$(make -s -f $SCRIPTPATH/../Makefile version)
BUILD_DIR=$SCRIPTPATH/../build/cni-rel-yamls/$VERSION
BINARY_DIR=$SCRIPTPATH/../build/bin

CNI_TAR_RESOURCES_FILE=$BUILD_DIR/cni_individual-resources.tar
METRICS_TAR_RESOURCES_FILE=$BUILD_DIR/cni_metrics_individual-resources.tar
Expand Down

0 comments on commit 19bdc4e

Please sign in to comment.