Skip to content

Commit

Permalink
Merge pull request #703 from rcernich/MAISTRA-2167
Browse files Browse the repository at this point in the history
MAISTRA-2293 chart updates for MeshFederation resource support
  • Loading branch information
maistra-bot committed Apr 29, 2021
2 parents 2765dd4 + 879e5ed commit 4ee3870
Show file tree
Hide file tree
Showing 20 changed files with 279 additions and 113 deletions.
1 change: 0 additions & 1 deletion build/generate-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function generateCRDs() {
cp deploy/crds/maistra.io_servicemeshcontrolplanes.yaml ${bundle_dir}/servicemeshcontrolplanes.crd.yaml
cp deploy/crds/maistra.io_servicemeshmemberrolls.yaml ${bundle_dir}/servicemeshmemberrolls.crd.yaml
cp deploy/crds/maistra.io_servicemeshmembers.yaml ${bundle_dir}/servicemeshmembers.crd.yaml
cp deploy/crds/maistra.io_servicemeshextensions.yaml resources/helm/overlays/istio-init/files/servicemeshextensions.maistra.io.crd.yaml
done

echo "Writing CRDs to file deploy/src/crd.yaml"
Expand Down
5 changes: 3 additions & 2 deletions build/patch-charts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function patchTemplates() {
sed_wrap -i -e '/labels:/ i\
annotations:\
"maistra.io/internal": "true"' \
-e 's/name: istiod-{{.*/name: istiod-internal-{{ .Values.revision | default "default" }}-{{ .Release.Namespace }}/' \
-e 's/name: istiod-{{.*/name: istiod-internal-{{ .Values.revision | default "default" }}/' \
${HELM_DIR}/base/templates/role.yaml \
${HELM_DIR}/base/templates/rolebinding.yaml
mv ${HELM_DIR}/base/templates/role.yaml ${HELM_DIR}/istio-control/istio-discovery/templates/role.yaml
Expand Down Expand Up @@ -286,7 +286,8 @@ function patchGateways() {
i \{\{ $gateway := index .Values "gateways" "istio-ingressgateway" \}\}\
\{\{- if and .Values.global.meshExpansion.enabled (eq $gateway.name "istio-ingressgateway") \}\}
d
}' ${HELM_DIR}/gateways/istio-ingress/templates/meshexpansion.yaml
}' \
-e 's/istiod\.{{ .Release.Namespace }}/istiod-{{ .Values.revision | default "default" }}.{{ .Release.Namespace }}/' ${HELM_DIR}/gateways/istio-ingress/templates/meshexpansion.yaml
}

