networkservicemesh / cmd-admission-webhook-k8s

Apache License 2.0
0 stars 16 forks source link

Add support of replicaSet #150

Open anastasia-malysheva opened 2 years ago

anastasia-malysheva commented 2 years ago

ReplicaSet kind doesn't supported by webhook: https://github.com/networkservicemesh/cmd-admission-webhook-k8s/blob/main/main.go#L106

denis-tingaikin commented 2 years ago

It would be nice if we can support other container based k8s resources (if we missed something).

anastasia-malysheva commented 2 years ago

As part of the task it was found that Job and CronJob K8s resourсes can be supported with ТЫЬ annotations too, but it is not necessary now so it was not added.

Also the small research was made about usage of Annotations in service meshes, Istio and Consul-k8s.

For Consul annotations are widely used for pods, but also they are used for Services and Service Accounts and there are examples with custom kinds. Consul Docs: https://www.consul.io/docs/k8s/annotations-and-labels#consul-hashicorp-com-consul-sidecar-memory-limit Consul example with annotations for Service https://github.com/hashicorp/consul/blob/b199b60ded9b22d0be3cdd9b0947dcaa98194baa/website/content/docs/k8s/service-sync.mdx Example with custom kind ServiceDefaults: https://github.com/hashicorp/consul/blob/21e855d860865f1472b3fdcb64a916e92bc83a9f/website/content/docs/k8s/crds/upgrade-to-crds.mdx (edited)

For Istio annotations used also for Pods, Deployments, Services and other types too. In istio doc listed that some annotations are used for any kind: https://istio.io/latest/docs/reference/config/annotations/ Example with deployment https://github.com/istio/istio/blob/393f88cd255f1c0caea6fac5d21aaf0d3e412aad/pilot/pkg/config/kube/gateway/templates/deployment.yaml example with Gateway https://github.com/istio/istio/blob/9f83137301787eea4b3f547ae8e74d862f104c72/pilot/pkg/config/kube/gateway/testdata/route-binding.yaml.golden