Skip to content

Allow multiple services per exit node (wip) #95

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

Merged
merged 5 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 34 additions & 0 deletions .github/workflows/helm-oci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker

on:
schedule:
- cron: "15 14 * * *"
push:
paths:
- "charts/**"

branches: ["main", "staging"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
docker:
uses: appany/[email protected]
with:
name: chisel-operator
repository: chisel-operator
tag: 0.1.0
path: charts/chisel-operator
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: 'true' # Defaults to false
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chisel-operator"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
description = "Chisel tunnel operator for Kubernetes"
authors = [
Expand Down
24 changes: 13 additions & 11 deletions charts/chisel-operator/templates/crds/exit-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
name: v1.1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ExitNodeSpec via `CustomResource`
Expand Down Expand Up @@ -68,20 +68,22 @@ spec:
provider:
type: string
service_binding:
nullable: true
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
items:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: array
required:
- ip
- name
- provider
- service_binding
type: object
required:
- spec
Expand Down
24 changes: 13 additions & 11 deletions deploy/crd/exit-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
name: v1.1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ExitNodeSpec via `CustomResource`
Expand Down Expand Up @@ -66,20 +66,22 @@ spec:
provider:
type: string
service_binding:
nullable: true
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
items:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: array
required:
- ip
- name
- provider
- service_binding
type: object
required:
- spec
Expand Down
22 changes: 15 additions & 7 deletions src/cloud/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,21 @@ impl Provisioner for AWSProvisioner {
}
};

let exit_node = ExitNodeStatus {
name: name.clone(),
ip: public_ip,
id: Some(instance.instance_id.unwrap()),
provider: provisioner.clone(),
service_binding: None,
};
// let exit_node = ExitNodeStatus {
// name: name.clone(),
// ip: public_ip,
// id: Some(instance.instance_id.unwrap()),
// provider: provisioner.clone(),
// service_binding: vec![],
// };
let exit_node = ExitNodeStatus::new(
provisioner.clone(),
name.clone(),
public_ip,
// needless conversion?
// todo: Clean this up, minor performance hit
instance.instance_id.map(|id| id.to_string()).as_deref(),
);

Ok(exit_node)
}
Expand Down
13 changes: 6 additions & 7 deletions src/cloud/digitalocean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ impl Provisioner for DigitalOceanProvisioner {
}
};

let exit_node = ExitNodeStatus {
name: name.clone(),
ip: droplet_ip.clone(),
id: Some(droplet.id.to_string()),
provider: provisioner.clone(),
service_binding: None,
};
let exit_node = ExitNodeStatus::new(
provisioner.clone(),
name.clone(),
droplet_ip.clone(),
Some(&droplet_id),
);

Ok(exit_node)
}
Expand Down
21 changes: 14 additions & 7 deletions src/cloud/linode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,20 @@ impl Provisioner for LinodeProvisioner {
}
};

let status = ExitNodeStatus {
ip: instance_ip,
name: instance.label,
provider: provisioner.to_string(),
id: Some(instance.id.to_string()),
service_binding: None,
};
// let status = ExitNodeStatus {
// ip: instance_ip,
// name: instance.label,
// provider: provisioner.to_string(),
// id: Some(instance.id.to_string()),
// service_binding: vec![],
// };

let status = ExitNodeStatus::new(
instance_ip,
instance.label,
provisioner.to_string(),
Some(&instance.id.to_string()),
);

Ok(status)
}
Expand Down
Loading
Loading