Skip to content
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

feat: Apache APISIX support. Fixes #2395 #2437

Merged
merged 9 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ cmd/**/debug
debug.test
coverage.out
coverage.html
junit.xml
rerunreport.txt
site/
vendor/
# generated
Expand Down
37 changes: 37 additions & 0 deletions docs/getting-started/apisix/rollout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollouts-demo
spec:
replicas: 5
strategy:
canary:
canaryService: rollouts-demo-canary
stableService: rollouts-demo-stable
trafficRouting:
apisix:
zachaller marked this conversation as resolved.
Show resolved Hide resolved
routeRef: rollouts-demo-route
ruleRef: rollouts-demo
steps:
- setWeight: 5
- pause: {}
revisionHistoryLimit: 2
selector:
matchLabels:
app: rollouts-demo
template:
metadata:
labels:
app: rollouts-demo
spec:
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:blue
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
requests:
memory: 32Mi
cpu: 5m
25 changes: 25 additions & 0 deletions docs/getting-started/apisix/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: rollouts-demo-route
spec:
http:
- name: rollouts-demo
match:
paths:
- /*
methods:
- GET
- POST
- PUT
- DELETE
- PATCH
hosts:
- rollouts-demo.apisix.local
backends:
- serviceName: rollouts-demo-stable
servicePort: 80
weight: 100
- serviceName: rollouts-demo-canary
servicePort: 80
weight: 0
30 changes: 30 additions & 0 deletions docs/getting-started/apisix/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: rollouts-demo-canary
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollouts-demo
# This selector will be updated with the pod-template-hash of the canary ReplicaSet. e.g.:
# rollouts-pod-template-hash: 7bf84f9696

---
apiVersion: v1
kind: Service
metadata:
name: rollouts-demo-stable
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollouts-demo
# This selector will be updated with the pod-template-hash of the stable ReplicaSet. e.g.:
# rollouts-pod-template-hash: 789746c88d
9 changes: 9 additions & 0 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,15 @@ spec:
required:
- mappings
type: object
apisix:
properties:
routeRef:
type: string
ruleRef:
type: string
required:
- routeRef
type: object
appMesh:
properties:
virtualNodeGroup:
Expand Down
17 changes: 17 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11719,6 +11719,15 @@ spec:
required:
- mappings
type: object
apisix:
properties:
routeRef:
type: string
ruleRef:
type: string
required:
- routeRef
type: object
appMesh:
properties:
virtualNodeGroup:
Expand Down Expand Up @@ -14693,6 +14702,14 @@ rules:
- watch
- get
- update
- apiGroups:
- apisix.apache.org
resources:
- apisixroutes
verbs:
- watch
- get
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
17 changes: 17 additions & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11719,6 +11719,15 @@ spec:
required:
- mappings
type: object
apisix:
properties:
routeRef:
type: string
ruleRef:
type: string
required:
- routeRef
type: object
appMesh:
properties:
virtualNodeGroup:
Expand Down Expand Up @@ -14693,6 +14702,14 @@ rules:
- watch
- get
- update
- apiGroups:
- apisix.apache.org
resources:
- apisixroutes
verbs:
- watch
- get
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
8 changes: 8 additions & 0 deletions manifests/role/argo-rollouts-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,11 @@ rules:
- watch
- get
- update
- apiGroups:
- apisix.apache.org
resources:
- apisixroutes
verbs:
- watch
- get
- update
18 changes: 18 additions & 0 deletions pkg/apiclient/rollout/rollout.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,20 @@
},
"title": "AntiAffinity defines which inter-pod scheduling rule to use for anti-affinity injection"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.ApisixTrafficRouting": {
"type": "object",
"properties": {
"routeRef": {
"type": "string",
"title": "RouteRef refer to the name of the APISIX Route used to route traffic to the service"
},
"ruleRef": {
"type": "string",
"title": "RuleRef refer to the name of the APISIX Route HTTP Rule used to route traffic to the service"
}
},
"title": "ApisixTrafficRouting defines the configuration required to use APISIX as traffic router"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AppMeshTrafficRouting": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1584,6 +1598,10 @@
"$ref": "#/definitions/github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.MangedRoutes"
},
"description": "A list of HTTP routes that Argo Rollouts manages, the order of this array also becomes the precedence in the upstream\ntraffic router."
},
"apisix": {
"$ref": "#/definitions/github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.ApisixTrafficRouting",
"title": "Apisix holds specific configuration to use Apisix to route traffic"
}
},
"title": "RolloutTrafficRouting hosts all the different configuration for supported service meshes to enable more fine-grained traffic routing"
Expand Down
Loading