Skip to content

Commit 467a27a

Browse files
authored
Merge pull request #371 from oracle/pull_internal_119
Backlog of changes from OKE - upgrade to k8s vendor 1.19
2 parents 1d797f0 + 39d8c8f commit 467a27a

File tree

3,232 files changed

+247266
-203613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,232 files changed

+247266
-203613
lines changed

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# Build and publish artifacts for a release
6+
tags:
7+
- "v*.*.*"
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
with:
20+
platforms: arm64
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v1
24+
25+
- name: Log into GitHub Container Registry
26+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin
27+
28+
- name: Build Image
29+
run: OSS_REGISTRY="ghcr.io/oracle" VERSION="${{ github.ref_name }}" make image
30+
31+
- name: Push Image
32+
run: OSS_REGISTRY="ghcr.io/oracle" VERSION="${{ github.ref_name }}" make docker-push-all

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
ARG CI_IMAGE_REGISTRY
1616

17-
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.4
17+
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.5
1818

1919
ARG COMPONENT
2020

Dockerfile_arm_all

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG CI_IMAGE_REGISTRY
2+
3+
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.5 as builder
4+
5+
ARG COMPONENT
6+
7+
ENV SRC /go/src/github.com/oracle/oci-cloud-controller-manager
8+
9+
ENV GOPATH /go/
10+
RUN mkdir -p /go/bin $SRC
11+
ADD . $SRC
12+
13+
WORKDIR $SRC
14+
15+
RUN ARCH=arm make clean build-arm-all
16+
17+
FROM arm64v8/oraclelinux:7-slim
18+
19+
RUN yum install -y util-linux \
20+
&& yum install -y e2fsprogs \
21+
&& yum clean all
22+
\
23+
24+
COPY --from=0 /go/src/github.com/oracle/oci-cloud-controller-manager/dist/arm/* /usr/local/bin/

Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
PKG := github.com/oracle/oci-cloud-controller-manager
1716

1817
ifeq "$(CI_IMAGE_REGISTRY)" ""
@@ -29,6 +28,8 @@ endif
2928
IMAGE ?= $(OSS_REGISTRY)/cloud-provider-oci
3029
COMPONENT ?= oci-cloud-controller-manager oci-volume-provisioner oci-flexvolume-driver oci-csi-controller-driver oci-csi-node-driver
3130

31+
ALL_ARCH = amd64 arm64
32+
3233
ifeq "$(VERSION)" ""
3334
BUILD := $(shell git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8)
3435
# Allow overriding for release versions else just equal the build (git hash)
@@ -139,13 +140,39 @@ run-volume-provisioner-dev:
139140
BUILD_ARGS = --build-arg CI_IMAGE_REGISTRY="$(CI_IMAGE_REGISTRY)" --build-arg COMPONENT="$(COMPONENT)"
140141
image:
141142
docker build $(BUILD_ARGS) \
142-
-t $(IMAGE):$(VERSION) .
143+
-t $(IMAGE)-amd64:$(VERSION) .
144+
docker build $(BUILD_ARGS) \
145+
-t $(IMAGE)-arm64:$(VERSION) -f Dockerfile_arm_all .
143146

144147
.PHONY: push
145148
push: image
146149
docker login --username="${oss_docker_username}" --password="${oss_docker_password}" $(OSS_REGISTRY)
147150
docker push $(IMAGE):$(VERSION)
148151

152+
.PHONY: build
153+
build-arm-all: build-dirs
154+
@for component in $(COMPONENT); do \
155+
GOOS=$(GOOS) GOARCH=arm64 CGO_ENABLED=0 go build -o dist/arm/$$component -ldflags "-X main.version=$(VERSION) -X main.build=$(BUILD)" ./cmd/$$component ; \
156+
done
157+
158+
.PHONY: docker-push
159+
docker-push: ## Push the docker image
160+
docker push $(IMAGE)-$(ARCH):$(VERSION)
161+
162+
docker-push-%:
163+
$(MAKE) ARCH=$* docker-push
164+
165+
.PHONY: docker-push-all ## Push all the architecture docker images
166+
docker-push-all: $(addprefix docker-push-,$(ALL_ARCH))
167+
$(MAKE) docker-push-manifest
168+
169+
.PHONY: docker-push-manifest
170+
docker-push-manifest: ## Push the fat manifest docker image.
171+
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
172+
docker manifest create --amend $(IMAGE):$(VERSION) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(IMAGE)\-&:$(VERSION)~g")
173+
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${IMAGE}:${VERSION} ${IMAGE}-$${arch}:${VERSION}; done
174+
docker manifest push --purge ${IMAGE}:${VERSION}
175+
149176
.PHONY: version
150177
version:
151178
@echo $(VERSION)

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ cloud-provider specific code out of the Kubernetes codebase.
2222

2323
## Compatibility matrix
2424

25-
| | Kubernetes 1.16 | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20 |
26-
|-----------|------------------------|------------------------|------------------------|------------------------|------------------------|
27-
| \>=v 0.9 ||||||
28-
| \>=v 0.10 ||||||
29-
| \>=v 0.11 ||||||
30-
| \>=v 0.12 ||||||
25+
| | Min Kubernetes Version | Max Kubernetes Version |
26+
|-----------|-----------------------------|------------------------------|
27+
| \>=v 0.11 | v1.16 | v1.18 |
28+
| \>=v 0.12 | v1.18 | v1.21 |
29+
| \>=v 0.13 | v1.19 | v1.21 |
3130

32-
Key:
33-
34-
* `` oci-cloud-controller-manager is fully compatible.
35-
* `` oci-cloud-controller-manager is not compatible.
36-
* `` Not tested with given version.
31+
Note:
32+
Versions older than v0.13.0 are no longer supported, new features / bug fixes will be available in v0.13.0 and later.
3733

3834
## Implementation
3935
Currently `oci-cloud-controller-manager` implements:
@@ -97,19 +93,20 @@ For CCM -
9793
```bash
9894
$ kubectl create secret generic oci-cloud-controller-manager \
9995
-n kube-system \
100-
--from-file=cloud-provider.yaml=cloud-provider-example.yaml
96+
--from-file=cloud-provider.yaml=provider-config-example.yaml
10197
```
10298
Note that you must ensure the secret contains the key `cloud-provider.yaml`
10399
rather than the name of the file on disk.
104100

105101
### Deployment
106102

107103
Deploy the controller manager and associated RBAC rules if your cluster
108-
is configured to use RBAC:
104+
is configured to use RBAC (replace ? with the version you want to install to):
109105

110106
```bash
111-
$ kubectl apply -f https://raw.githubusercontent.com/oracle/oci-cloud-controller-manager/master/manifests/cloud-controller-manager/oci-cloud-controller-manager.yaml
112-
$ kubectl apply -f https://raw.githubusercontent.com/oracle/oci-cloud-controller-manager/master/manifests/cloud-controller-manager/oci-cloud-controller-manager-rbac.yaml
107+
$ export RELEASE=?
108+
$ kubectl apply -f https://github.com/oracle/oci-cloud-controller-manager/releases/download/${RELEASE}/oci-cloud-controller-manager-rbac.yaml
109+
$ kubectl apply -f https://github.com/oracle/oci-cloud-controller-manager/releases/download/${RELEASE}/oci-cloud-controller-manager.yaml
113110
```
114111

115112
Check the CCM logs to ensure it's running correctly:

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.19

ci-docker-images/Dockerfile

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,31 @@ RUN yum install oracle-softwarecollection-release-el7 -y \
2222
make \
2323
openssl \
2424
pwgen \
25-
python \
25+
python3 \
2626
wget \
2727
python-yaml \
2828
unzip && \
2929
yum clean all && rm -rf /var/cache/yum
3030

31-
RUN wget https://bootstrap.pypa.io/get-pip.py
32-
RUN python get-pip.py
31+
RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py
32+
RUN python3 get-pip.py
3333

3434
# Install golang environment
35-
RUN curl https://storage.googleapis.com/golang/go1.12.17.linux-amd64.tar.gz -O && \
35+
RUN curl https://storage.googleapis.com/golang/go1.15.12.linux-amd64.tar.gz -O && \
3636
mkdir /tools && \
37-
tar xzf go1.12.17.linux-amd64.tar.gz -C /tools && \
38-
rm go1.12.17.linux-amd64.tar.gz && \
37+
tar xzf go1.15.12.linux-amd64.tar.gz -C /tools && \
38+
rm go1.15.12.linux-amd64.tar.gz && \
3939
mkdir -p /go/bin
4040

4141
ENV PATH=/tools/go/bin:/go/bin:/tools/linux-amd64:$PATH \
4242
GOPATH=/go \
4343
GOROOT=/tools/go
4444

4545
# Install the kubectl client
46-
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl && \
46+
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl && \
4747
chmod +x ./kubectl && \
4848
mv ./kubectl /usr/local/bin/kubectl
4949

50-
# Install Ginkgo
51-
RUN go get -u github.com/onsi/ginkgo/ginkgo && \
52-
go get -u github.com/onsi/gomega/...
53-
54-
# Install golint
55-
RUN go get -u golang.org/x/lint/golint
56-
57-
# Install Terraform
58-
RUN curl https://releases.hashicorp.com/terraform/0.10.7/terraform_0.10.7_linux_amd64.zip -LO && \
59-
unzip terraform_0.10.7_linux_amd64.zip && \
60-
mv terraform /usr/bin && \
61-
rm -f terraform terraform_0.10.7_linux_amd64.zip
62-
63-
# Installs the OCI terraform provider
64-
RUN curl -LO https://github.com/oracle/terraform-provider-oci/releases/download/2.0.2/linux.tar.gz && \
65-
tar -xvf linux.tar.gz -C / && \
66-
echo "providers { oci = \"/linux_amd64/terraform-provider-oci_v2.0.2\" }" > ~/.terraformrc && \
67-
rm -f linux.tar.gz
68-
6950
# Install OCI client
7051
RUN pip install \
7152
oci \

cmd/oci-cloud-controller-manager/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
"go.uber.org/zap"
2828
cliflag "k8s.io/component-base/cli/flag"
2929
"k8s.io/component-base/logs"
30+
_ "k8s.io/component-base/metrics/prometheus/restclient" // for client metric registration
31+
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
3032
"k8s.io/kubernetes/cmd/cloud-controller-manager/app"
31-
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
32-
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
3333
)
3434

3535
var version string

cmd/oci-csi-controller-driver/csi-controller-driver/oci-csi-controller-driver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func StartControllerDriver(csiOptions csioptions.CSIOptions) {
2727
logger := logging.Logger().Sugar()
2828
logger.Sync()
2929

30-
drv, err := driver.NewControllerDriver(logger, csiOptions.Endpoint, csiOptions.Kubeconfig, csiOptions.Master)
30+
drv, err := driver.NewControllerDriver(logger.Named("BV"), csiOptions.Endpoint, csiOptions.Kubeconfig, csiOptions.Master,
31+
true, driver.BlockVolumeDriverName, driver.BlockVolumeDriverVersion)
3132
if err != nil {
3233
logger.With(zap.Error(err)).Fatal("Failed to create controller driver.")
3334
}

cmd/oci-csi-controller-driver/csioptions/csioptions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type CSIOptions struct {
4444
MetricsPath string
4545
ExtraCreateMetadata bool
4646
ReconcileSync time.Duration
47+
EnableResizer bool
4748
}
4849

4950
//NewCSIOptions initializes the flag
@@ -71,6 +72,7 @@ func NewCSIOptions() *CSIOptions {
7172
MetricsPath: *flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`."),
7273
ExtraCreateMetadata: *flag.Bool("extra-create-metadata", false, "If set, add pv/pvc metadata to plugin create requests as parameters."),
7374
ReconcileSync: *flag.Duration("reconcile-sync", 1*time.Minute, "Resync interval of the VolumeAttachment reconciler."),
75+
EnableResizer: *flag.Bool("csi-bv-expansion-enabled", false, "Enables go routine csi-resizer."),
7476
}
7577
return &csioptions
7678
}

0 commit comments

Comments
 (0)