Skip to content

Commit 0432a04

Browse files
committed
Working to provide a resource to hold tsuru app router ips
1 parent 0316fc3 commit 0432a04

16 files changed

+424
-328
lines changed

PROJECT

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ resources:
1717
version: v1alpha1
1818
- api:
1919
crdVersion: v1
20-
namespaced: false
2120
controller: true
2221
domain: extensions.tsuru.io
2322
kind: ACLDNSEntry
2423
path: github.com/tsuru/acl-operator/api/v1alpha1
2524
version: v1alpha1
25+
- api:
26+
crdVersion: v1
27+
namespaced: true
28+
controller: true
29+
domain: extensions.tsuru.io
30+
kind: TsuruAppAdress
31+
path: github.com/tsuru/acl-operator/api/v1alpha1
32+
version: v1alpha1
2633
version: "3"

api/v1alpha1/zz_generated.deepcopy.go

+94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/extensions.tsuru.io_acls.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ spec:
124124
type: boolean
125125
reason:
126126
type: string
127+
warningErrors:
128+
items:
129+
type: string
130+
type: array
127131
required:
128132
- ready
129133
type: object
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.9.0
7+
creationTimestamp: null
8+
name: tsuruappadresses.extensions.tsuru.io
9+
spec:
10+
group: extensions.tsuru.io
11+
names:
12+
kind: TsuruAppAdress
13+
listKind: TsuruAppAdressList
14+
plural: tsuruappadresses
15+
singular: tsuruappadress
16+
scope: Cluster
17+
versions:
18+
- name: v1alpha1
19+
schema:
20+
openAPIV3Schema:
21+
description: TsuruAppAdress is the Schema for the tsuruappadresses API
22+
properties:
23+
apiVersion:
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
27+
type: string
28+
kind:
29+
description: 'Kind is a string value representing the REST resource this
30+
object represents. Servers may infer this from the endpoint the client
31+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
32+
type: string
33+
metadata:
34+
type: object
35+
spec:
36+
description: TsuruAppAdressSpec defines the desired state of TsuruAppAdress
37+
properties:
38+
name:
39+
type: string
40+
type: object
41+
status:
42+
description: TsuruAppAdressStatus defines the observed state of TsuruAppAdress
43+
properties:
44+
ready:
45+
type: boolean
46+
routerIPs:
47+
items:
48+
type: string
49+
type: array
50+
updatedAt:
51+
type: string
52+
required:
53+
- ready
54+
- routerIPs
55+
type: object
56+
type: object
57+
served: true
58+
storage: true
59+
subresources:
60+
status: {}

config/crd/kustomization.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
resources:
55
- bases/cache.extensions.tsuru.io_acls.yaml
66
- bases/extensions.tsuru.io_ACLDNSEntrys.yaml
7+
- bases/extensions.tsuru.io_tsuruappadresses.yaml
78
#+kubebuilder:scaffold:crdkustomizeresource
89

910
patchesStrategicMerge:
1011
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1112
# patches here are for enabling the conversion webhook for each CRD
1213
#- patches/webhook_in_acls.yaml
1314
#- patches/webhook_in_ACLDNSEntrys.yaml
15+
#- patches/webhook_in_tsuruappadresses.yaml
1416
#+kubebuilder:scaffold:crdkustomizewebhookpatch
1517

1618
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
1719
# patches here are for enabling the CA injection for each CRD
1820
#- patches/cainjection_in_acls.yaml
1921
#- patches/cainjection_in_ACLDNSEntrys.yaml
22+
#- patches/cainjection_in_tsuruappadresses.yaml
2023
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
2124

2225
# the following config is for teaching kustomize how to do kustomization for CRDs.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The following patch adds a directive for certmanager to inject CA into the CRD
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
7+
name: tsuruappadresses.extensions.tsuru.io
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# The following patch enables a conversion webhook for the CRD
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
name: tsuruappadresses.extensions.tsuru.io
6+
spec:
7+
conversion:
8+
strategy: Webhook
9+
webhook:
10+
clientConfig:
11+
service:
12+
namespace: system
13+
name: webhook-service
14+
path: /convert
15+
conversionReviewVersions:
16+
- v1

config/rbac/role.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,29 @@ rules:
5757
- get
5858
- patch
5959
- update
60+
- apiGroups:
61+
- extensions.tsuru.io
62+
resources:
63+
- tsuruappadresses
64+
verbs:
65+
- create
66+
- delete
67+
- get
68+
- list
69+
- patch
70+
- update
71+
- watch
72+
- apiGroups:
73+
- extensions.tsuru.io
74+
resources:
75+
- tsuruappadresses/finalizers
76+
verbs:
77+
- update
78+
- apiGroups:
79+
- extensions.tsuru.io
80+
resources:
81+
- tsuruappadresses/status
82+
verbs:
83+
- get
84+
- patch
85+
- update
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# permissions for end users to edit tsuruappadresses.
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: tsuruappadress-editor-role
6+
rules:
7+
- apiGroups:
8+
- extensions.tsuru.io
9+
resources:
10+
- tsuruappadresses
11+
verbs:
12+
- create
13+
- delete
14+
- get
15+
- list
16+
- patch
17+
- update
18+
- watch
19+
- apiGroups:
20+
- extensions.tsuru.io
21+
resources:
22+
- tsuruappadresses/status
23+
verbs:
24+
- get
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# permissions for end users to view tsuruappadresses.
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: tsuruappadress-viewer-role
6+
rules:
7+
- apiGroups:
8+
- extensions.tsuru.io
9+
resources:
10+
- tsuruappadresses
11+
verbs:
12+
- get
13+
- list
14+
- watch
15+
- apiGroups:
16+
- extensions.tsuru.io
17+
resources:
18+
- tsuruappadresses/status
19+
verbs:
20+
- get
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: extensions.tsuru.io/v1alpha1
2+
kind: TsuruAppAdress
3+
metadata:
4+
name: tsuruappadress-sample
5+
spec:
6+
# TODO(user): Add fields here

config/samples/kustomization.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
resources:
33
- cache_v1alpha1_acl.yaml
44
- _v1alpha1_ACLDNSEntry.yaml
5+
- _v1alpha1_tsuruappadress.yaml
56
#+kubebuilder:scaffold:manifestskustomizesamples

0 commit comments

Comments
 (0)