Skip to content

Instantly share code, notes, and snippets.

@shpwrck
Last active March 27, 2023 20:14

Revisions

  1. shpwrck revised this gist Mar 27, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    I used [vi/websocat](https://github.com/vi/websocat), but v0.10.0 because v0.11.0 didn't seem to work.
    Once I deployed the k8s-resources.yaml and the gloo-resources.yaml I:
    Once I deployed the k8s-resources.yaml and the gloo-resources.yaml ...
    I:
    - Ran `websocat ws://<<gateway_ip>>` from within the websocat container
    - Passed in some values
    - Cancelled
  2. shpwrck revised this gist Mar 27, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,5 @@ Once I deployed the k8s-resources.yaml and the gloo-resources.yaml I:
    - Cancelled
    - Checked the logs for connection information.

    Otherwise you can leverage [piesocket](https://www.piesocket.com/?ref=extension)
    Otherwise you can leverage [piesocket](https://www.piesocket.com/?ref=extension).
    *You'll have to run the extension because "browsers don't support ws).
  3. shpwrck revised this gist Mar 27, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    I used (vi/websocat)[https://github.com/vi/websocat], but v0.10.0 because v0.11.0 didn't seem to work.
    I used [vi/websocat](https://github.com/vi/websocat), but v0.10.0 because v0.11.0 didn't seem to work.
    Once I deployed the k8s-resources.yaml and the gloo-resources.yaml I:
    - Ran `websocat ws://<<gateway_ip>>` from within the websocat container
    - Passed in some values
    - Cancelled
    - Checked the logs for connection information.

    Otherwise you can leverage (piesocket)[https://www.piesocket.com/?ref=extension]
    Otherwise you can leverage [piesocket](https://www.piesocket.com/?ref=extension)
  4. shpwrck renamed this gist Mar 27, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. shpwrck revised this gist Mar 27, 2023. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions 00.README
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    I used https://github.com/vi/websocat, but v0.10.0 because v0.11.0 didn't seem to work.
    I used (vi/websocat)[https://github.com/vi/websocat], but v0.10.0 because v0.11.0 didn't seem to work.
    Once I deployed the k8s-resources.yaml and the gloo-resources.yaml I:
    - Ran `websocat ws://<<gateway_ip>>` from within the websocat container
    - Passed in some values
    - Cancelled
    - Checked the logs for connection information.
    - Checked the logs for connection information.

    Otherwise you can leverage (piesocket)[https://www.piesocket.com/?ref=extension]
  6. shpwrck created this gist Mar 27, 2023.
    6 changes: 6 additions & 0 deletions 00.README
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    I used https://github.com/vi/websocat, but v0.10.0 because v0.11.0 didn't seem to work.
    Once I deployed the k8s-resources.yaml and the gloo-resources.yaml I:
    - Ran `websocat ws://<<gateway_ip>>` from within the websocat container
    - Passed in some values
    - Cancelled
    - Checked the logs for connection information.
    91 changes: 91 additions & 0 deletions gloo-resources.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,91 @@
    ---
    apiVersion: admin.gloo.solo.io/v2
    kind: Workspace
    metadata:
    annotations:
    name: cxp-app
    namespace: gloo-mesh
    spec:
    workloadClusters:
    - name: mgmt
    namespaces:
    - name: cxp-app-configs
    - name: '*'
    namespaces:
    - name: '*'
    ---
    apiVersion: admin.gloo.solo.io/v2
    kind: WorkspaceSettings
    metadata:
    name: cxp-app
    namespace: cxp-app-configs
    spec:
    exportTo:
    - workspaces:
    - name: '*'
    importFrom:
    - workspaces:
    - name: '*'
    options:
    eastWestGateways:
    - selector:
    labels:
    istio: eastwestgateway
    federation:
    enabled: false
    serviceIsolation:
    enabled: false
    trimProxyConfig: false
    ---
    apiVersion: networking.gloo.solo.io/v2
    kind: VirtualDestination
    metadata:
    name: websocat
    namespace: cxp-app-configs
    spec:
    hosts:
    - websocat.mesh
    ports:
    - number: 8080
    protocol: http
    services:
    - labels:
    app: websocat
    ---
    apiVersion: networking.gloo.solo.io/v2
    kind: VirtualGateway
    metadata:
    name: vgw
    namespace: cxp-app-configs
    spec:
    listeners:
    - http: {}
    port:
    number: 80
    workloads:
    - selector:
    labels:
    app: solo-istio-ingressgateway
    ---
    apiVersion: networking.gloo.solo.io/v2
    kind: RouteTable
    metadata:
    name: websocat
    namespace: cxp-app-configs
    spec:
    hosts:
    - '*'
    http:
    - forwardTo:
    destinations:
    - kind: VIRTUAL_DESTINATION
    port:
    number: 8080
    ref:
    name: websocat
    namespace: cxp-app-configs
    labels:
    route: websocat
    virtualGateways:
    - name: vgw
    namespace: cxp-app-configs
    62 changes: 62 additions & 0 deletions k8s-resources.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: websocat
    name: websocat
    namespace: default
    spec:
    progressDeadlineSeconds: 600
    replicas: 1
    revisionHistoryLimit: 10
    selector:
    matchLabels:
    app: websocat
    strategy:
    rollingUpdate:
    maxSurge: 25%
    maxUnavailable: 25%
    type: RollingUpdate
    template:
    metadata:
    creationTimestamp: null
    labels:
    app: websocat
    spec:
    containers:
    - args:
    - -s
    - 0.0.0.0:8080
    image: ghcr.io/vi/websocat:0.10.0
    imagePullPolicy: IfNotPresent
    name: websocat
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    dnsPolicy: ClusterFirst
    restartPolicy: Always
    schedulerName: default-scheduler
    securityContext: {}
    terminationGracePeriodSeconds: 30
    ---
    apiVersion: v1
    kind: Service
    metadata:
    labels:
    app: websocat
    name: websocat
    namespace: default
    spec:
    internalTrafficPolicy: Cluster
    ipFamilies:
    - IPv4
    ipFamilyPolicy: SingleStack
    ports:
    - port: 8080
    protocol: TCP
    targetPort: 8080
    selector:
    app: websocat
    sessionAffinity: None
    type: ClusterIP