Skip to content

Commit

Permalink
Merge pull request #8 from argoproj-labs/feat/rbac
Browse files Browse the repository at this point in the history
update README.md & add role files
  • Loading branch information
wilsonwu authored Apr 12, 2023
2 parents 63b3df7 + af03873 commit 53cfa47
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,83 @@ Contour supports multiple configuration APIs in order to meet the needs of as ma
- **[Gateway API](https://gateway-api.sigs.k8s.io/)** (beta) - A new CRD-based API managed by the [Kubernetes SIG-Network community](https://github.com/kubernetes/community/tree/master/sig-network) that aims to evolve Kubernetes service networking APIs in a vendor-neutral way.

## TODO: How to integrate Contour with Argo Rollouts
NOTES:
***1.The file as follows just for illustrative purposes only, please do not use directly!!!***
***2. The argo-rollouts >= [v1.5.0-rc1](https://github.com/argoproj/argo-rollouts/releases/tag/v1.5.0-rc1)***
Steps:
1. Run the `yaml/rbac.yaml` to add the role for operate on the `HTTPProxy`.
2. Build this plugin.
3. Put the plugin somewhere & mount on to the container for `argo-rollouts`:
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: argo-rollouts
namespace: argo-rollouts
spec:
template:
spec:
volumes:
- name: contour-plugin
hostPath:
path: /CHANGE-ME/rollouts-trafficrouter-contour-plugin
type: ''
containers:
- name: argo-rollouts
volumeMounts:
- name: contour-plugin
mountPath: /CHANGE-ME/rollouts-trafficrouter-contour-plugin
```
4. Create a ConfigMap to let `argo-rollouts` know the plugin's location:
```
apiVersion: v1
kind: ConfigMap
metadata:
name: argo-rollouts-config
namespace: argo-rollouts
data:
trafficRouterPlugins: |-
- name: "argoproj-labs/contour"
location: "file://CHANGE-ME/rollouts-trafficrouter-contour-plugin/contour-plugin"
binaryData: {}`
```
5. Create the `CR/Rollout` and put it into the operated services` namespace:
```
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollouts-demo
namespace: rollouts-demo
spec:
replicas: 6
selector:
matchLabels:
app.kubernetes.io/instance: rollouts-demo
strategy:
canary:
canaryService: canaryService
stableService: stableService
steps:
- setWeight: 30
- pause:
duration: 10
trafficRouting:
plugins:
argoproj-labs/contour:
httpProxy: rollouts-demo
namespace: rollouts-demo
workloadRef:
apiVersion: apps/v1
kind: Deployment
name: canary
```
6. Enjoy It.
## TODO: Contribution
32 changes: 32 additions & 0 deletions yaml/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: rollouts-contour-trafficrouter-plugin
rules:
- verbs:
- get
- list
- watch
- update
apiGroups:
- projectcontour.io
resources:
- httpproxies

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rollouts-contour-trafficrouter-plugin
labels:
app.kubernetes.io/component: rollouts-controller
app.kubernetes.io/name: argo-rollouts
app.kubernetes.io/part-of: argo-rollouts
subjects:
- kind: ServiceAccount
name: argo-rollouts
namespace: argo-rollouts
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: rollouts-contour-trafficrouter-plugin

0 comments on commit 53cfa47

Please sign in to comment.