Skip to content

Commit

Permalink
Merge pull request #123 from weaveworks/appmesh-v1beta1
Browse files Browse the repository at this point in the history
Update App Mesh to v1beta1
  • Loading branch information
stefanprodan authored Mar 26, 2019
2 parents 107596a + f547687 commit 8b5c004
Show file tree
Hide file tree
Showing 40 changed files with 423 additions and 514 deletions.
2 changes: 1 addition & 1 deletion artifacts/appmesh/canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
# container port
port: 9898
# App Mesh reference
meshName: global.appmesh-system
meshName: global
# define the canary analysis timing and KPIs
canaryAnalysis:
# schedule interval (default 60s)
Expand Down
4 changes: 2 additions & 2 deletions artifacts/appmesh/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ spec:
targetPort: 443
type: LoadBalancer
---
apiVersion: appmesh.k8s.aws/v1alpha1
apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualNode
metadata:
name: ingress
namespace: test
spec:
meshName: global.appmesh-system
meshName: global
listeners:
- portMapping:
port: 80
Expand Down
4 changes: 2 additions & 2 deletions charts/grafana/dashboards/appmesh.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\",response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\"}[30s]))",
"expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\",envoy_response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\"}[30s]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "",
Expand Down Expand Up @@ -345,7 +345,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\",response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\"}[30s]))",
"expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\",envoy_response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\"}[30s]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "",
Expand Down
6 changes: 5 additions & 1 deletion charts/grafana/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1. Get the application URL with:
1. Run the port forward command:

kubectl -n {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }} 3000:80

2. Navigate to:

http://localhost:3000
2 changes: 1 addition & 1 deletion charts/loadtester/templates/virtual-node.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.meshName }}
apiVersion: appmesh.k8s.aws/v1alpha1
apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualNode
metadata:
name: {{ include "loadtester.fullname" . }}
Expand Down
12 changes: 6 additions & 6 deletions docs/gitbook/install/flagger-install-on-eks-appmesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,20 @@ Run the App Mesh installer:
curl -fsSL https://git.io/get-app-mesh-eks.sh | bash -
```

The installer will do the following:
The installer does the following:

* creates the `appmesh-system` namespace
* generates a certificate with openssl signed by Kubernetes CA
* generates a certificate signed by Kubernetes CA
* registers the App Mesh mutating webhook
* deploys the App Mesh webhook
* deploys the App Mesh webhook in `appmesh-system` namespace
* deploys the App Mesh CRDs
* deploys the App Mesh controller
* creates a mesh called `global` in the `appmesh-system` namespace
* deploys the App Mesh controller `appmesh-system` namespace
* creates a mesh called `global`

Verify that the global mesh is active:

```bash
kubectl -n appmesh-system describe mesh
kubectl describe mesh

Status:
Mesh Condition:
Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge

