Skip to content

Commit

Permalink
fix kindnetd manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxesn committed Jul 26, 2023
1 parent d39fd6d commit 811c726
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 5 deletions.
2 changes: 1 addition & 1 deletion EKS_DISTRO_MINIMAL_BASE_KIND_AL2023_TAG_FILE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-06-13-1686682900.2023
2023-06-27-1687892492.2023
6 changes: 2 additions & 4 deletions projects/kubernetes-sigs/kind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ $(KIND_NODE_BUILD_AMD64_TARGET): KIND_CLI=./$(OUTPUT_BIN_DIR)/$(subst /,-,$(BUIL
$(KIND_NODE_BUILD_AMD64_TARGET): $(KIND_NODE_IMAGE_BUILD_ARGS) $(ORGANIZE_BINARIES_AMD64_TARGET)
$(MAKE) $(KIND_CLI) BINARY_PLATFORMS=$(BUILDER_PLATFORM)
build/build-kind-node-image.sh $(RELEASE_BRANCH) $(VERSIONED_BASE_IMAGE) amd64
@mkdir -p $(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)
cp $(BINARY_DEPS_DIR)/linux-amd64/files/rootfs/kind/manifests/default-cni.yaml $(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)/kindnetd.yaml
sed -i -e 's/{{ .PodSubnet }}/192.168.0.0\/16/' $(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)/kindnetd.yaml

$(KIND_NODE_BUILD_ARM64_TARGET): $(KIND_NODE_IMAGE_BUILD_ARGS) $(ORGANIZE_BINARIES_ARM64_TARGET)
build/build-kind-node-image.sh $(RELEASE_BRANCH) $(VERSIONED_BASE_IMAGE) arm64
Expand All @@ -172,7 +169,8 @@ $(ARM_ENV_CONF_TARGET):

$(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)/kindnetd.yaml:
@mkdir -p $(@D)
@touch $@
cp manifests/kindnetd.yaml $(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)/kindnetd.yaml
sed -i -e 's/{{ .PodSubnet }}/192.168.0.0\/16/' $(ARTIFACTS_PATH)/manifests/kindnetd/$(GIT_TAG)/kindnetd.yaml

$(FIX_LICENSES_KINDNETD_TARGET): | $(GO_MOD_DOWNLOAD_TARGETS)
#go-licenses requires a LICENSE file in each folder with the go.mod
Expand Down
2 changes: 2 additions & 0 deletions projects/kubernetes-sigs/kind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ any build flag changes, tag changes, dependencies, etc in the `Makefile` in the
If new yum packages are added to the base image, update the [minimal-base-kind](https://github.com/aws/eks-distro-build-tooling/blob/main/eks-distro-base/Dockerfile.minimal-base-kind)
image to include it (this is not a blocker for updating). Review changes to [buildcontext.go](https://github.com/kubernetes-sigs/kind/blob/main/pkg/build/nodeimage/buildcontext.go)
closely to ensure there are no changes neccessary in our build scripts.
1. Update the `manifests/kindnet.yaml` file to match [upstream](https://github.com/kubernetes-sigs/kind/blob/main/pkg/build/nodeimage/const_cni.go#L28). The kindnetd image tag should match
our new kind GIT_TAG.
1. Verify the golang version has not changed. The version specified in `.go-version` should be the source of truth.
1. Update checksums and attribution using `make run-attribution-checksums-in-docker` from the root of the repo.
1. Validate images build locally (will take a while) using the steps above.
Expand Down
117 changes: 117 additions & 0 deletions projects/kubernetes-sigs/kind/manifests/kindnetd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

# kindnetd networking manifest
# would you kindly template this file
# would you kindly patch this file
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kindnet
rules:
- apiGroups:
- policy
resources:
- podsecuritypolicies
verbs:
- use
resourceNames:
- kindnet
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kindnet
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kindnet
subjects:
- kind: ServiceAccount
name: kindnet
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kindnet
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kindnet
namespace: kube-system
labels:
tier: node
app: kindnet
k8s-app: kindnet
spec:
selector:
matchLabels:
app: kindnet
template:
metadata:
labels:
tier: node
app: kindnet
k8s-app: kindnet
spec:
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
tolerations:
- operator: Exists
serviceAccountName: kindnet
containers:
- name: kindnet-cni
image: public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/kindnetd:v0.18.0
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_SUBNET
value: {{ .PodSubnet }}
volumeMounts:
- name: cni-cfg
mountPath: /etc/cni/net.d
- name: xtables-lock
mountPath: /run/xtables.lock
readOnly: false
- name: lib-modules
mountPath: /lib/modules
readOnly: true
resources:
requests:
cpu: "100m"
memory: "50Mi"
limits:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: false
capabilities:
add: ["NET_RAW", "NET_ADMIN"]
volumes:
- name: cni-cfg
hostPath:
path: /etc/cni/net.d
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
- name: lib-modules
hostPath:
path: /lib/modules
---

0 comments on commit 811c726

Please sign in to comment.