Skip to content

Commit

Permalink
Merge pull request #894 from saiskee/create-non-discovered-gloo-upstr…
Browse files Browse the repository at this point in the history
…eams

Gloo: Create gloo upstreams from non-discovered services
  • Loading branch information
stefanprodan authored May 11, 2021
2 parents 438b558 + 06c4151 commit 3ad55c9
Show file tree
Hide file tree
Showing 45 changed files with 1,268 additions and 138 deletions.
2 changes: 1 addition & 1 deletion charts/flagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $ helm upgrade -i flagger flagger/flagger \
--set prometheus.install=true
```

To install Flagger and Prometheus for **Gloo** (requires Gloo discovery enabled):
To install Flagger and Prometheus for **Gloo** (no longer requires Gloo discovery):

```console
$ helm upgrade -i flagger flagger/flagger \
Expand Down
2 changes: 2 additions & 0 deletions docs/gitbook/tutorials/gloo-progressive-delivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ service/podinfo
service/podinfo-canary
service/podinfo-primary
routetables.gateway.solo.io/podinfo
upstreams.gloo.solo.io/test-podinfo-canaryupstream-9898
upstreams.gloo.solo.io/test-podinfo-primaryupstream-9898
```

When the bootstrap finishes Flagger will set the canary status to initialized:
Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ chmod +x ${CODEGEN_PKG}/generate-groups.sh

${CODEGEN_PKG}/generate-groups.sh all \
github.com/fluxcd/flagger/pkg/client github.com/fluxcd/flagger/pkg/apis \
"flagger:v1beta1 appmesh:v1beta2 appmesh:v1beta1 istio:v1alpha3 smi:v1alpha1 smi:v1alpha2 smi:v1alpha3 gloo:v1 projectcontour:v1 traefik:v1alpha1" \
"flagger:v1beta1 appmesh:v1beta2 appmesh:v1beta1 istio:v1alpha3 smi:v1alpha1 smi:v1alpha2 smi:v1alpha3 gloo/gloo:v1 gloo/gateway:v1 projectcontour:v1 traefik:v1alpha1" \
--output-base "${TEMP_DIR}" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: gloo.GroupName, Version: "v1"}
var SchemeGroupVersion = schema.GroupVersion{Group: gloo.GatewayGroupName, Version: "v1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions pkg/apis/gloo/gloo/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +k8s:deepcopy-gen=package

// Package v1 is the v1 version of the API.
// +groupName=gloo.solo.io
package v1
36 changes: 36 additions & 0 deletions pkg/apis/gloo/gloo/v1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package v1

import (
"github.com/fluxcd/flagger/pkg/apis/gloo"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: gloo.GlooGroupName, Version: "v1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)

// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Upstream{},
&UpstreamList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
37 changes: 37 additions & 0 deletions pkg/apis/gloo/gloo/v1/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Upstream is a specification for a Gloo Upstream resource
type Upstream struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec UpstreamSpec `json:"spec"`
}

type UpstreamSpec struct {
Kube KubeUpstream `json:"kube,omitempty"`
}

type KubeUpstream struct {
ServiceName string `json:"service_name,omitempty"`
ServiceNamespace string `json:"service_namespace,omitempty"`
ServicePort int32 `json:"service_port,omitempty"`
Selector map[string]string `json:"selector,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// UpstreamList is a list of Upstream resources
type UpstreamList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []Upstream `json:"items"`
}
125 changes: 125 additions & 0 deletions pkg/apis/gloo/gloo/v1/zz_generated.deepcopy.go

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

3 changes: 2 additions & 1 deletion pkg/apis/gloo/register.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gloo

const (
GroupName = "gateway.solo.io"
GlooGroupName = "gloo.solo.io"
GatewayGroupName = "gateway.solo.io"
)
16 changes: 15 additions & 1 deletion pkg/client/clientset/versioned/clientset.go

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

11 changes: 9 additions & 2 deletions pkg/client/clientset/versioned/fake/clientset_generated.go

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

4 changes: 3 additions & 1 deletion pkg/client/clientset/versioned/fake/register.go

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

4 changes: 3 additions & 1 deletion pkg/client/clientset/versioned/scheme/register.go

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

20 changes: 20 additions & 0 deletions pkg/client/clientset/versioned/typed/gateway/v1/doc.go

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

Loading

0 comments on commit 3ad55c9

Please sign in to comment.