Skip to content

Instantly share code, notes, and snippets.

@initcron
Last active February 6, 2025 05:01
Show Gist options
  • Save initcron/f7f390117992aaacccdfba4b573198de to your computer and use it in GitHub Desktop.
Save initcron/f7f390117992aaacccdfba4b573198de to your computer and use it in GitHub Desktop.

Setting up Argo Locally on existing Kubernetes Cluster

Create Argo Namespace

kubectl create namespace argo
kubectl get ns

Setup Argo Version and Install it

ARGO_WORKFLOWS_VERSION="v3.5.14"
kubectl apply -n argo -f "https://github.com/argoproj/argo-workflows/releases/download/${ARGO_WORKFLOWS_VERSION}/quick-start-minimal.yaml"

validate

kubectl get all -n argo 

Expose Argo Service on port 32400 as ,

kubectl patch svc argo-server -n argo --patch \
  '{"spec": { "type": "NodePort", "ports": [ { "nodePort": 32400, "port": 2746, "protocol": "TCP", "targetPort": 2746 } ] } }'
kubectl -n argo port-forward service/argo-server 2746:2746
 

validate

kubectl get svc -n argo

accesss the service now on http://IPADDDRESS:32400

setup rbac policies as

File argoworkflow_rbac.yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: argo-workflows-clusterrole
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/log"]
    verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
  - apiGroups: ["argoproj.io"]
    resources: ["workflows"]
    verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
  - apiGroups: ["events.k8s.io"]
    resources: ["events"]
    verbs: ["create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: argo-workflows-clusterbinding
subjects:
  - kind: ServiceAccount
    name: argo   # Change this if using a different service account
    namespace: argo
  - kind: ServiceAccount
    name: default   # Change this if using a different service account
    namespace: default
roleRef:
  kind: ClusterRole
  name: argo-workflows-clusterrole  # Must match the ClusterRole name
  apiGroup: rbac.authorization.k8s.io

apply RBAC policy as

kubectl apply -f argoworkflow_rbac.yaml

switch to default namespace

kubectl config set-context  --current --namespace=default

Now you are ready to run the workflows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment