Skip to content

Commit f2839a9

Browse files
authored
Merge pull request #383 from l-technicore/oke-oss-release-v1.22.0
Oke oss release v1.22.0
2 parents e10de4b + 6ec0009 commit f2839a9

File tree

3,000 files changed

+265450
-114573
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,000 files changed

+265450
-114573
lines changed

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go 1.x
1313
uses: actions/setup-go@v2
1414
with:
15-
go-version: 1.15
15+
go-version: 1.16
1616
id: go
1717

1818
- name: Check out code into the Go module directory

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.5
17+
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.6
1818

1919
ARG COMPONENT
2020

Dockerfile_arm_all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG CI_IMAGE_REGISTRY
22

3-
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.5 as builder
3+
FROM ${CI_IMAGE_REGISTRY}/oci-kube-ci:1.0.6 as builder
44

55
ARG COMPONENT
66

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ else
3838
VERSION ?= ${VERSION}
3939
endif
4040

41-
RELEASE = v1.19.12
41+
RELEASE = v1.22.0
4242

4343
GOOS ?= linux
4444
ARCH ?= amd64
@@ -182,6 +182,17 @@ version:
182182
.PHONY: build-local
183183
build-local: build
184184

185+
.PHONY: test-local
186+
test-local: build-dirs
187+
@docker run --rm \
188+
--privileged \
189+
-w $(DOCKER_REPO_ROOT) \
190+
-v $(PWD):$(DOCKER_REPO_ROOT) \
191+
-e COMPONENT="$(COMPONENT)" \
192+
-e GOPATH=/go/ \
193+
odo-docker-signed-local.artifactory.oci.oraclecorp.com/odx-oke/oke/k8-manager-base:go1.16.1-1.0.9 \
194+
make coverage image
195+
185196
.PHONY: run-ccm-e2e-tests-local
186197
run-ccm-e2e-tests-local:
187198
./hack/run_e2e_test.sh

README.md

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

2323
## Compatibility matrix
2424

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 |
30-
| v1.19.12 | v1.19 | v1.21 |
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 |
30+
| v1.19.12 | v1.19 | v1.21 |
31+
| v1.22.0 | v1.22 | - |
32+
3133

3234
Note:
3335
Versions older than v0.13.0 are no longer supported, new features / bug fixes will be available in v0.13.0 and later.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.19
1+
1.22

ci-docker-images/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py
3232
RUN python3 get-pip.py
3333

3434
# Install golang environment
35-
RUN curl https://storage.googleapis.com/golang/go1.15.12.linux-amd64.tar.gz -O && \
35+
RUN curl https://storage.googleapis.com/golang/go1.16.15.linux-amd64.tar.gz -O && \
3636
mkdir /tools && \
37-
tar xzf go1.15.12.linux-amd64.tar.gz -C /tools && \
38-
rm go1.15.12.linux-amd64.tar.gz && \
37+
tar xzf go1.16.15.linux-amd64.tar.gz -C /tools && \
38+
rm go1.16.15.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.19.0/bin/linux/amd64/kubectl && \
46+
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.5/bin/linux/amd64/kubectl && \
4747
chmod +x ./kubectl && \
4848
mv ./kubectl /usr/local/bin/kubectl
4949

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

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ import (
2525
"github.com/oracle/oci-cloud-controller-manager/pkg/logging"
2626
"github.com/spf13/pflag"
2727
"go.uber.org/zap"
28+
"k8s.io/apimachinery/pkg/util/wait"
29+
cloudprovider "k8s.io/cloud-provider"
30+
"k8s.io/cloud-provider/app"
31+
"k8s.io/cloud-provider/app/config"
32+
"k8s.io/cloud-provider/options"
2833
cliflag "k8s.io/component-base/cli/flag"
2934
"k8s.io/component-base/logs"
3035
_ "k8s.io/component-base/metrics/prometheus/restclient" // for client metric registration
3136
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
32-
"k8s.io/kubernetes/cmd/cloud-controller-manager/app"
37+
"k8s.io/klog/v2"
3338
)
3439

