Skip to content

Commit ba056d0

Browse files
committedNov 16, 2022
generate all-in-one yaml
1 parent 84e16c3 commit ba056d0

File tree

1 file changed

+716
-0
lines changed

1 file changed

+716
-0
lines changed
 
+716
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,716 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.8.0
6+
creationTimestamp: null
7+
name: deploymentcopies.duplication.k8s.wantedly.com
8+
spec:
9+
group: duplication.k8s.wantedly.com
10+
names:
11+
kind: DeploymentCopy
12+
listKind: DeploymentCopyList
13+
plural: deploymentcopies
14+
singular: deploymentcopy
15+
scope: Namespaced
16+
versions:
17+
- name: v1beta1
18+
schema:
19+
openAPIV3Schema:
20+
description: DeploymentCopy is the Schema for the deploymentcopies API
21+
properties:
22+
apiVersion:
23+
description: 'APIVersion defines the versioned schema of this representation
24+
of an object. Servers should convert recognized schemas to the latest
25+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
26+
type: string
27+
kind:
28+
description: 'Kind is a string value representing the REST resource this
29+
object represents. Servers may infer this from the endpoint the client
30+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
31+
type: string
32+
metadata:
33+
type: object
34+
spec:
35+
description: DeploymentCopySpec defines the desired state of DeploymentCopy
36+
properties:
37+
customAnnotations:
38+
additionalProperties:
39+
type: string
40+
description: annotations in `CustomAnnotations` and those of `TargetDeploymentName`
41+
will be merged. When both have same keys, values in `Labels` will
42+
be applied
43+
type: object
44+
customLabels:
45+
additionalProperties:
46+
type: string
47+
description: labels in `CustomLabels` and those of `TargetDeploymentName`
48+
will be merged. When both have same keys, values in `Labels` will
49+
be applied This will also used for `Spec.Template.Labels` and `Spec.Selector.MatchLabels`
50+
of copied Deployment
51+
type: object
52+
hostname:
53+
description: (optional) if defined, the copied deployment will have
54+
the specified Hostname
55+
type: string
56+
nameSuffix:
57+
description: (optional) if defined, the copied deployment will have
58+
suffix with this value. When not defined, `.Matadata.Name` will
59+
be used
60+
type: string
61+
replicas:
62+
description: If non-zero, Replicas will be used for replicas for the
63+
copied deployment
64+
format: int32
65+
type: integer
66+
targetContainers:
67+
description: name defined in `TargetDeploymentName` will be copied
68+
items:
69+
description: Container should be compatible with "k8s.io/api/apps/v1".Container,
70+
so that we can support more fields later on
71+
properties:
72+
env:
73+
items:
74+
description: EnvVar represents an environment variable present
75+
in a Container.
76+
properties:
77+
name:
78+
description: Name of the environment variable. Must be
79+
a C_IDENTIFIER.
80+
type: string
81+
value:
82+
description: 'Variable references $(VAR_NAME) are expanded
83+
using the previously defined environment variables in
84+
the container and any service environment variables.
85+
If a variable cannot be resolved, the reference in the
86+
input string will be unchanged. Double $$ are reduced
87+
to a single $, which allows for escaping the $(VAR_NAME)
88+
syntax: i.e. "$$(VAR_NAME)" will produce the string
89+
literal "$(VAR_NAME)". Escaped references will never
90+
be expanded, regardless of whether the variable exists
91+
or not. Defaults to "".'
92+
type: string
93+
valueFrom:
94+
description: Source for the environment variable's value.
95+
Cannot be used if value is not empty.
96+
properties:
97+
configMapKeyRef:
98+
description: Selects a key of a ConfigMap.
99+
properties:
100+
key:
101+
description: The key to select.
102+
type: string
103+
name:
104+
description: 'Name of the referent. More info:
105+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
106+
TODO: Add other useful fields. apiVersion, kind,
107+
uid?'
108+
type: string
109+
optional:
110+
description: Specify whether the ConfigMap or
111+
its key must be defined
112+
type: boolean
113+
required:
114+
- key
115+
type: object
116+
fieldRef:
117+
description: 'Selects a field of the pod: supports
118+
metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`,
119+
`metadata.annotations[''<KEY>'']`, spec.nodeName,
120+
spec.serviceAccountName, status.hostIP, status.podIP,
121+
status.podIPs.'
122+
properties:
123+
apiVersion:
124+
description: Version of the schema the FieldPath
125+
is written in terms of, defaults to "v1".
126+
type: string
127+
fieldPath:
128+
description: Path of the field to select in the
129+
specified API version.
130+
type: string
131+
required:
132+
- fieldPath
133+
type: object
134+
resourceFieldRef:
135+
description: 'Selects a resource of the container:
136+
only resources limits and requests (limits.cpu,
137+
limits.memory, limits.ephemeral-storage, requests.cpu,
138+
requests.memory and requests.ephemeral-storage)
139+
are currently supported.'
140+
properties:
141+
containerName:
142+
description: 'Container name: required for volumes,
143+
optional for env vars'
144+
type: string
145+
divisor:
146+
anyOf:
147+
- type: integer
148+
- type: string
149+
description: Specifies the output format of the
150+
exposed resources, defaults to "1"
151+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
152+
x-kubernetes-int-or-string: true
153+
resource:
154+
description: 'Required: resource to select'
155+
type: string
156+
required:
157+
- resource
158+
type: object
159+
secretKeyRef:
160+
description: Selects a key of a secret in the pod's
161+
namespace
162+
properties:
163+
key:
164+
description: The key of the secret to select from. Must
165+
be a valid secret key.
166+
type: string
167+
name:
168+
description: 'Name of the referent. More info:
169+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
170+
TODO: Add other useful fields. apiVersion, kind,
171+
uid?'
172+
type: string
173+
optional:
174+
description: Specify whether the Secret or its
175+
key must be defined
176+
type: boolean
177+
required:
178+
- key
179+
type: object
180+
type: object
181+
required:
182+
- name
183+
type: object
184+
type: array
185+
image:
186+
type: string
187+
name:
188+
type: string
189+
required:
190+
- env
191+
- image
192+
- name
193+
type: object
194+
type: array
195+
targetDeploymentName:
196+
description: name defined in `TargetDeploymentName` will be copied
197+
type: string
198+
required:
199+
- hostname
200+
- nameSuffix
201+
- replicas
202+
- targetContainers
203+
- targetDeploymentName
204+
type: object
205+
status:
206+
description: DeploymentCopyStatus defines the observed state of DeploymentCopy
207+
type: object
208+
type: object
209+
served: true
210+
storage: true
211+
subresources:
212+
status: {}
213+
status:
214+
acceptedNames:
215+
kind: ""
216+
plural: ""
217+
conditions: []
218+
storedVersions: []
219+
---
220+
apiVersion: v1
221+
kind: Namespace
222+
metadata:
223+
labels:
224+
control-plane: controller-manager
225+
name: deployment-duplicator-system
226+
---
227+
apiVersion: apiextensions.k8s.io/v1
228+
kind: CustomResourceDefinition
229+
metadata:
230+
annotations:
231+
controller-gen.kubebuilder.io/version: v0.8.0
232+
creationTimestamp: null
233+
name: deploymentcopies.duplication.k8s.wantedly.com
234+
spec:
235+
group: duplication.k8s.wantedly.com
236+
names:
237+
kind: DeploymentCopy
238+
listKind: DeploymentCopyList
239+
plural: deploymentcopies
240+
singular: deploymentcopy
241+
scope: Namespaced
242+
versions:
243+
- name: v1beta1
244+
schema:
245+
openAPIV3Schema:
246+
description: DeploymentCopy is the Schema for the deploymentcopies API
247+
properties:
248+
apiVersion:
249+
description: 'APIVersion defines the versioned schema of this representation
250+
of an object. Servers should convert recognized schemas to the latest
251+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
252+
type: string
253+
kind:
254+
description: 'Kind is a string value representing the REST resource this
255+
object represents. Servers may infer this from the endpoint the client
256+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
257+
type: string
258+
metadata:
259+
type: object
260+
spec:
261+
description: DeploymentCopySpec defines the desired state of DeploymentCopy
262+
properties:
263+
customAnnotations:
264+
additionalProperties:
265+
type: string
266+
description: annotations in `CustomAnnotations` and those of `TargetDeploymentName`
267+
will be merged. When both have same keys, values in `Labels` will
268+
be applied
269+
type: object
270+
customLabels:
271+
additionalProperties:
272+
type: string
273+
description: labels in `CustomLabels` and those of `TargetDeploymentName`
274+
will be merged. When both have same keys, values in `Labels` will
275+
be applied This will also used for `Spec.Template.Labels` and `Spec.Selector.MatchLabels`
276+
of copied Deployment
277+
type: object
278+
hostname:
279+
description: (optional) if defined, the copied deployment will have
280+
the specified Hostname
281+
type: string
282+
nameSuffix:
283+
description: (optional) if defined, the copied deployment will have
284+
suffix with this value. When not defined, `.Matadata.Name` will
285+
be used
286+
type: string
287+
replicas:
288+
description: If non-zero, Replicas will be used for replicas for the
289+
copied deployment
290+
format: int32
291+
type: integer
292+
targetContainers:
293+
description: name defined in `TargetDeploymentName` will be copied
294+
items:
295+
description: Container should be compatible with "k8s.io/api/apps/v1".Container,
296+
so that we can support more fields later on
297+
properties:
298+
env:
299+
items:
300+
description: EnvVar represents an environment variable present
301+
in a Container.
302+
properties:
303+
name:
304+
description: Name of the environment variable. Must be
305+
a C_IDENTIFIER.
306+
type: string
307+
value:
308+
description: 'Variable references $(VAR_NAME) are expanded
309+
using the previously defined environment variables in
310+
the container and any service environment variables.
311+
If a variable cannot be resolved, the reference in the
312+
input string will be unchanged. Double $$ are reduced
313+
to a single $, which allows for escaping the $(VAR_NAME)
314+
syntax: i.e. "$$(VAR_NAME)" will produce the string
315+
literal "$(VAR_NAME)". Escaped references will never
316+
be expanded, regardless of whether the variable exists
317+
or not. Defaults to "".'
318+
type: string
319+
valueFrom:
320+
description: Source for the environment variable's value.
321+
Cannot be used if value is not empty.
322+
properties:
323+
configMapKeyRef:
324+
description: Selects a key of a ConfigMap.
325+
properties:
326+
key:
327+
description: The key to select.
328+
type: string
329+
name:
330+
description: 'Name of the referent. More info:
331+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
332+
TODO: Add other useful fields. apiVersion, kind,
333+
uid?'
334+
type: string
335+
optional:
336+
description: Specify whether the ConfigMap or
337+
its key must be defined
338+
type: boolean
339+
required:
340+
- key
341+
type: object
342+
fieldRef:
343+
description: 'Selects a field of the pod: supports
344+
metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`,
345+
`metadata.annotations[''<KEY>'']`, spec.nodeName,
346+
spec.serviceAccountName, status.hostIP, status.podIP,
347+
status.podIPs.'
348+
properties:
349+
apiVersion:
350+
description: Version of the schema the FieldPath
351+
is written in terms of, defaults to "v1".
352+
type: string
353+
fieldPath:
354+
description: Path of the field to select in the
355+
specified API version.
356+
type: string
357+
required:
358+
- fieldPath
359+
type: object
360+
resourceFieldRef:
361+
description: 'Selects a resource of the container:
362+
only resources limits and requests (limits.cpu,
363+
limits.memory, limits.ephemeral-storage, requests.cpu,
364+
requests.memory and requests.ephemeral-storage)
365+
are currently supported.'
366+
properties:
367+
containerName:
368+
description: 'Container name: required for volumes,
369+
optional for env vars'
370+
type: string
371+
divisor:
372+
anyOf:
373+
- type: integer
374+
- type: string
375+
description: Specifies the output format of the
376+
exposed resources, defaults to "1"
377+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
378+
x-kubernetes-int-or-string: true
379+
resource:
380+
description: 'Required: resource to select'
381+
type: string
382+
required:
383+
- resource
384+
type: object
385+
secretKeyRef:
386+
description: Selects a key of a secret in the pod's
387+
namespace
388+
properties:
389+
key:
390+
description: The key of the secret to select from. Must
391+
be a valid secret key.
392+
type: string
393+
name:
394+
description: 'Name of the referent. More info:
395+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
396+
TODO: Add other useful fields. apiVersion, kind,
397+
uid?'
398+
type: string
399+
optional:
400+
description: Specify whether the Secret or its
401+
key must be defined
402+
type: boolean
403+
required:
404+
- key
405+
type: object
406+
type: object
407+
required:
408+
- name
409+
type: object
410+
type: array
411+
image:
412+
type: string
413+
name:
414+
type: string
415+
required:
416+
- env
417+
- image
418+
- name
419+
type: object
420+
type: array
421+
targetDeploymentName:
422+
description: name defined in `TargetDeploymentName` will be copied
423+
type: string
424+
required:
425+
- hostname
426+
- nameSuffix
427+
- replicas
428+
- targetContainers
429+
- targetDeploymentName
430+
type: object
431+
status:
432+
description: DeploymentCopyStatus defines the observed state of DeploymentCopy
433+
type: object
434+
type: object
435+
served: true
436+
storage: true
437+
subresources:
438+
status: {}
439+
status:
440+
acceptedNames:
441+
kind: ""
442+
plural: ""
443+
conditions: []
444+
storedVersions: []
445+
---
446+
apiVersion: v1
447+
kind: ServiceAccount
448+
metadata:
449+
name: deployment-duplicator-controller-manager
450+
namespace: deployment-duplicator-system
451+
---
452+
apiVersion: rbac.authorization.k8s.io/v1
453+
kind: Role
454+
metadata:
455+
name: deployment-duplicator-leader-election-role
456+
namespace: deployment-duplicator-system
457+
rules:
458+
- apiGroups:
459+
- ""
460+
resources:
461+
- configmaps
462+
verbs:
463+
- get
464+
- list
465+
- watch
466+
- create
467+
- update
468+
- patch
469+
- delete
470+
- apiGroups:
471+
- coordination.k8s.io
472+
resources:
473+
- leases
474+
verbs:
475+
- get
476+
- list
477+
- watch
478+
- create
479+
- update
480+
- patch
481+
- delete
482+
- apiGroups:
483+
- ""
484+
resources:
485+
- events
486+
verbs:
487+
- create
488+
- patch
489+
---
490+
apiVersion: rbac.authorization.k8s.io/v1
491+
kind: ClusterRole
492+
metadata:
493+
creationTimestamp: null
494+
name: deployment-duplicator-manager-role
495+
rules:
496+
- apiGroups:
497+
- apps
498+
resources:
499+
- deployments
500+
verbs:
501+
- create
502+
- delete
503+
- get
504+
- list
505+
- patch
506+
- update
507+
- watch
508+
- apiGroups:
509+
- apps
510+
resources:
511+
- deployments/status
512+
verbs:
513+
- get
514+
- patch
515+
- update
516+
- apiGroups:
517+
- duplication.k8s.wantedly.com
518+
resources:
519+
- deploymentcopies
520+
verbs:
521+
- create
522+
- delete
523+
- get
524+
- list
525+
- patch
526+
- update
527+
- watch
528+
- apiGroups:
529+
- duplication.k8s.wantedly.com
530+
resources:
531+
- deploymentcopies/finalizers
532+
verbs:
533+
- update
534+
- apiGroups:
535+
- duplication.k8s.wantedly.com
536+
resources:
537+
- deploymentcopies/status
538+
verbs:
539+
- get
540+
- patch
541+
- update
542+
---
543+
apiVersion: rbac.authorization.k8s.io/v1
544+
kind: ClusterRole
545+
metadata:
546+
name: deployment-duplicator-metrics-reader
547+
rules:
548+
- nonResourceURLs:
549+
- /metrics
550+
verbs:
551+
- get
552+
---
553+
apiVersion: rbac.authorization.k8s.io/v1
554+
kind: ClusterRole
555+
metadata:
556+
name: deployment-duplicator-proxy-role
557+
rules:
558+
- apiGroups:
559+
- authentication.k8s.io
560+
resources:
561+
- tokenreviews
562+
verbs:
563+
- create
564+
- apiGroups:
565+
- authorization.k8s.io
566+
resources:
567+
- subjectaccessreviews
568+
verbs:
569+
- create
570+
---
571+
apiVersion: rbac.authorization.k8s.io/v1
572+
kind: RoleBinding
573+
metadata:
574+
name: deployment-duplicator-leader-election-rolebinding
575+
namespace: deployment-duplicator-system
576+
roleRef:
577+
apiGroup: rbac.authorization.k8s.io
578+
kind: Role
579+
name: deployment-duplicator-leader-election-role
580+
subjects:
581+
- kind: ServiceAccount
582+
name: deployment-duplicator-controller-manager
583+
namespace: deployment-duplicator-system
584+
---
585+
apiVersion: rbac.authorization.k8s.io/v1
586+
kind: ClusterRoleBinding
587+
metadata:
588+
name: deployment-duplicator-manager-rolebinding
589+
roleRef:
590+
apiGroup: rbac.authorization.k8s.io
591+
kind: ClusterRole
592+
name: deployment-duplicator-manager-role
593+
subjects:
594+
- kind: ServiceAccount
595+
name: deployment-duplicator-controller-manager
596+
namespace: deployment-duplicator-system
597+
---
598+
apiVersion: rbac.authorization.k8s.io/v1
599+
kind: ClusterRoleBinding
600+
metadata:
601+
name: deployment-duplicator-proxy-rolebinding
602+
roleRef:
603+
apiGroup: rbac.authorization.k8s.io
604+
kind: ClusterRole
605+
name: deployment-duplicator-proxy-role
606+
subjects:
607+
- kind: ServiceAccount
608+
name: deployment-duplicator-controller-manager
609+
namespace: deployment-duplicator-system
610+
---
611+
apiVersion: v1
612+
data:
613+
controller_manager_config.yaml: |
614+
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
615+
kind: ControllerManagerConfig
616+
health:
617+
healthProbeBindAddress: :8081
618+
metrics:
619+
bindAddress: 127.0.0.1:8080
620+
webhook:
621+
port: 9443
622+
leaderElection:
623+
leaderElect: true
624+
resourceName: 3025a49c.k8s.wantedly.com
625+
kind: ConfigMap
626+
metadata:
627+
name: deployment-duplicator-manager-config
628+
namespace: deployment-duplicator-system
629+
---
630+
apiVersion: v1
631+
kind: Service
632+
metadata:
633+
labels:
634+
control-plane: controller-manager
635+
name: deployment-duplicator-controller-manager-metrics-service
636+
namespace: deployment-duplicator-system
637+
spec:
638+
ports:
639+
- name: https
640+
port: 8443
641+
protocol: TCP
642+
targetPort: https
643+
selector:
644+
control-plane: controller-manager
645+
---
646+
apiVersion: apps/v1
647+
kind: Deployment
648+
metadata:
649+
labels:
650+
control-plane: controller-manager
651+
name: deployment-duplicator-controller-manager
652+
namespace: deployment-duplicator-system
653+
spec:
654+
replicas: 1
655+
selector:
656+
matchLabels:
657+
control-plane: controller-manager
658+
template:
659+
metadata:
660+
annotations:
661+
kubectl.kubernetes.io/default-container: manager
662+
labels:
663+
control-plane: controller-manager
664+
spec:
665+
containers:
666+
- args:
667+
- --secure-listen-address=0.0.0.0:8443
668+
- --upstream=http://127.0.0.1:8080/
669+
- --logtostderr=true
670+
- --v=0
671+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
672+
name: kube-rbac-proxy
673+
ports:
674+
- containerPort: 8443
675+
name: https
676+
protocol: TCP
677+
resources:
678+
limits:
679+
cpu: 500m
680+
memory: 128Mi
681+
requests:
682+
cpu: 5m
683+
memory: 64Mi
684+
- args:
685+
- --health-probe-bind-address=:8081
686+
- --metrics-bind-address=127.0.0.1:8080
687+
- --leader-elect
688+
command:
689+
- /manager
690+
image: quay.io/wantedly/deployment-duplicator:latest
691+
livenessProbe:
692+
httpGet:
693+
path: /healthz
694+
port: 8081
695+
initialDelaySeconds: 15
696+
periodSeconds: 20
697+
name: manager
698+
readinessProbe:
699+
httpGet:
700+
path: /readyz
701+
port: 8081
702+
initialDelaySeconds: 5
703+
periodSeconds: 10
704+
resources:
705+
limits:
706+
cpu: 500m
707+
memory: 128Mi
708+
requests:
709+
cpu: 10m
710+
memory: 64Mi
711+
securityContext:
712+
allowPrivilegeEscalation: false
713+
securityContext:
714+
runAsNonRoot: true
715+
serviceAccountName: deployment-duplicator-controller-manager
716+
terminationGracePeriodSeconds: 10

0 commit comments

Comments
 (0)
Please sign in to comment.