Skip to content

Commit ee11b10

Browse files
author
Mengqi Yu
committed
update testdata
1 parent 5365576 commit ee11b10

14 files changed

+45
-44
lines changed

testdata/project-v2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager
1616

1717
# Use distroless as minimal base image to package the manager binary
1818
# Refer to https://github.com/GoogleContainerTools/distroless for more details
19-
FROM gcr.io/distroless/base
19+
FROM gcr.io/distroless/static:latest
2020
WORKDIR /
2121
COPY --from=builder /workspace/manager .
2222
ENTRYPOINT ["/manager"]
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
resources:
22
- certificate.yaml
33

4+
# the following config is for teaching kustomize how to do var substitution
45
vars:
56
- name: CERTIFICATENAME
67
objref:
78
kind: Certificate
89
group: certmanager.k8s.io
910
version: v1alpha1
1011
name: serving-cert # this name should match the one in certificate.yaml
12+
- name: CERTIFICATENAMESPACE
13+
objref:
14+
kind: Certificate
15+
group: certmanager.k8s.io
16+
version: v1alpha1
17+
name: serving-cert # this name should match the one in certificate.yaml
18+
fieldref:
19+
fieldpath: metadata.namespace
1120

1221
configurations:
1322
- kustomizeconfig.yaml

testdata/project-v2/config/crd/bases/crew.testproject.org_captains.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: apiextensions.k8s.io/v1beta1
23
kind: CustomResourceDefinition
34
metadata:

testdata/project-v2/config/crd/bases/crew.testproject.org_firstmates.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: apiextensions.k8s.io/v1beta1
23
kind: CustomResourceDefinition
34
metadata:

testdata/project-v2/config/crd/patches/webhook_in_captain.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
webhookClientConfig:
1212
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
1313
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
14-
caBundle: XG4=
14+
caBundle: Cg==
1515
service:
1616
namespace: $(NAMESPACE)
1717
name: webhook-service

testdata/project-v2/config/crd/patches/webhook_in_firstmate.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
webhookClientConfig:
1212
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
1313
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
14-
caBundle: XG4=
14+
caBundle: Cg==
1515
service:
1616
namespace: $(NAMESPACE)
1717
name: webhook-service

testdata/project-v2/config/default/kustomization.yaml

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ bases:
1616
- ../crd
1717
- ../rbac
1818
- ../manager
19-
# - ../webhook
20-
# Comment the next line if you want to disable cert-manager
21-
# - ../certmanager
19+
# [WEBHOOK] Uncomment all the sections with [WEBHOOK] prefix to enable webhook.
20+
#- ../webhook
21+
# [CERTMANAGER] Uncomment next line to enable cert-manager
22+
#- ../certmanager
2223

2324
patches:
2425
- manager_image_patch.yaml
@@ -33,8 +34,9 @@ patches:
3334
# manager_prometheus_metrics_patch.yaml should be enabled.
3435
#- manager_prometheus_metrics_patch.yaml
3536

36-
# Uncomment the following patch to enable the CA injection in the admission webhooks.
37-
#- webhookcainjection_patch.yaml
38-
39-
# Uncomment the following patch to enable the webhook for the manager.
37+
# [WEBHOOK] Uncomment all the sections with [WEBHOOK] prefix to enable webhook.
4038
#- manager_webhook_patch.yaml
39+
40+
# [CAINJECTION] Uncomment next line to enable the CA injection in the admission webhooks. [CERTMANAGER] needs to be
41+
# enabled to use ca injection
42+
#- webhookcainjection_patch.yaml

testdata/project-v2/config/default/manager_webhook_patch.yaml

+2-12
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,11 @@ spec:
1313
name: webhook-server
1414
protocol: TCP
1515
volumeMounts:
16-
- mountPath: /tmp/cert
16+
- mountPath: /tmp/k8s-webhook-server/serving-certs
1717
name: cert
1818
readOnly: true
1919
volumes:
2020
- name: cert
2121
secret:
2222
defaultMode: 420
23-
secretName: webhook-server-secret
24-
---
25-
apiVersion: v1
26-
kind: Service
27-
metadata:
28-
name: webhook-service
29-
namespace: system
30-
spec:
31-
ports:
32-
- port: 443
33-
targetPort: 443
23+
secretName: webhook-server-cert

testdata/project-v2/config/default/webhookcainjection_patch.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ kind: MutatingWebhookConfiguration
55
metadata:
66
name: mutating-webhook-configuration
77
annotations:
8-
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
8+
certmanager.k8s.io/inject-ca-from: $(CERTIFICATENAMESPACE)/$(CERTIFICATENAME)
99
---
1010
apiVersion: admissionregistration.k8s.io/v1beta1
1111
kind: ValidatingWebhookConfiguration
1212
metadata:
1313
name: validating-webhook-configuration
1414
annotations:
15-
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
15+
certmanager.k8s.io/inject-ca-from: $(CERTIFICATENAMESPACE)/$(CERTIFICATENAME)
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
11
resources:
22
- manager.yaml
3-
4-
# the following config is for teaching kustomize how to do var substitution
5-
# vars:
6-
# - name: NAMESPACE
7-
# objref:
8-
# kind: Service
9-
# version: v1
10-
# name: webhook-service
11-
# fieldref:
12-
# fieldpath: metadata.namespace
13-
# - name: SERVICENAME
14-
# objref:
15-
# kind: Service
16-
# version: v1
17-
# name: webhook-service

testdata/project-v2/config/manager/manager.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,4 @@ spec:
5656
requests:
5757
cpu: 100m
5858
memory: 20Mi
59-
ports:
60-
- containerPort: 9876
61-
name: webhook-server
62-
protocol: TCP
6359
terminationGracePeriodSeconds: 10

testdata/project-v2/config/rbac/role.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: ClusterRole
34
metadata:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
resources:
2-
- webhookmanifests.yaml # disabled till v2 has webhook support
2+
- webhookmanifests.yaml
3+
- service.yaml
34

45
configurations:
56
- kustomizeconfig.yaml
7+
8+
# the following config is for teaching kustomize how to do var substitution
9+
vars:
10+
- name: NAMESPACE
11+
objref:
12+
kind: Service
13+
version: v1
14+
name: webhook-service
15+
fieldref:
16+
fieldpath: metadata.namespace
17+
- name: SERVICENAME
18+
objref:
19+
kind: Service
20+
version: v1
21+
name: webhook-service

testdata/project-v2/config/webhook/webhookmanifests.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)