${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/weaveworks/flagger/pkg/client github.com/weaveworks/flagger/pkg/apis \
"appmesh:v1alpha1 istio:v1alpha3 flagger:v1alpha3" \
"appmesh:v1beta1 istio:v1alpha3 flagger:v1alpha3" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
5 changes: 0 additions & 5 deletions pkg/apis/appmesh/v1alpha1/doc.go

This file was deleted.

5 changes: 5 additions & 0 deletions pkg/apis/appmesh/v1beta1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +k8s:deepcopy-gen=package

// Package v1beta1 is the v1beta1 version of the API.
// +groupName=appmesh.k8s.aws
package v1beta1
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package v1alpha1
package v1beta1

import (
"github.com/weaveworks/flagger/pkg/apis/appmesh"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

"github.com/weaveworks/flagger/pkg/apis/appmesh"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: appmesh.GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: appmesh.GroupName, Version: "v1beta1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v1alpha1
package v1beta1

import (
api "k8s.io/api/core/v1"
Expand All @@ -10,6 +10,7 @@ import (
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md

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

// Mesh is a specification for a Mesh resource
Expand All @@ -19,22 +20,19 @@ type Mesh struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +optional
Spec *MeshSpec `json:"spec,omitempty"`
Spec MeshSpec `json:"spec,omitempty"`
// +optional
Status *MeshStatus `json:"status,omitempty"`
Status MeshStatus `json:"status,omitempty"`
}

type MeshServiceDiscoveryType string

const (
CloudMapHttp MeshServiceDiscoveryType = "CloudMapHttp"
Dns MeshServiceDiscoveryType = "Dns"
)

// MeshSpec is the spec for a Mesh resource
type MeshSpec struct {
// CloudMapNamespaceName can be specified if it should be different than the mesh name.
// +optional
CloudMapNamespaceName *string `json:"cloudMapNamespaceName,omitempty"`
// +optional
ServiceDiscoveryType *MeshServiceDiscoveryType `json:"serviceDiscoveryType,omitempty"`
}
Expand All @@ -43,20 +41,15 @@ type MeshSpec struct {
type MeshStatus struct {
// MeshArn is the AppMesh Mesh object's Amazon Resource Name
// +optional
MeshArn *string `json:"meshArn,omitempty"`
// NamespaceArn is the CloudMap NameSpace object's Amazon Resource Name
// +optional
CloudMapNamespaceArn *string `json:"cloudMapNamespaceArn,omitempty"`
// +optional
CloudMapRoleArn *string `json:"cloudMapRoleArn,omitempty"`
Conditions []MeshCondition `json:"meshCondition"`
MeshArn *string `json:"meshArn,omitempty"`
Conditions []MeshCondition `json:"meshCondition"`
}

type MeshConditionType string

const (
// MeshActive is Active when the Appmesh Mesh has been created or found via the API
MeshActive MeshConditionType = "Active"
MeshActive MeshConditionType = "MeshActive"
)

type MeshCondition struct {
Expand Down Expand Up @@ -95,9 +88,9 @@ type VirtualService struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +optional
Spec *VirtualServiceSpec `json:"spec,omitempty"`
Spec VirtualServiceSpec `json:"spec,omitempty"`
// +optional
Status *VirtualServiceStatus `json:"status,omitempty"`
Status VirtualServiceStatus `json:"status,omitempty"`
}

// VirtualServiceSpec is the spec for a VirtualService resource
Expand Down Expand Up @@ -154,7 +147,10 @@ type VirtualServiceConditionType string

const (
// VirtualServiceActive is Active when the Appmesh Service has been created or found via the API
VirtualServiceActive VirtualServiceConditionType = "Active"
VirtualServiceActive VirtualServiceConditionType = "VirtualServiceActive"
VirtualRouterActive VirtualServiceConditionType = "VirtualRouterActive"
RoutesActive VirtualServiceConditionType = "RoutesActive"
VirtualServiceMeshMarkedForDeletion VirtualServiceConditionType = "MeshMarkedForDeletion"
)

type VirtualServiceCondition struct {
Expand Down Expand Up @@ -193,9 +189,9 @@ type VirtualNode struct {
metav1.ObjectMeta `json:"metadata,omitempty"`

// +optional
Spec *VirtualNodeSpec `json:"spec,omitempty"`
Spec VirtualNodeSpec `json:"spec,omitempty"`
// +optional
Status *VirtualNodeStatus `json:"status,omitempty"`
Status VirtualNodeStatus `json:"status,omitempty"`
}

// VirtualNodeSpec is the spec for a VirtualNode resource
Expand Down Expand Up @@ -259,7 +255,8 @@ type VirtualNodeConditionType string

const (
// VirtualNodeActive is Active when the Appmesh Node has been created or found via the API
VirtualNodeActive VirtualNodeConditionType = "Active"
VirtualNodeActive VirtualNodeConditionType = "VirtualNodeActive"
VirtualNodeMeshMarkedForDeletion VirtualNodeConditionType = "MeshMarkedForDeletion"
)

type VirtualNodeCondition struct {
Expand Down

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

Loading

0 comments on commit 8b5c004

Please sign in to comment.