3540
var version string
@@ -42,7 +47,13 @@ func main() {
4247
defer logger.Sync()
4348
zap.ReplaceGlobals(logger)
4449

45-
command := app.NewCloudControllerManagerCommand()
50+
s, err := options.NewCloudControllerManagerOptions()
51+
if err != nil {
52+
logger.With(zap.Error(err)).Fatal("unable to initialize command options")
53+
}
54+
55+
fss := cliflag.NamedFlagSets{}
56+
command := app.NewCloudControllerManagerCommand(s, cloudInitializer, app.DefaultInitFuncConstructors, fss, wait.NeverStop)
4657

4758
// TODO: once we switch everything over to Cobra commands, we can go back to calling
4859
// utilflag.InitFlags() (by removing its pflag.Parse() call). For now, we have to set the
@@ -61,3 +72,25 @@ func main() {
6172
os.Exit(1)
6273
}
6374
}
75+
76+
func cloudInitializer(config *config.CompletedConfig) cloudprovider.Interface {
77+
cloudConfig := config.ComponentConfig.KubeCloudShared.CloudProvider
78+
// initialize cloud provider with the cloud provider name and config file provided
79+
cloud, err := cloudprovider.InitCloudProvider(cloudConfig.Name, cloudConfig.CloudConfigFile)
80+
if err != nil {
81+
klog.Fatalf("Cloud provider could not be initialized: %v", err)
82+
}
83+
if cloud == nil {
84+
klog.Fatalf("Cloud provider is nil")
85+
}
86+
87+
if !cloud.HasClusterID() {
88+
if config.ComponentConfig.KubeCloudShared.AllowUntaggedCloud {
89+
klog.Warning("detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues")
90+
} else {
91+
klog.Fatalf("no ClusterID found. A ClusterID is required for the cloud provider to function properly. This check can be bypassed by setting the allow-untagged-cloud option")
92+
}
93+
}
94+
95+
return cloud
96+
}

cmd/oci-csi-node-driver/nodedriveroptions/nodecsioptions.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ type NodeCSIOptions struct {
2727
}
2828

2929
type NodeOptions struct {
30-
Name string
31-
Endpoint string
32-
NodeID string
33-
Kubeconfig string
34-
Master string
35-
DriverName string
36-
DriverVersion string
37-
EnableControllerServer bool
30+
Name string
31+
Endpoint string
32+
NodeID string
33+
Kubeconfig string
34+
Master string
35+
DriverName string
36+
DriverVersion string
37+
EnableControllerServer bool
3838
}

container-storage-interface.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,65 @@ Check if PVC is now in bound state:
117117
$ kubectl describe pvc/oci-bv-claim
118118
```
119119

120+
# Troubleshoot
121+
122+
### FsGroup policy not propagated from pod security context
123+
124+
If your fsGroup is not being applied on the files in your volume.
125+
126+
Read more about [fsGroup Policy][7].
127+
128+
Ex.
129+
```yaml
130+
apiVersion: v1
131+
kind: Pod
132+
metadata:
133+
name: security-context-demo
134+
spec:
135+
securityContext:
136+
fsGroup: 2000
137+
containers:
138+
- name: sec-ctx-demo
139+
image: busybox:1.28
140+
command: [ "sh", "-c", "sleep 1h" ]
141+
volumeMounts:
142+
- name: sec-ctx-vol
143+
mountPath: /data/demo
144+
```
145+
146+
```bash
147+
kubectl exec -it security-context-demo -- sh -c "cd /data/demo && echo hello > testfile"
148+
kubectl exec -it security-context-demo -- sh -c "ls -l /data/demo/testfile"
149+
```
150+
151+
The output you would expect is that the `/data/demo/testfile` file has group ID 2000, which is the value of fsGroup
152+
```bash
153+
-rw-r--r-- 1 root 2000 6 Jun 6 20:08 testfile
154+
```
155+
156+
But the same does not reflect on your volume, i.e. the permissions on your files/folders are not what you would expect.
157+
Ex:
158+
```bash
159+
-rw-r--r-- 1 root root 6 Jun 6 20:08 testfile
160+
```
161+
162+
### Solution:
163+
Create a CSI Driver object with spec: `fsGroupPolicy: File`.
164+
Ex:
165+
```yaml
166+
apiVersion: storage.k8s.io/v1
167+
kind: CSIDriver
168+
metadata:
169+
name: blockvolume.csi.oraclecloud.com
170+
spec:
171+
fsGroupPolicy: File
172+
```
173+
`File` - Indicates that the CSI volume driver supports volume ownership and permission change via fsGroup, and Kubernetes may use fsGroup to change permissions and ownership of the volume to match user requested fsGroup in the pod's SecurityPolicy regardless of fstype or access mode.
174+
120175
[1]: https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm
121176
[2]: https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/
122177
[3]: https://kubernetes.io/docs/admin/authorization/rbac/
123178
[4]: https://kubernetes-csi.github.io/docs/external-provisioner.html
124179
[5]: https://kubernetes-csi.github.io/docs/external-attacher.html
125180
[6]: https://kubernetes-csi.github.io/docs/node-driver-registrar.html
181+
[7]: https://kubernetes-csi.github.io/docs/support-fsgroup.html#csi-volume-fsgroup-policy

0 commit comments

Comments
 (0)