Repository navigation
Unavailable/deprecated K8s APIs support - #1773
openshift-merge-robot merged 2 commits into
Conversation
…1710) * upgrade from deprecated apis * psec * fix rbac proxy
| rbacProxyTranform, | ||
| ) | ||
| socommon.ConfigMapVolumeChecksumTransform(context.Background(), r.client, sets.NewString("config-tracing", "kafka-config-logging")), | ||
| rbacProxyTranform), socommon.DeprecatedAPIsTranformersFromConfig()...) |
There was a problem hiding this comment.
DeprecatedAPIsTranformersFromConfig ?
There was a problem hiding this comment.
DeprecatedAPIsTranformersFromVersion is more accurate the idea is to check the K8s version based on K8s config we create and return the right transformers. I will change the name.
|
/assign @matzew |
| - fs.StringVar(&c.Kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"), | ||
| - "Path to a kubeconfig. Only required if out-of-cluster.") | ||
| - | ||
| + if fs.Lookup("kubeconfig") == nil { |
There was a problem hiding this comment.
why is this needed? Is it somewhere tracked/addressed (ideally upstream)?
There was a problem hiding this comment.
This is for double vendoring (kubernetes-sigs/controller-runtime#878), you need this so controller-runtime plays well. Otherwise you get an issue with the flag because that flag is also defined in knative.dev. It is a known issue afaik we cant do much, I adapted the fix here: kubernetes-sigs/controller-runtime#1999.
| } | ||
| m, err := manifest.Transform( | ||
| tfs := []mf.Transformer{} | ||
| tfs = append(append(tfs, |
There was a problem hiding this comment.
Kafka deployments dont need management?
| ) | ||
|
|
||
| // UpgradePodDisruptionBudget upgrade the API version to policy/v1 | ||
| func UpgradePodDisruptionBudget() mf.Transformer { |
There was a problem hiding this comment.
Fine having this here, but isn't this also somewhat a concern for the upstream operator?
There was a problem hiding this comment.
The upstream operator has more freedom on what it supports (I guess it will make sure that it works on the three latest K8s versions). We have to support more versions.
| func SetSecurityContextForAdmissionController() mf.Transformer { | ||
| return func(u *unstructured.Unstructured) error { | ||
| switch u.GetKind() { | ||
| case "Deployment": |
There was a problem hiding this comment.
soon we have statefulsets.apps here too /cc @pierDipi
There was a problem hiding this comment.
We would need this, let me know if I should follow up for statefulset support.
|
|
||
| // CheckMinimumVersion checks if current K8s version we are on is higher than the one passed. | ||
| // If an error is returned then we | ||
| func CheckMinimumVersion(versioner discovery.ServerVersionInterface, version string) error { |
There was a problem hiding this comment.
Can we name this CheckMinimumKubeVersion ? (to avoid confusion w/ serverless versions)
| actualVersion: &testVersioner{version: "1.20.2-kpn-065dce"}, | ||
| }, { | ||
| name: "greater version (patch), pre-release with build", | ||
| actualVersion: &testVersioner{version: "1.20.0-1095+9689d22dc3121e-dirty"}, |
There was a problem hiding this comment.
best version ever 😄 (ocp one, right?)
|
@skonto thanks a lot for this - I added a few comments, but this looks good to me! |
|
On 4.11, I saw these on the Kafka deployments, like ...
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
...(and midstream/upstream these settings do not exist) |
|
Next: testing on OCP 4.10 ... to check for
|
|
on 4.10
...
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
...Or here ...
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
...oc get deployment eventing-controller -n knative-eventing -oyaml ...
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true
runAsNonRoot: true
...@skonto I wonder on the |
|
4.12 securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefaultbroker-receiver: securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault |
It would be good to do it there I have a PR for this: openshift/knative-serving#1272. In any case the patch here could protect us under any scenario as we have the ocp version and we can downgrade/upgrade whatever we want. |
FWIW, The HPA change for upstream eventing was done just for 1.8, so is not relevant here: |
|
@skonto let's get this merged, and we update the midstream serving/eventing manifests afterwards? |
|
I removed the WIP status... |
matzew
left a comment
There was a problem hiding this comment.
/lgtm
/approve
/hold
for others to get some more reviews...
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, skonto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
So, these have been:
|
This config is not available in any supported OCP, it will be added dynamically in [1]. [1] openshift-knative/serverless-operator#1773 Signed-off-by: Pierangelo Di Pilato <[email protected]>
|
@matzew should we unhold? Will do a follow-up PR with any changes needed once midstream stuff is done. |
|
/test 4.11-osd-images |
|
/unhold |
This config is not available in any supported OCP, it will be added dynamically in [1]. [1] openshift-knative/serverless-operator#1773 Signed-off-by: Pierangelo Di Pilato <[email protected]>
This config is not available in any supported OCP, it will be added dynamically in [1]. [1] openshift-knative/serverless-operator#1773 Signed-off-by: Pierangelo Di Pilato <[email protected]>
Fixes JIRA #
Proposed Changes
Without this it seems things fail.