Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gatewayservice-operator/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
)

// Change below variables to serve metrics on different host or port.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: gatewayservices.crd.xunholy.github.com
spec:
group: crd.xunholy.github.com
names:
kind: GatewayService
listKind: GatewayServiceList
plural: gatewayservices
shortNames:
- gs
singular: gatewayservice
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: GatewayService is the Schema for the gatewayservice API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: GatewayServiceSpec defines the desired state of GatewayService
properties:
caCertificates:
description: REQUIRED if mode is `MUTUAL`.
type: string
hosts:
description: List of Servers > map of list of hosts and port
items:
type: string
minItems: 1
type: array
httpsRedirect:
description: Will redirect traffic from HTTP to HTTPS.
type: boolean
maxProtocolVersion:
description: 'Optional: Maximum TLS protocol version.'
enum:
- TLS_AUTO
- TLSV1_0
- TLSV1_1
- TLSV1_2
- TLSV1_3
type: string
minProtocolVersion:
description: 'Optional: Minimum TLS protocol version.'
enum:
- TLS_AUTO
- TLSV1_0
- TLSV1_1
- TLSV1_2
- TLSV1_3
type: string
mode:
description: 'Options: SIMPLE|PASSTHROUGH|MUTUAL|ISTIO_MUTUAL|AUTO_PASSTHROUGH'
enum:
- SIMPLE
- PASSTHROUGH
- MUTUAL
- ISTIO_MUTUAL
- AUTO_PASSTHROUGH
type: string
port:
format: int32
maximum: 65535
minimum: 1
type: integer
protocol:
description: 'Options: HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS'
enum:
- HTTP
- HTTPS
- GRPC
- HTTP2
- MONGO
- TCP
- TLS
type: string
tlsOptions:
description: 'Options: TLSSecret|TLSSecretRef|TLSSecretPath Supports
either creating the secret, referencing the secret, or explicitly
referencing the mount path in the pod.'
properties:
tlsSecret:
description: Specifies TLS Cert/Key to be created
properties:
cert:
description: Secret map with each key which is base64 encoded
type: string
key:
description: Secret map with each key which is base64 encoded
type: string
type: object
tlsSecretPath:
description: Specifies TLS Cert/Key Path if not using SDS
properties:
certPath:
description: Specifies the TLS Certificate Path in the running
Pod
type: string
keyPath:
description: Specifies the TLS Key Path in the running Pod
type: string
type: object
tlsSecretRef:
description: Specifies the TLS Secret
properties:
secretName:
type: string
type: object
type: object
trafficType:
description: 'Options: "ingress" or "egress"'
enum:
- ingress
- egress
type: string
required:
- hosts
- mode
- port
- protocol
- trafficType
type: object
status:
description: GatewayServiceStatus defines the observed state of GatewayService
properties:
condition:
description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
of cluster Important: Run "operator-sdk generate k8s" to regenerate
code after modifying this file Add custom validation using kubebuilder
tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
properties:
createdSecretDetails:
description: If TLSSecret has been specificed in the Spec a secret
will be created otherwise this field is omit.
properties:
secretName:
description: Secret name that was created due to TLSSecret being
supplied in Spec.
type: string
secretNamespace:
description: Namespace in which the secret was created - this
may vary depending on Mode. EG. SIMPLE will result in a secret
created in istio-system. However, PASSTHROUGH will result
in a secret created in the namespace the CRD is applied.
type: string
type: object
errorMessage:
description: Depending on whether success is false the message will
contain the error or cause of failure. However, if success is
true the message will simple return a default success message.
type: string
success:
description: If the CRD was reconciled correctly without error success
will result in true.
type: boolean
type: object
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
37 changes: 21 additions & 16 deletions gatewayservice-operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,37 @@ require (
github.com/spf13/pflag v1.0.3
istio.io/api v0.0.0-20191029012234-9fe6a7da3673
istio.io/client-go v0.0.0-20191024204624-13a7366c1cab
k8s.io/api v0.0.0-20190612125737-db0771252981
k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2
k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8
k8s.io/client-go v11.0.0+incompatible
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208
sigs.k8s.io/controller-runtime v0.1.12
sigs.k8s.io/controller-tools v0.1.10
sigs.k8s.io/controller-runtime v0.3.0
sigs.k8s.io/controller-tools v0.2.2
sigs.k8s.io/testing_frameworks v0.1.2 // indirect
)

// Pinned to kubernetes-1.13.4
replace (
k8s.io/api => k8s.io/api v0.0.0-20190222213804-5cb15d344471
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628
k8s.io/client-go => k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4
k8s.io/kube-state-metrics => k8s.io/kube-state-metrics v1.6.0
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.3.0
sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde
)

// Pinned to kubernetes-1.14.1
replace (
github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.29.0
// Pinned to v2.9.2 (kubernetes-1.13.1) so https://proxy.golang.org can
k8s.io/api => k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d
k8s.io/client-go => k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190409023720-1bc0c81fa51d
)

replace (
github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.31.1
// Pinned to v2.10.0 (kubernetes-1.14.1) so https://proxy.golang.org can
// resolve it correctly.
github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20190424153033-d3245f150225
k8s.io/kube-state-metrics => k8s.io/kube-state-metrics v1.6.0
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.1.12
sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde
github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20190525122359-d20e84d0fb64
)

replace github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.10.0
replace github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.11.0

go 1.13
Loading