Skip to content
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
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ get-operator-crds: var-require-all-OPERATOR_ORGANIZATION-OPERATOR_GIT_REPO-OPERA
@echo ==============================================================================================================
@echo === Pulling new operator CRDs from $(OPERATOR_ORGANIZATION)/$(OPERATOR_GIT_REPO) branch $(OPERATOR_BRANCH) ===
@echo ==============================================================================================================
cd ./charts/tigera-operator/crds/ && \
cd ./charts/crd.projectcalico.org.v1/templates/ && \
for file in operator.tigera.io_*.yaml; do \
echo "downloading $$file from operator repo"; \
curl -fsSL https://raw.githubusercontent.com/$(OPERATOR_ORGANIZATION)/$(OPERATOR_GIT_REPO)/$(OPERATOR_BRANCH)/pkg/crds/operator/$${file} -o $${file}; \
Expand Down Expand Up @@ -135,14 +135,23 @@ $(DEP_FILES): go.mod go.sum $(shell find . -name '*.go') Makefile hack/cmd/deps/
CHART_DESTINATION ?= ./bin

# Build helm charts.
chart: $(CHART_DESTINATION)/tigera-operator-$(GIT_VERSION).tgz
chart: $(CHART_DESTINATION)/tigera-operator-$(GIT_VERSION).tgz \
$(CHART_DESTINATION)/crd.projectcalico.org.v1-$(GIT_VERSION).tgz

$(CHART_DESTINATION)/tigera-operator-$(GIT_VERSION).tgz: bin/helm $(shell find ./charts/tigera-operator -type f)
mkdir -p $(CHART_DESTINATION)
bin/helm package ./charts/tigera-operator \
--destination $(CHART_DESTINATION)/ \
--version $(GIT_VERSION) \
--app-version $(GIT_VERSION)

$(CHART_DESTINATION)/crd.projectcalico.org.v1-$(GIT_VERSION).tgz: bin/helm $(shell find ./charts/crd.projectcalico.org.v1/ -type f)
mkdir -p $(CHART_DESTINATION)
bin/helm package ./charts/crd.projectcalico.org.v1/ \
--destination $(CHART_DESTINATION)/ \
--version $(GIT_VERSION) \
--app-version $(GIT_VERSION)

# Build all Calico images for the current architecture.
image:
$(MAKE) -C pod2daemon image IMAGETAG=$(GIT_VERSION) VALIDARCHES=$(ARCH)
Expand Down
12 changes: 12 additions & 0 deletions charts/crd.projectcalico.org.v1/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: crd.projectcalico.org.v1
Comment thread
caseydavenport marked this conversation as resolved.
description: Installs crd.projectcalico.org and operator.tigera.io Custom Resource Definitions (CRDs)
home: https://docs.tigera.io/calico
icon: https://docs.tigera.io/img/calico-logo.png
sources:
- https://github.com/projectcalico/calico/tree/master/charts/crd.projectcalico.org.v1
- https://github.com/tigera/operator
- https://github.com/projectcalico/calico

# version will be overridden at chart compilation time via args, but still must exist in chart.yaml
version: v0.0
6 changes: 6 additions & 0 deletions charts/crd.projectcalico.org.v1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Calico CRDs

This chart contains the following Calico Custom Resource Definitions (CRDs), required for the tigera-operator helm chart to function properly:

- crd.projectalico.org/v1 API group
- operator.tigera.io/v1 API group
Comment thread
caseydavenport marked this conversation as resolved.
File renamed without changes.
Empty file.
5 changes: 3 additions & 2 deletions lib.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ ifeq ($(GIT_USE_SSH),true)
endif

