Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit d35912c

Browse files
committed
Make operator install KIC CRDs from manifests
1 parent 7e86f89 commit d35912c

12 files changed

+1597
-260
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
OLD_TAG = 0.0.3
12
TAG = 0.0.4
23

34
IMAGE = nginx-ingress-operator
@@ -21,7 +22,7 @@ lint:
2122
golangci-lint run
2223

2324
generate-metadata: generate-crds
24-
operator-sdk generate csv --csv-version $(TAG)
25+
operator-sdk generate csv --csv-version=$(TAG) --from-version=$(OLD_TAG) --make-manifests=false
2526
echo "Metadata generated, please make sure you add/update fields in nginx-ingress-operator.v$(TAG).clusterserviceversion.yaml"
2627

2728
generate-bundle:

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ It is possible to run the operator in your local machine. This is useful for tes
2727
```
2828
kubectl apply -f deploy/crds/k8s.nginx.org_nginxingresscontrollers_crd.yaml
2929
```
30+
1. Apply the NGINX Ingress Controller CRDs:
31+
```
32+
kubectl apply -f build/kic_crds
33+
```
3034
1. Run `make run-local`.
3135
32-
The operator will run in your local machine but will be communicating with the cluster.
36+
The operator will run in your local machine but will be communicating with the cluster. The operator will only watch the `default` namespace when deployed locally.
3337
3438
### Update CRD
3539

build/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ COPY build/bin /usr/local/bin
1111
RUN /usr/local/bin/user_setup
1212

1313
COPY LICENSE /licenses/
14+
COPY build/kic_crds /kic_crds
1415

1516
ENTRYPOINT ["/usr/local/bin/entrypoint"]
1617

build/kic_crds/gc-definition.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: globalconfigurations.k8s.nginx.org
5+
spec:
6+
group: k8s.nginx.org
7+
versions:
8+
- name: v1alpha1
9+
served: true
10+
storage: true
11+
scope: Namespaced
12+
names:
13+
plural: globalconfigurations
14+
singular: globalconfiguration
15+
kind: GlobalConfiguration
16+
shortNames:
17+
- gc
18+
preserveUnknownFields: false
19+
validation:
20+
openAPIV3Schema:
21+
description: GlobalConfiguration defines the GlobalConfiguration resource.
22+
type: object
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: GlobalConfigurationSpec is the spec of the GlobalConfiguration
38+
resource.
39+
type: object
40+
properties:
41+
listeners:
42+
type: array
43+
items:
44+
description: Listener defines a listener.
45+
type: object
46+
properties:
47+
name:
48+
type: string
49+
port:
50+
type: integer
51+
protocol:
52+
type: string

build/kic_crds/policy-definition.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: policies.k8s.nginx.org
5+
spec:
6+
group: k8s.nginx.org
7+
versions:
8+
- name: v1alpha1
9+
served: true
10+
storage: true
11+
scope: Namespaced
12+
names:
13+
plural: policies
14+
singular: policy
15+
kind: Policy
16+
shortNames:
17+
- pol
18+
preserveUnknownFields: false
19+
validation:
20+
openAPIV3Schema:
21+
description: Policy defines a Policy for VirtualServer and VirtualServerRoute
22+
resources.
23+
type: object
24+
properties:
25+
apiVersion:
26+
description: 'APIVersion defines the versioned schema of this representation
27+
of an object. Servers should convert recognized schemas to the latest
28+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
29+
type: string
30+
kind:
31+
description: 'Kind is a string value representing the REST resource this
32+
object represents. Servers may infer this from the endpoint the client
33+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
34+
type: string
35+
metadata:
36+
type: object
37+
spec:
38+
description: 'PolicySpec is the spec of the Policy resource. The spec includes
39+
multiple fields, where each field represents a different policy. Note:
40+
currently we have only one policy -- AccessControl, but we will support
41+
more in the future. Only one policy (field) is allowed.'
42+
type: object
43+
properties:
44+
accessControl:
45+
description: AccessControl defines an access policy based on the source
46+
IP of a request.
47+
type: object
48+
properties:
49+
allow:
50+
type: array
51+
items:
52+
type: string
53+
deny:
54+
type: array
55+
items:
56+
type: string

build/kic_crds/ts-definition.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: transportservers.k8s.nginx.org
5+
spec:
6+
group: k8s.nginx.org
7+
versions:
8+
- name: v1alpha1
9+
served: true
10+
storage: true
11+
scope: Namespaced
12+
names:
13+
plural: transportservers
14+
singular: transportserver
15+
kind: TransportServer
16+
shortNames:
17+
- ts
18+
preserveUnknownFields: false
19+
validation:
20+
openAPIV3Schema:
21+
description: TransportServer defines the TransportServer resource.
22+
type: object
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: TransportServerSpec is the spec of the TransportServer resource.
38+
type: object
39+
properties:
40+
action:
41+
description: Action defines an action.
42+
type: object
43+
properties:
44+
pass:
45+
type: string
46+
host:
47+
type: string
48+
listener:
49+
description: TransportServerListener defines a listener for a TransportServer.
50+
type: object
51+
properties:
52+
name:
53+
type: string
54+
protocol:
55+
type: string
56+
upstreamParameters:
57+
description: UpstreamParameters defines parameters for an upstream.
58+
type: object
59+
properties:
60+
udpRequests:
61+
type: integer
62+
udpResponses:
63+
type: integer
64+
upstreams:
65+
type: array
66+
items:
67+
description: Upstream defines an upstream.
68+
type: object
69+
properties:
70+
name:
71+
type: string
72+
port:
73+
type: integer
74+
service:
75+
type: string

0 commit comments

Comments
 (0)