Skip to content

Commit

Permalink
add missing files and update
Browse files Browse the repository at this point in the history
Signed-off-by: kranurag7 <anurag.kumar@syself.com>
  • Loading branch information
kranurag7 committed Apr 26, 2024
1 parent cdbff09 commit f1024bd
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 0 deletions.
24 changes: 24 additions & 0 deletions config/default/manager_hookserver_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
ports:
- containerPort: 9442
name: hook-server-svc
protocol: TCP
volumeMounts:
- mountPath: /tmp/k8s-hook-server/serving-certs
name: hook-server-cert
readOnly: true
volumes:
- name: hook-server-cert
secret:
defaultMode: 420
secretName: cso-hook-server-server-cert

13 changes: 13 additions & 0 deletions config/hookserver/extensionconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: runtime.cluster.x-k8s.io/v1alpha1
kind: ExtensionConfig
metadata:
annotations:
runtime.cluster.x-k8s.io/inject-ca-from-secret: $(HOOK_SERVER_CERTIFICATE_NAMESPACE)/$(HOOK_SERVER_CERTIFICATE_NAME)
name: hook-server-extensionconfig
spec:
clientConfig:
service:
name: hook-server-svc
namespace: system # Note: this assumes the test extension get deployed in the default namespace defined in its own runtime-extensions-components.yaml
port: 443
namespaceSelector: {}
6 changes: 6 additions & 0 deletions config/hookserver/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resources:
- service.yaml
- extensionconfig.yaml

configurations:
- kustomizeconfig.yaml
18 changes: 18 additions & 0 deletions config/hookserver/kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# the following config is for teaching kustomize where to look at when substituting vars.
# It requires kustomize v2.1.0 or newer to work properly.
nameReference:
- kind: Service
version: v1
fieldSpecs:
- kind: ExtensionConfig
group: runtime.cluster.x-k8s.io
path: spec/clientConfig/service/name

namespace:
- kind: ExtensionConfig
group: runtime.cluster.x-k8s.io
path: spec/clientConfig/service/namespace
create: true

varReference:
- path: metadata/annotations
11 changes: 11 additions & 0 deletions config/hookserver/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: hook-server-svc
namespace: system
spec:
ports:
- port: 443
targetPort: 9442
selector:
control-plane: cso-controller-manager
16 changes: 16 additions & 0 deletions config/localmode/manager_config_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- image: ghcr.io/sovereigncloudstack/cso-staging:dev
name: manager
args:
- --leader-elect=true
- --log-level=debug
- --local=true

24 changes: 24 additions & 0 deletions config/localmode/manager_hookserver_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
ports:
- containerPort: 9442
name: hook-server-svc
protocol: TCP
volumeMounts:
- mountPath: /tmp/k8s-hook-server/serving-certs
name: hook-server-cert
readOnly: true
volumes:
- name: hook-server-cert
secret:
defaultMode: 420
secretName: cso-hook-server-server-cert

11 changes: 11 additions & 0 deletions config/localmode/manager_pull_policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
imagePullPolicy: Always
24 changes: 24 additions & 0 deletions config/localmode/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
spec:
template:
spec:
containers:
- name: manager
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
volumes:
- name: cert
secret:
defaultMode: 420
secretName: cso-webhook-server-cert

10 changes: 10 additions & 0 deletions config/localmode/webhookcainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This patch add annotation to admission webhook config and
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)

0 comments on commit f1024bd

Please sign in to comment.