Skip to content

Commit

Permalink
Merge branch 'master' of github.com:krishgobinath/libcalico-go
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobinath Krishnamoorthy committed Jun 4, 2020
2 parents 1e36df8 + a3232d9 commit b33ec26
Show file tree
Hide file tree
Showing 107 changed files with 6,232 additions and 738 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ checkouts
/report/*.xml
/release
Makefile.common*
*.test
41 changes: 23 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=github.com/projectcalico/libcalico-go
GO_BUILD_VER=v0.28
GO_BUILD_VER=v0.40

# libcalico-go still relies on vendoring
GOMOD_VENDOR = true
Expand All @@ -24,8 +24,7 @@ include Makefile.common

###############################################################################

K8S_VERSION ?= v1.16.0
BINDIR ?= bin
BINDIR?=bin

# Create a list of files upon which the generated file depends, skip the generated file itself
UPGRADE_SRCS := $(filter-out ./lib/upgrade/migrator/clients/v1/k8s/custom/zz_generated.deepcopy.go, \
Expand Down Expand Up @@ -54,10 +53,22 @@ GENERATED_FILES:=./lib/apis/v3/zz_generated.deepcopy.go \

.PHONY: gen-files
## Force rebuild generated go utilities (e.g. deepcopy-gen) and generated files
gen-files:
gen-files: gen-crds
rm -rf $(GENERATED_FILES)
$(MAKE) $(GENERATED_FILES)

## Force a rebuild of custom resource definition yamls
gen-crds: bin/controller-gen
@./bin/controller-gen crd:crdVersions=v1 paths=./lib/apis/... output:crd:dir=config/crd/
@rm config/crd/_.yaml

# Used for generating CRD files.
bin/controller-gen:
# Download a version of controller-gen that has been hacked to support additional types (e.g., float).
# We can remove this once we update the Calico v3 APIs to use only types which are supported by the upstream controller-gen
# tooling. Some examples: float, all the types in the numorstring package, etc.
wget -O $@ https://github.com/caseydavenport/controller-tools/releases/download/float-support/controller-gen && chmod +x $@

$(BINDIR)/deepcopy-gen: vendor
$(DOCKER_GO_BUILD) sh -c 'go build -o $@ $(PACKAGE_NAME)/vendor/k8s.io/code-generator/cmd/deepcopy-gen'

Expand Down Expand Up @@ -159,8 +170,7 @@ run-kubernetes-master: stop-kubernetes-master
docker run \
--net=host --name st-apiserver \
--detach \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
/hyperkube kube-apiserver \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} kube-apiserver \
--bind-address=0.0.0.0 \
--insecure-bind-address=0.0.0.0 \
--etcd-servers=http://127.0.0.1:2379 \
Expand All @@ -176,32 +186,28 @@ run-kubernetes-master: stop-kubernetes-master
docker run \
--net=host --name st-controller-manager \
--detach \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
/hyperkube kube-controller-manager \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} kube-controller-manager \
--master=127.0.0.1:8080 \
--min-resync-period=3m \
--allocate-node-cidrs=true \
--cluster-cidr=10.10.0.0/16 \
--v=5

# Create CustomResourceDefinition (CRD) for Calico resources
# from the manifest crds.yaml
docker run \
# Create CustomResourceDefinition (CRD) for Calico resources.
while ! docker run \
--net=host \
--rm \
-v $(CURDIR):/manifests \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
/hyperkube kubectl \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} kubectl \
--server=http://127.0.0.1:8080 \
apply -f /manifests/test/crds.yaml
apply -f /manifests/config/crd; do echo "Waiting for CRDs to apply..."; sleep 2; done

# Create a Node in the API for the tests to use.
docker run \
--net=host \
--rm \
-v $(CURDIR):/manifests \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
/hyperkube kubectl \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} kubectl \
--server=http://127.0.0.1:8080 \
apply -f /manifests/test/mock-node.yaml

Expand All @@ -211,8 +217,7 @@ run-kubernetes-master: stop-kubernetes-master
--net=host \
--rm \
-v $(CURDIR):/manifests \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
/hyperkube kubectl \
gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} kubectl \
--server=http://localhost:8080 \
apply -f /manifests/test/namespaces.yaml

Expand Down
85 changes: 85 additions & 0 deletions config/crd/crd.projectcalico.org_bgpconfigurations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: bgpconfigurations.crd.projectcalico.org
spec:
group: crd.projectcalico.org
names:
kind: BGPConfiguration
listKind: BGPConfigurationList
plural: bgpconfigurations
singular: bgpconfiguration
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: BGPConfiguration contains the configuration for any BGP routing.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BGPConfigurationSpec contains the values of the BGP configuration.
properties:
asNumber:
description: 'ASNumber is the default AS number used by a node. [Default:
64512]'
format: int32
type: integer
logSeverityScreen:
description: 'LogSeverityScreen is the log severity above which logs
are sent to the stdout. [Default: INFO]'
type: string
nodeToNodeMeshEnabled:
description: 'NodeToNodeMeshEnabled sets whether full node to node
BGP mesh is enabled. [Default: true]'
type: boolean
serviceClusterIPs:
description: ServiceClusterIPs are the CIDR blocks from which service
cluster IPs are allocated. If specified, Calico will advertise these
blocks, as well as any cluster IPs within them.
items:
description: ServiceClusterIPBlock represents a single whitelisted
CIDR block for ClusterIPs.
properties:
cidr:
type: string
type: object
type: array
serviceExternalIPs:
description: ServiceExternalIPs are the CIDR blocks for Kubernetes
Service External IPs. Kubernetes Service ExternalIPs will only be
advertised if they are within one of these blocks.
items:
description: ServiceExternalIPBlock represents a single whitelisted
CIDR External IP block.
properties:
cidr:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
75 changes: 75 additions & 0 deletions config/crd/crd.projectcalico.org_bgppeers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: bgppeers.crd.projectcalico.org
spec:
group: crd.projectcalico.org
names:
kind: BGPPeer
listKind: BGPPeerList
plural: bgppeers
singular: bgppeer
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BGPPeerSpec contains the specification for a BGPPeer resource.
properties:
asNumber:
description: The AS Number of the peer.
format: int32
type: integer
node:
description: The node name identifying the Calico node instance that
is peering with this peer. If this is not set, this represents a
global peer, i.e. a peer that peers with every node in the deployment.
type: string
nodeSelector:
description: Selector for the nodes that should have this peering. When
this is set, the Node field must be empty.
type: string
peerIP:
description: The IP address of the peer.
type: string
peerSelector:
description: Selector for the remote nodes to peer with. When this
is set, the PeerIP and ASNumber fields must be empty. For each
peering between the local node and selected remote nodes, we configure
an IPv4 peering if both ends have NodeBGPSpec.IPv4Address specified,
and an IPv6 peering if both ends have NodeBGPSpec.IPv6Address specified. The
remote AS number comes from the remote node’s NodeBGPSpec.ASNumber,
or the global default if that is not set.
type: string
required:
- asNumber
- peerIP
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
64 changes: 64 additions & 0 deletions config/crd/crd.projectcalico.org_blockaffinities.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: blockaffinities.crd.projectcalico.org
spec:
group: crd.projectcalico.org
names:
kind: BlockAffinity
listKind: BlockAffinityList
plural: blockaffinities
singular: blockaffinity
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BlockAffinitySpec contains the specification for a BlockAffinity
resource.
properties:
cidr:
type: string
deleted:
description: Deleted indicates that this block affinity is being deleted.
This field is a string for compatibility with older releases that
mistakenly treat this field as a string.
type: string
node:
type: string
state:
type: string
required:
- cidr
- deleted
- node
- state
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
64 changes: 64 additions & 0 deletions config/crd/crd.projectcalico.org_clusterinformations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: clusterinformations.crd.projectcalico.org
spec:
group: crd.projectcalico.org
names:
kind: ClusterInformation
listKind: ClusterInformationList
plural: clusterinformations
singular: clusterinformation
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: ClusterInformation contains the cluster specific information.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ClusterInformationSpec contains the values of describing
the cluster.
properties:
calicoVersion:
description: CalicoVersion is the version of Calico that the cluster
is running
type: string
clusterGUID:
description: ClusterGUID is the GUID of the cluster
type: string
clusterType:
description: ClusterType describes the type of the cluster
type: string
datastoreReady:
description: DatastoreReady is used during significant datastore migrations
to signal to components such as Felix that it should wait before
accessing the datastore.
type: boolean
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit b33ec26

Please sign in to comment.