-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from Jooho/internal_hostname_gateway
Feature: Create cert Secret and update KServe local gateway
- Loading branch information
Showing
22 changed files
with
1,249 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,258 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
labels: | ||
app: istio-pilot | ||
chart: istio | ||
heritage: Tiller | ||
maistra-version: 2.5.2 | ||
release: istio | ||
name: gateways.networking.istio.io | ||
spec: | ||
conversion: | ||
strategy: None | ||
group: networking.istio.io | ||
names: | ||
categories: | ||
- istio-io | ||
- networking-istio-io | ||
kind: Gateway | ||
listKind: GatewayList | ||
plural: gateways | ||
shortNames: | ||
- gw | ||
singular: gateway | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha3 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
description: 'Configuration affecting edge load balancer. See more details | ||
at: https://istio.io/docs/reference/config/networking/gateway.html' | ||
properties: | ||
selector: | ||
additionalProperties: | ||
type: string | ||
type: object | ||
servers: | ||
description: A list of server specifications. | ||
items: | ||
properties: | ||
bind: | ||
type: string | ||
defaultEndpoint: | ||
type: string | ||
hosts: | ||
description: One or more hosts exposed by this gateway. | ||
items: | ||
type: string | ||
type: array | ||
name: | ||
description: An optional name of the server, when set must be | ||
unique across all servers. | ||
type: string | ||
port: | ||
properties: | ||
name: | ||
description: Label assigned to the port. | ||
type: string | ||
number: | ||
description: A valid non-negative integer port number. | ||
type: integer | ||
protocol: | ||
description: The protocol exposed on the port. | ||
type: string | ||
targetPort: | ||
type: integer | ||
type: object | ||
tls: | ||
description: Set of TLS related options that govern the server's | ||
behavior. | ||
properties: | ||
caCertificates: | ||
description: REQUIRED if mode is `MUTUAL`. | ||
type: string | ||
cipherSuites: | ||
description: 'Optional: If specified, only support the specified | ||
cipher list.' | ||
items: | ||
type: string | ||
type: array | ||
credentialName: | ||
type: string | ||
httpsRedirect: | ||
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: | ||
enum: | ||
- PASSTHROUGH | ||
- SIMPLE | ||
- MUTUAL | ||
- AUTO_PASSTHROUGH | ||
- ISTIO_MUTUAL | ||
type: string | ||
privateKey: | ||
description: REQUIRED if mode is `SIMPLE` or `MUTUAL`. | ||
type: string | ||
serverCertificate: | ||
description: REQUIRED if mode is `SIMPLE` or `MUTUAL`. | ||
type: string | ||
subjectAltNames: | ||
items: | ||
type: string | ||
type: array | ||
verifyCertificateHash: | ||
items: | ||
type: string | ||
type: array | ||
verifyCertificateSpki: | ||
items: | ||
type: string | ||
type: array | ||
type: object | ||
type: object | ||
type: array | ||
type: object | ||
status: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
- name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
description: 'Configuration affecting edge load balancer. See more details | ||
at: https://istio.io/docs/reference/config/networking/gateway.html' | ||
properties: | ||
selector: | ||
additionalProperties: | ||
type: string | ||
type: object | ||
servers: | ||
description: A list of server specifications. | ||
items: | ||
properties: | ||
bind: | ||
type: string | ||
defaultEndpoint: | ||
type: string | ||
hosts: | ||
description: One or more hosts exposed by this gateway. | ||
items: | ||
type: string | ||
type: array | ||
name: | ||
description: An optional name of the server, when set must be | ||
unique across all servers. | ||
type: string | ||
port: | ||
properties: | ||
name: | ||
description: Label assigned to the port. | ||
type: string | ||
number: | ||
description: A valid non-negative integer port number. | ||
type: integer | ||
protocol: | ||
description: The protocol exposed on the port. | ||
type: string | ||
targetPort: | ||
type: integer | ||
type: object | ||
tls: | ||
description: Set of TLS related options that govern the server's | ||
behavior. | ||
properties: | ||
caCertificates: | ||
description: REQUIRED if mode is `MUTUAL`. | ||
type: string | ||
cipherSuites: | ||
description: 'Optional: If specified, only support the specified | ||
cipher list.' | ||
items: | ||
type: string | ||
type: array | ||
credentialName: | ||
type: string | ||
httpsRedirect: | ||
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: | ||
enum: | ||
- PASSTHROUGH | ||
- SIMPLE | ||
- MUTUAL | ||
- AUTO_PASSTHROUGH | ||
- ISTIO_MUTUAL | ||
type: string | ||
privateKey: | ||
description: REQUIRED if mode is `SIMPLE` or `MUTUAL`. | ||
type: string | ||
serverCertificate: | ||
description: REQUIRED if mode is `SIMPLE` or `MUTUAL`. | ||
type: string | ||
subjectAltNames: | ||
items: | ||
type: string | ||
type: array | ||
verifyCertificateHash: | ||
items: | ||
type: string | ||
type: array | ||
verifyCertificateSpki: | ||
items: | ||
type: string | ||
type: array | ||
type: object | ||
type: object | ||
type: array | ||
type: object | ||
status: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
type: object | ||
served: true | ||
storage: false | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
resources: | ||
- manager.yaml | ||
- manager.yaml | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
configMapGenerator: | ||
- files: | ||
- controller_manager_config.yaml | ||
name: manager-config | ||
- files: | ||
- controller_manager_config.yaml | ||
name: manager-config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ webhooks: | |
matchExpressions: | ||
- key: serving.kserve.io/inferenceservice | ||
operator: Exists | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package comparators | ||
|
||
import ( | ||
istiov1beta1 "istio.io/api/networking/v1beta1" | ||
istioclientv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
func GetGatewayComparator() ResourceComparator { | ||
return func(existing client.Object, desired client.Object) bool { | ||
existingGateway := existing.(*istioclientv1beta1.Gateway) | ||
desiredGateway := desired.(*istioclientv1beta1.Gateway) | ||
|
||
exists := false | ||
for _, server := range existingGateway.Spec.Servers { | ||
if serversEqual(server, desiredGateway.Spec.Servers[0]) { | ||
exists = true | ||
break | ||
} | ||
} | ||
|
||
return exists | ||
} | ||
} | ||
|
||
// serversEquals compare if the inferenceservice name matches got the given resources | ||
func serversEqual(s1, s2 *istiov1beta1.Server) bool { | ||
return s1.Port.Name == s2.Port.Name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.