Skip to content

Automator: merge upstream changes to openshift-service-mesh/istio@master #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,51 @@ spec:
{{- end }}
type: {{ .ServiceType | quote }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{.DeploymentName | quote}}
namespace: {{.Namespace | quote}}
annotations:
{{- toJsonMap (omit .InfrastructureAnnotations "kubectl.kubernetes.io/last-applied-configuration" "gateway.istio.io/name-override" "gateway.istio.io/service-account" "gateway.istio.io/controller-version") | nindent 4 }}
labels:
{{- toJsonMap
.InfrastructureLabels
(strdict
"gateway.networking.k8s.io/gateway-name" .Name
) | nindent 4 }}
ownerReferences:
- apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
name: {{.Name}}
uid: "{{.UID}}"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{.DeploymentName | quote}}
maxReplicas: 1
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{.DeploymentName | quote}}
namespace: {{.Namespace | quote}}
annotations:
{{- toJsonMap (omit .InfrastructureAnnotations "kubectl.kubernetes.io/last-applied-configuration" "gateway.istio.io/name-override" "gateway.istio.io/service-account" "gateway.istio.io/controller-version") | nindent 4 }}
labels:
{{- toJsonMap
.InfrastructureLabels
(strdict
"gateway.networking.k8s.io/gateway-name" .Name
) | nindent 4 }}
ownerReferences:
- apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
name: {{.Name}}
uid: "{{.UID}}"
spec:
selector:
matchLabels:
gateway.networking.k8s.io/gateway-name: {{.Name|quote}}

48 changes: 48 additions & 0 deletions manifests/charts/istio-control/istio-discovery/files/waypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,51 @@ spec:
{{- end }}
type: {{ .ServiceType | quote }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{.DeploymentName | quote}}
namespace: {{.Namespace | quote}}
annotations:
{{- toJsonMap (omit .InfrastructureAnnotations "kubectl.kubernetes.io/last-applied-configuration" "gateway.istio.io/name-override" "gateway.istio.io/service-account" "gateway.istio.io/controller-version") | nindent 4 }}
labels:
{{- toJsonMap
.InfrastructureLabels
(strdict
"gateway.networking.k8s.io/gateway-name" .Name
) | nindent 4 }}
ownerReferences:
- apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
name: {{.Name}}
uid: "{{.UID}}"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{.DeploymentName | quote}}
maxReplicas: 1
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{.DeploymentName | quote}}
namespace: {{.Namespace | quote}}
annotations:
{{- toJsonMap (omit .InfrastructureAnnotations "kubectl.kubernetes.io/last-applied-configuration" "gateway.istio.io/name-override" "gateway.istio.io/service-account" "gateway.istio.io/controller-version") | nindent 4 }}
labels:
{{- toJsonMap
.InfrastructureLabels
(strdict
"gateway.networking.k8s.io/gateway-name" .Name
) | nindent 4 }}
ownerReferences:
- apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
name: {{.Name}}
uid: "{{.UID}}"
spec:
selector:
matchLabels:
gateway.networking.k8s.io/gateway-name: {{.Name|quote}}

Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ rules:
- apiGroups: ["apps"]
verbs: [ "get", "watch", "list", "update", "patch", "create", "delete" ]
resources: [ "deployments" ]
- apiGroups: ["autoscaling"]
verbs: [ "get", "watch", "list", "update", "patch", "create", "delete" ]
resources: [ "horizontalpodautoscalers" ]
- apiGroups: ["policy"]
verbs: [ "get", "watch", "list", "update", "patch", "create", "delete" ]
resources: [ "poddisruptionbudgets" ]
- apiGroups: [""]
verbs: [ "get", "watch", "list", "update", "patch", "create", "delete" ]
resources: [ "services" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ range $key, $value := .Values.gatewayClasses }}
apiVersion: v1
kind: ConfigMap
metadata:
name: istio-{{ $.Values.revision | default "default" }}-gatewayclass-{{$key}}
namespace: {{ $.Release.Namespace }}
labels:
istio.io/rev: {{ $.Values.revision | default "default" | quote }}
install.operator.istio.io/owning-resource: {{ $.Values.ownerName | default "unknown" }}
operator.istio.io/component: "Pilot"
release: {{ $.Release.Name }}
app.kubernetes.io/name: "istiod"
gateway.istio.io/defaults-for-class: {{$key|quote}}
{{- include "istio.labels" $ | nindent 4 }}
data:
{{ range $kind, $overlay := $value }}
{{$kind}}: |
{{$overlay|toYaml|trim|indent 4}}
{{ end }}
---
{{ end }}
10 changes: 10 additions & 0 deletions manifests/charts/istio-control/istio-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,13 @@ _internal_defaults_do_not_set:

