Skip to content

Commit

Permalink
Renaming the webhook deployment from webhook-server to webhook.
Browse files Browse the repository at this point in the history
* When we generate files with `controller-gen` it generates a service
  called `webhook-service` and it is not configurable.

* When we deploy KMM with OLM, OLM deploys a service for the webhook
  called `<webhook-deployment-name>-service.

Therefore, before this change, we were getting 2 services for the same
deployment. One generated by `controller-gen` and added to the bundle
manifests and the other one created "on the fly" by OLM.

This change will make OLM find an already existing service called
`webhook-service` in the cluster because the deployment is called
`webhook`, therefore, it won't create a second service as before.

Services in KMM's namespace before the changes:
```
kmm-operator-controller-metrics-service   ClusterIP   10.129.169.25   <none>  8443/TCP   2d2h
kmm-operator-webhook-server-service       ClusterIP   10.130.107.158  <none>  443/TCP    2d2h
kmm-operator-webhook-service              ClusterIP   10.128.244.171  <none>  443/TCP    2d2h
```

Services in KMM's namespace after the changes:
```
kmm-operator-controller-metrics-service   ClusterIP   10.99.75.82     <none>  8443/TCP   88m
kmm-operator-webhook-service              ClusterIP   10.105.163.241  <none>  443/TCP    88m
```

Signed-off-by: Yoni Bettan <[email protected]>
  • Loading branch information
ybettan authored and k8s-ci-robot committed Dec 23, 2024
1 parent 8accf3d commit b65b4e0
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ci/install-ci-hub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ patches:
apiVersion: apps/v1
kind: Deployment
metadata:
name: webhook-server
name: webhook
namespace: system
spec:
template:
Expand Down
2 changes: 1 addition & 1 deletion ci/install-ci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ patches:
apiVersion: apps/v1
kind: Deployment
metadata:
name: webhook-server
name: webhook
namespace: system
spec:
template:
Expand Down
4 changes: 2 additions & 2 deletions ci/prow/e2e-hub-spoke-incluster-build
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ make deploy deploy-hub

kubectl wait --for=condition=Available -n ${OPERATOR_NAMESPACE} \
deployment/kmm-operator-hub-controller \
deployment/kmm-operator-hub-webhook-server \
deployment/kmm-operator-hub-webhook \
deployment/kmm-operator-controller \
deployment/kmm-operator-webhook-server \
deployment/kmm-operator-webhook \

# Make the ManagedCluster selected by the ManagedClusterModule
kubectl label managedcluster minikube name=minikube
Expand Down
2 changes: 1 addition & 1 deletion ci/prow/e2e-incluster-build
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kubectl apply -f ci/kmm-kmod-dockerfile.yaml
echo "Add Secrets containing the signing key and certificate..."
kubectl apply -f ci/secret_kmm-kmod-signing.yaml

kubectl wait --for=condition=Available deployment/kmm-operator-controller deployment/kmm-operator-webhook-server -n kmm-operator-system
kubectl wait --for=condition=Available deployment/kmm-operator-controller deployment/kmm-operator-webhook -n kmm-operator-system

echo "Add an kmm-ci Module that contains a valid mapping..."
kubectl apply -f ci/module-kmm-ci-build-sign.yaml
Expand Down
2 changes: 1 addition & 1 deletion ci/prow/operator-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ make bundle bundle-build bundle-push \
--timeout 5m0s
kubectl wait --for=condition=Available -n operators --timeout=1m \
deployment/kmm-operator-controller \
deployment/kmm-operator-webhook-server
deployment/kmm-operator-webhook

2 changes: 1 addition & 1 deletion config/deploy-hub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resources:
patches:
- target:
kind: Deployment
name: webhook-server
name: webhook
patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
Expand Down
2 changes: 1 addition & 1 deletion config/deploy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resources:
patches:
- target:
kind: Deployment
name: webhook-server
name: webhook
patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
Expand Down
2 changes: 1 addition & 1 deletion config/webhook-cert/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ patches:
apiVersion: apps/v1
kind: Deployment
metadata:
name: webhook-server
name: webhook
namespace: system
spec:
template:
Expand Down
2 changes: 1 addition & 1 deletion config/webhook-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webhook-server
name: webhook
namespace: system
labels:
control-plane: webhook-server
Expand Down
4 changes: 2 additions & 2 deletions docs/mkdocs/documentation/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ In the commands below, the value of `$namespace` depends on your [installation m

| Component | Command |
|-----------|-----------------------------------------------------------------------------|
| KMM | `kubectl logs -fn "$namespace" deployments/kmm-operator-webhook-server` |
| KMM-Hub | `kubectl logs -fn "$namespace" deployments/kmm-operator-hub-webhook-server` |
| KMM | `kubectl logs -fn "$namespace" deployments/kmm-operator-webhook` |
| KMM-Hub | `kubectl logs -fn "$namespace" deployments/kmm-operator-hub-webhook` |

## Observing events

Expand Down

0 comments on commit b65b4e0

Please sign in to comment.