function patchSidecarInjector() {
Expand Down
4 changes: 4 additions & 0 deletions deploy/maistra-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down Expand Up @@ -3985,6 +3987,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions deploy/servicemesh-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down Expand Up @@ -3985,6 +3987,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions deploy/src/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down Expand Up @@ -3984,6 +3986,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ MeshGatewayConfig specifies the gateway which should be used for accessing the n
|
| integer

| registryServiceName
|
| string

| service
|
| string
Expand Down
4 changes: 4 additions & 0 deletions manifests-maistra/2.1.0/servicemeshcontrolplanes.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down Expand Up @@ -3984,6 +3986,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions manifests-servicemesh/2.1.0/servicemeshcontrolplanes.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down Expand Up @@ -3984,6 +3986,8 @@ spec:
port:
format: int32
type: integer
registryServiceName:
type: string
service:
type: string
type: object
Expand Down
65 changes: 64 additions & 1 deletion pkg/apis/maistra/conversion/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,62 @@ import (
"fmt"
"strings"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"

v1 "github.com/maistra/istio-operator/pkg/apis/maistra/v1"
v2 "github.com/maistra/istio-operator/pkg/apis/maistra/v2"
corev1 "k8s.io/api/core/v1"
"github.com/maistra/istio-operator/pkg/controller/versions"
)

const (
imageNameSDS = "node-agent-k8s"
)

var (
meshExpansionPortsV11 = []corev1.ServicePort{
{
Name: "tcp-pilot-grpc-tls",
Port: 15011,
TargetPort: intstr.FromInt(15011),
},
{
Name: "tcp-mixer-grpc-tls",
Port: 15004,
TargetPort: intstr.FromInt(15004),
},
{
Name: "tcp-citadel-grpc-tls",
Port: 8060,
TargetPort: intstr.FromInt(8060),
},
{
Name: "tcp-dns-tls",
Port: 853,
TargetPort: intstr.FromInt(8853),
},
}
meshExpansionPortsV20 = []corev1.ServicePort{
{
Name: "tcp-istiod",
Port: 15012,
TargetPort: intstr.FromInt(15012),
},
{
Name: "tcp-dns-tls",
Port: 853,
TargetPort: intstr.FromInt(8853),
},
}
meshExpansionPortsV21 = []corev1.ServicePort{
{
Name: "tcp-istiod",
Port: 15012,
TargetPort: intstr.FromInt(15012),
},
}
)

func populateGatewaysValues(in *v2.ControlPlaneSpec, values map[string]interface{}) error {
if in.Gateways == nil {
return nil
Expand Down Expand Up @@ -556,3 +603,19 @@ func addEnvToGateway(in *v2.GatewayConfig, name, value string) {
in.Runtime.Container.Env[name] = value
}

func expansionPortsForVersion(version string) ([]corev1.ServicePort, error) {
switch version {
case "":
fallthrough
case versions.V1_0.String():
fallthrough
case versions.V1_1.String():
return meshExpansionPortsV11, nil
case versions.V2_0.String():
return meshExpansionPortsV20, nil
case versions.V2_1.String():
return meshExpansionPortsV21, nil
default:
return nil, fmt.Errorf("cannot convert for unknown version: %s", version)
}
}
7 changes: 5 additions & 2 deletions pkg/apis/maistra/v2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ type MeshEndpointConfig struct {
// +optional
FromRegistry string `json:"fromRegistry,omitempty"`
// +optional
FromCIDR string `json:"fromCIDR,omitempty"`
FromCIDR string `json:"fromCIDR,omitempty"`
}

// MeshGatewayConfig specifies the gateway which should be used for accessing
// the network
type MeshGatewayConfig struct {
// +optional
// +deprecated
Service string `json:"service,omitempty"`
// +optional
RegistryServiceName string `json:"registryServiceName,omitempty"`
// +optional
Address string `json:"address,omitempty"`
// +optional
Port int32 `json:"port,omitempty"`
Port int32 `json:"port,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestBootstrapping(t *testing.T) {
Profiles: []string{"maistra"},
},
},
crdCount: 14,
crdCount: 15,
},
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ metadata:
release: {{ .Release.Name }}
spec:
hosts:
- istiod.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
- istiod-{{ .Values.revision | default "default" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
gateways:
- meshexpansion-gateway
tcp:
- match:
- port: 15012
route:
- destination:
host: istiod.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
host: istiod-{{ .Values.revision | default "default" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
port:
number: 15012
- match:
- port: 15017
route:
- destination:
host: istiod.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
host: istiod-{{ .Values.revision | default "default" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
port:
number: 443
---
Expand All @@ -66,7 +66,7 @@ metadata:
maistra-version: "2.1.0"
release: {{ .Release.Name }}
spec:
host: istiod.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
host: istiod-{{ .Values.revision | default "default" }}.{{ .Release.Namespace }}.svc.{{ .Values.global.proxy.clusterDomain }}
trafficPolicy:
portLevelSettings:
- port:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ spec:
- port: 15014
name: http-monitoring # prometheus stats
protocol: TCP
- port: 8188
name: http-discovery # federation discovery
protocol: TCP
selector:
app: istiod
# Label used by the 'default' service. For versioned deployments we match with app and version.
Expand Down Expand Up @@ -772,6 +775,8 @@ spec:
protocol: TCP
- containerPort: 15053
protocol: TCP
- containerPort: 8188
protocol: TCP
readinessProbe:
httpGet:
path: /ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ spec:
protocol: TCP
- containerPort: 15053
protocol: TCP
- containerPort: 8188
protocol: TCP
readinessProbe:
httpGet:
path: /ready
Expand Down

0 comments on commit 4ee3870

Please sign in to comment.