# Set to `type: RuntimeDefault` to use the default profile for templated gateways, if your container runtime supports it
seccompProfile: {}

# gatewayClasses allows customizing the configuration of the default deployment of Gateways per GatewayClass.
# For example:
# gatewayClasses:
# istio:
# service:
# spec:
# type: ClusterIP
# Per-Gateway configuration can also be set in the `Gateway.spec.infrastructure.parametersRef` field.
gatewayClasses: {}
52 changes: 33 additions & 19 deletions operator/pkg/apis/values_types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions operator/pkg/apis/values_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,9 @@ message Values {

// Specifies experimental helm fields that could be removed or changed in the future
ExperimentalConfig experimental = 44;

// Configuration for Gateway Classes
google.protobuf.Value gatewayClasses = 45;
}

// ZeroVPNConfig enables cross-cluster access using SNI matching.
Expand Down
2 changes: 1 addition & 1 deletion pilot/pkg/bootstrap/configcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (s *Server) initK8SConfigStore(args *PilotArgs) error {
if s.kubeClient.CrdWatcher().WaitForCRD(gvr.KubernetesGateway, leaderStop) {
tagWatcher := revisions.NewTagWatcher(s.kubeClient, args.Revision)
controller := gateway.NewDeploymentController(s.kubeClient, s.clusterID, s.environment,
s.webhookInfo.getWebhookConfig, s.webhookInfo.addHandler, tagWatcher, args.Revision)
s.webhookInfo.getWebhookConfig, s.webhookInfo.addHandler, tagWatcher, args.Revision, args.Namespace)
// Start informers again. This fixes the case where informers for namespace do not start,
// as we create them only after acquiring the leader lock
// Note: stop here should be the overall pilot stop, NOT the leader election stop. We are
Expand Down
11 changes: 7 additions & 4 deletions pilot/pkg/bootstrap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ type Server struct {
RA ra.RegistrationAuthority
caServer *caserver.Server

// TrustAnchors for workload to workload mTLS
// TrustAnchors for workload to workload mTLS and proxy to istiod TLS
// Only initiated when `ISTIO_MULTIROOT_MESH` = true
workloadTrustBundle *tb.TrustBundle
certMu sync.RWMutex
istiodCert *tls.Certificate
Expand Down Expand Up @@ -298,9 +299,11 @@ func NewServer(args *PilotArgs, initFuncs ...func(*Server)) (*Server, error) {
return nil, err
}

// Initialize trust bundle after mesh config which it depends on
s.workloadTrustBundle = tb.NewTrustBundle(nil, e.Watcher)
e.TrustBundle = s.workloadTrustBundle
if features.MultiRootMesh {
// Initialize trust bundle after mesh config which it depends on
s.workloadTrustBundle = tb.NewTrustBundle(nil, e.Watcher)
e.TrustBundle = s.workloadTrustBundle
}

// Options based on the current 'defaults' in istio.
caOpts := &caOptions{
Expand Down
40 changes: 40 additions & 0 deletions pilot/pkg/config/kube/crdclient/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading