Skip to content

Commit

Permalink
update testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengqi Yu committed May 15, 2019
1 parent 5365576 commit ee11b10
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 44 deletions.
2 changes: 1 addition & 1 deletion testdata/project-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base
FROM gcr.io/distroless/static:latest
WORKDIR /
COPY --from=builder /workspace/manager .
ENTRYPOINT ["/manager"]
9 changes: 9 additions & 0 deletions testdata/project-v2/config/certmanager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
resources:
- certificate.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
- name: CERTIFICATENAME
objref:
kind: Certificate
group: certmanager.k8s.io
version: v1alpha1
name: serving-cert # this name should match the one in certificate.yaml
- name: CERTIFICATENAMESPACE
objref:
kind: Certificate
group: certmanager.k8s.io
version: v1alpha1
name: serving-cert # this name should match the one in certificate.yaml
fieldref:
fieldpath: metadata.namespace

configurations:
- kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
webhookClientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
caBundle: XG4=
caBundle: Cg==
service:
namespace: $(NAMESPACE)
name: webhook-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
webhookClientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
caBundle: XG4=
caBundle: Cg==
service:
namespace: $(NAMESPACE)
name: webhook-service
Expand Down
16 changes: 9 additions & 7 deletions testdata/project-v2/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ bases:
- ../crd
- ../rbac
- ../manager
# - ../webhook
# Comment the next line if you want to disable cert-manager
# - ../certmanager
# [WEBHOOK] Uncomment all the sections with [WEBHOOK] prefix to enable webhook.
#- ../webhook
# [CERTMANAGER] Uncomment next line to enable cert-manager
#- ../certmanager

patches:
- manager_image_patch.yaml
Expand All @@ -33,8 +34,9 @@ patches:
# manager_prometheus_metrics_patch.yaml should be enabled.
#- manager_prometheus_metrics_patch.yaml

# Uncomment the following patch to enable the CA injection in the admission webhooks.
#- webhookcainjection_patch.yaml

# Uncomment the following patch to enable the webhook for the manager.
# [WEBHOOK] Uncomment all the sections with [WEBHOOK] prefix to enable webhook.
#- manager_webhook_patch.yaml

# [CAINJECTION] Uncomment next line to enable the CA injection in the admission webhooks. [CERTMANAGER] needs to be
# enabled to use ca injection
#- webhookcainjection_patch.yaml
14 changes: 2 additions & 12 deletions testdata/project-v2/config/default/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,11 @@ spec:
name: webhook-server
protocol: TCP
volumeMounts:
- mountPath: /tmp/cert
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-secret
---
apiVersion: v1
kind: Service
metadata:
name: webhook-service
namespace: system
spec:
ports:
- port: 443
targetPort: 443
secretName: webhook-server-cert
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
annotations:
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
certmanager.k8s.io/inject-ca-from: $(CERTIFICATENAMESPACE)/$(CERTIFICATENAME)
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
annotations:
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
certmanager.k8s.io/inject-ca-from: $(CERTIFICATENAMESPACE)/$(CERTIFICATENAME)
15 changes: 0 additions & 15 deletions testdata/project-v2/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
resources:
- manager.yaml

# the following config is for teaching kustomize how to do var substitution
# vars:
# - name: NAMESPACE
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
# - name: SERVICENAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
4 changes: 0 additions & 4 deletions testdata/project-v2/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,4 @@ spec:
requests:
cpu: 100m
memory: 20Mi
ports:
- containerPort: 9876
name: webhook-server
protocol: TCP
terminationGracePeriodSeconds: 10
1 change: 1 addition & 0 deletions testdata/project-v2/config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
18 changes: 17 additions & 1 deletion testdata/project-v2/config/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
resources:
- webhookmanifests.yaml # disabled till v2 has webhook support
- webhookmanifests.yaml
- service.yaml

configurations:
- kustomizeconfig.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
- name: NAMESPACE
objref:
kind: Service
version: v1
name: webhook-service
fieldref:
fieldpath: metadata.namespace
- name: SERVICENAME
objref:
kind: Service
version: v1
name: webhook-service
Empty file.

0 comments on commit ee11b10

Please sign in to comment.