# Get version from git. We allow setting this manually for the hashrelease process.
# By default, includes commit count and hash (--long). During releases (RELEASE=true),
# By default, includes commit count and hash (--long). During releases (RELEASE=true),
# only the tag is used without the commit count suffix.
GIT_VERSION ?= $(shell git describe --tags --dirty --always --abbrev=12 --long)
ifeq ($(RELEASE),true)
Expand Down Expand Up @@ -1386,7 +1386,8 @@ $(REPO_ROOT)/.$(KIND_NAME).created: $(KUBECTL) $(KIND)

# Wait for controller manager to be running and healthy, then create Calico CRDs.
while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) get serviceaccount default; do echo "Waiting for default serviceaccount to be created..."; sleep 2; done
while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create -f $(REPO_ROOT)/libcalico-go/config/crd; do echo "Waiting for CRDs to be created"; sleep 2; done
while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create -f $(REPO_ROOT)/charts/crd.projectcalico.org.v1/templates/; do echo "Waiting for operator CRDs to be created"; sleep 2; done
while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create -f $(REPO_ROOT)/charts/crd.projectcalico.org.v1/templates/calico/; do echo "Waiting for calico CRDs to be created"; sleep 2; done
touch $@

kind-cluster-destroy: $(KIND) $(KUBECTL)
Expand Down
43 changes: 20 additions & 23 deletions manifests/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,38 +75,35 @@ for FILE in $(ls ../charts/calico/crds); do
${HELM} template ../charts/calico \
--include-crds \
--show-only $FILE \
--set version=$CALICO_VERSION \
--set node.registry=$REGISTRY \
--set calicoctl.registry=$REGISTRY \
--set typha.registry=$REGISTRY \
--set cni.registry=$REGISTRY \
--set kubeControllers.registry=$REGISTRY \
--set flannelMigration.registry=$REGISTRY \
--set dikastes.registry=$REGISTRY \
--set csi-driver.registry=$REGISTRY \
--set version=$CALICO_VERSION \
--set node.registry=$REGISTRY \
--set calicoctl.registry=$REGISTRY \
--set typha.registry=$REGISTRY \
--set cni.registry=$REGISTRY \
--set kubeControllers.registry=$REGISTRY \
--set flannelMigration.registry=$REGISTRY \
--set dikastes.registry=$REGISTRY \
--set csi-driver.registry=$REGISTRY \
-f ../charts/values/calico.yaml >> crds.yaml
done

##########################################################################
# Build manifest which includes both Calico and Operator CRDs.
##########################################################################
echo "# CustomResourceDefinitions for Calico and Tigera operator" > operator-crds.yaml
for FILE in $(ls ../charts/tigera-operator/crds/*.yaml | xargs -n1 basename); do
${HELM} -n tigera-operator template \
--include-crds \
--show-only $FILE \
--set version=$CALICO_VERSION \
../charts/tigera-operator >> operator-crds.yaml
for FILE in $(ls ../charts/crd.projectcalico.org.v1/templates/*.yaml | xargs -n1 basename); do
${HELM} template \
--show-only templates/$FILE \
--set version=$CALICO_VERSION \
../charts/crd.projectcalico.org.v1 >> operator-crds.yaml
done
for FILE in $(ls ../charts/calico/crds); do
${HELM} template ../charts/calico \
--include-crds \
--show-only $FILE \
--set version=$CALICO_VERSION \
-f ../charts/values/calico.yaml >> operator-crds.yaml
for FILE in $(ls ../charts/crd.projectcalico.org.v1/templates/calico/*.yaml | xargs -n1 basename); do
${HELM} template \
--show-only templates/calico/$FILE \
--set version=$CALICO_VERSION \
../charts/crd.projectcalico.org.v1 >> operator-crds.yaml
done


##########################################################################
# Build Calico manifests.
#
Expand All @@ -119,7 +116,7 @@ for FILE in $VALUES_FILES; do
echo "Generating manifest from charts/values/$FILE"
${HELM} -n kube-system template \
../charts/calico \
--set version=$CALICO_VERSION \
--set version=$CALICO_VERSION \
-f ../charts/values/$FILE > $FILE
done

Expand Down
Loading