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

fix(): Reconciles port numbers in the ovpn client deployment #333

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6fb1cef
fix: reconciles port numbers in ovpn client dep
Feb 15, 2024
dc08b9b
added a test case for the fix
Feb 20, 2024
1ccb009
removed package slices dependancy
Feb 21, 2024
8765470
fixed the broken test case
Feb 22, 2024
8f3ca06
removed unwanted code from utils.go
Feb 22, 2024
647d52a
rebased with master
kon3m Feb 26, 2024
f727830
changed variable and function names
kon3m Feb 27, 2024
e9f2119
added logic to assign distinct ports to clients
kon3m Feb 28, 2024
2a25ccf
refactored some code
kon3m Feb 28, 2024
bf844ad
addressed review comments
kon3m Mar 12, 2024
363f2a5
removed unused function
kon3m Mar 12, 2024
21449f3
added error handling in port allocation helper
kon3m Mar 19, 2024
40e2f74
Update end-to-end-test.yaml
KRANTHI0918 Mar 29, 2024
8295c56
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
839e077
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
b698b00
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
e12be65
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
992082b
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
1e6e022
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
0634437
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
5e56fc8
Update end-to-end-test.yaml
KRANTHI0918 Mar 30, 2024
f7bbfec
Update end-to-end-test.yaml
KRANTHI0918 Apr 1, 2024
4b220ac
feat(): no-network slice (#344)
mridulgain Apr 1, 2024
2dd8b9a
fix: reconciles port numbers in ovpn client dep
Feb 15, 2024
25dc60d
removed package slices dependancy
Feb 21, 2024
3d9c819
rebased with master
kon3m Feb 26, 2024
886bddb
fix: reconciles port numbers in ovpn client dep
Feb 15, 2024
4ee06fa
removed package slices dependancy
Feb 21, 2024
3a92e0e
rebased with master
kon3m Feb 26, 2024
c613169
rebased with master and fixed conflicts
Apr 2, 2024
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
32 changes: 23 additions & 9 deletions .github/workflows/end-to-end-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
env:
chartuser: ${{ secrets.DEV_CHARTS_USERNAME }}
chartpassword: ${{ secrets.DEV_CHARTS_PASSWORD }}
dockeruser: ${{ secrets.DOCKER_USERNAME }}
dockerpassword: ${{ secrets.DOCKER_TOKEN }}
ENFORCE_CRITICAL_CHECK: ${{ secrets.ENFORCE_CRITICAL_CHECK }}

jobs:
Expand Down Expand Up @@ -89,25 +91,40 @@ jobs:
with:
name: trivy-scan
path: scan.txt

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Check disk space
run: |
df . -h

- name: build kind clusters
run: |
mkdir -p ${{ github.workspace }}/profile
bash .github/workflows/scripts/start-kind.sh
env:
GITHUB_HEAD_COMMIT: ${{ steps.vars.outputs.sha_commit }}

- name: Free disk space
run: |
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
echo "some packages purged"

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Check disk space
run: df . -h
run: |
df . -h

- name: Docker Run Action
uses: addnab/docker-run-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
username: ${{ env.dockeruser }}
password: ${{ env.dockerpassword }}
registry: docker.io
image: aveshadev/kubeslice-e2e:latest
options: -v ${{ github.workspace }}/reports:/e2e/reports -v /home/runner/.kube:/e2e/assets/kubeconfig -v ${{ github.workspace }}/profile:/e2e/profile --network kind
Expand Down Expand Up @@ -136,9 +153,6 @@ jobs:
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
-y -f >/dev/null 2>&1
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
##########################################################

# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.22.1 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.21.5
VERSION ?= latest

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down Expand Up @@ -159,7 +159,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@latest)

KUSTOMIZE = $(shell pwd)/bin/kustomize
.PHONY: kustomize
Expand Down
11 changes: 6 additions & 5 deletions api/v1beta1/slice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package v1beta1

import (
controllerv1alpha1 "github.com/kubeslice/apis/pkg/controller/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -56,13 +57,13 @@ type SliceConfig struct {
// display name of the slice.
SliceDisplayName string `json:"sliceDisplayName"`
// IP subnet range of the slice.
SliceSubnet string `json:"sliceSubnet"`
SliceSubnet string `json:"sliceSubnet,omitempty"`
// Type of the slice.
SliceType string `json:"sliceType"`
// QOS profile details
QosProfileDetails QosProfileDetails `json:"qosProfileDetails"`
QosProfileDetails QosProfileDetails `json:"qosProfileDetails,omitempty"`
// IPAM configuration for the slice
SliceIpam SliceIpamConfig `json:"sliceIpam"`
SliceIpam SliceIpamConfig `json:"sliceIpam,omitempty"`
// ExternalGatewayConfig determines istio ingress/egress configuration
ExternalGatewayConfig *ExternalGatewayConfig `json:"externalGatewayConfig,omitempty"`
// Namespace Isolation profile contains fields related to namespace binding to slice
Expand All @@ -73,8 +74,8 @@ type SliceConfig struct {
SliceGatewayServiceType string `json:"sliceGatewayServiceType,omitempty"`
// SliceGateway Protocol Type: UDP or TCP
SliceGatewayProtocol string `json:"sliceGatewayProtocol,omitempty"`
// Slice overlay network deployment mode: single-network or multi-network
SliceOverlayNetworkDeploymentMode string `json:"sliceOverlayNetworkDeploymentMode,omitempty"`
// Slice overlay network deployment mode: single-network, multi-network or no-network
SliceOverlayNetworkDeploymentMode controllerv1alpha1.NetworkType `json:"sliceOverlayNetworkDeploymentMode,omitempty"`
}

// NamespaceIsolationProfile defines the namespace isolation policy for the slice
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

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

77 changes: 39 additions & 38 deletions config/crd/bases/networking.kubeslice.io_serviceexports.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: serviceexports.networking.kubeslice.io
spec:
group: networking.kubeslice.io
Expand Down Expand Up @@ -46,23 +44,29 @@ spec:
description: ServiceExport is the Schema for the serviceexports API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ServiceExportSpec defines the desired state of ServiceExport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -84,8 +88,9 @@ spec:
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults
to "TCP".
description: |-
Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
servicePort:
description: Port number of the exported service
Expand Down Expand Up @@ -114,24 +119,24 @@ spec:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
Expand All @@ -144,13 +149,13 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
slice:
description: Slice denotes the slice which the app is part of
type: string
Expand All @@ -163,8 +168,9 @@ spec:
description: ServiceExportStatus defines the observed state of ServiceExport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -178,8 +184,9 @@ spec:
description: ExportStatus denotes the export status of the service
type: string
exposedPorts:
description: ExposedPorts shows a one line representation of ports
and protocols exposed only used to show as a printercolumn
description: |-
ExposedPorts shows a one line representation of ports and protocols exposed
only used to show as a printercolumn
type: string
ingressGwEnabled:
description: IngressGwEnabled denotes ingress gw is enabled for the
Expand Down Expand Up @@ -235,9 +242,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
42 changes: 21 additions & 21 deletions config/crd/bases/networking.kubeslice.io_serviceimports.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: serviceimports.networking.kubeslice.io
spec:
group: networking.kubeslice.io
Expand Down Expand Up @@ -40,23 +38,29 @@ spec:
description: ServiceImport is the Schema for the serviceimports API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ServiceImportSpec defines the desired state of ServiceImport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -77,8 +81,9 @@ spec:
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults
to "TCP".
description: |-
Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
servicePort:
description: Port number of the exported service
Expand Down Expand Up @@ -143,8 +148,9 @@ spec:
type: object
type: array
exposedPorts:
description: ExposedPorts shows a one line representation of ports
and protocols exposed only used to show as a printercolumn
description: |-
ExposedPorts shows a one line representation of ports and protocols exposed
only used to show as a printercolumn
type: string
importStatus:
description: ImportStatus denotes the status of the imported service
Expand All @@ -163,9 +169,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading
Loading