Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Open
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Create and enter your Scaleway credentials with:
kubectl create -f https://raw.githubusercontent.com/Sh4d1/scaleway-k8s-vpc/main/secret.yaml --edit --namespace scaleway-k8s-vpc-system
```

Or with helm
```shell
$ helm install scaleway-k8s-vpc helm/scaleway-k8s-vpc
```

You can now create the following PrivateNetwork object:
```yaml
apiVersion: vpc.scaleway.com/v1alpha1
Expand Down
23 changes: 23 additions & 0 deletions helm/scaleway-k8s-vpc/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions helm/scaleway-k8s-vpc/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v2
name: scaleway-k8s-vpc
description: Deploy scaleway vpc operator
type: application
version: 0.1.0
43 changes: 43 additions & 0 deletions helm/scaleway-k8s-vpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# scaleway-k8s-vpc

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Deploy scaleway vpc operator

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| controller.affinity | object | `{}` | |
| controller.image.pullPolicy | string | `"IfNotPresent"` | |
| controller.image.repository | string | `"sh4d1/scaleway-k8s-vpc"` | |
| controller.image.tag | string | `"latest"` | |
| controller.name | string | `"controller"` | |
| controller.nodeSelector."kubernetes.io/os" | string | `"linux"` | |
| controller.resources.limits.cpu | string | `"100m"` | |
| controller.resources.limits.memory | string | `"30Mi"` | |
| controller.resources.requests.cpu | string | `"100m"` | |
| controller.resources.requests.memory | string | `"20Mi"` | |
| controller.secret.enabled | bool | `false` | |
| controller.secret.name | string | `"{{ include \"scaleway-k8s-vpc.controller.fullname\" . }}"` | |
| controller.secret.values.SCW_ACCESS_KEY | string | `"<YOUR-ACCESS-KEY>"` | |
| controller.secret.values.SCW_DEFAULT_PROJECT_ID | string | `"<YOUR-PROJECT-ID>"` | |
| controller.secret.values.SCW_DEFAULT_ZONE | string | `"<YOUR-DEFAULT-REGION>"` | |
| controller.secret.values.SCW_SECRET_KEY | string | `"<YOUR-SECRET-KEY>"` | |
| controller.tolerations | list | `[]` | |
| node.affinity | object | `{}` | |
| node.image.pullPolicy | string | `"IfNotPresent"` | |
| node.image.repository | string | `"sh4d1/scaleway-k8s-vpc-node"` | |
| node.image.tag | string | `"latest"` | |
| node.name | string | `"node"` | |
| node.nodeSelector."kubernetes.io/os" | string | `"linux"` | |
| node.priorityClassName | string | `"system-node-critical"` | |
| node.resources.limits.cpu | string | `"100m"` | |
| node.resources.limits.memory | string | `"30Mi"` | |
| node.resources.requests.cpu | string | `"100m"` | |
| node.resources.requests.memory | string | `"20Mi"` | |
| node.tolerations[0].effect | string | `"NoSchedule"` | |
| node.tolerations[0].operator | string | `"Exists"` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.4.0](https://github.com/norwoodj/helm-docs/releases/v1.4.0)
92 changes: 92 additions & 0 deletions helm/scaleway-k8s-vpc/crds/networkinterfaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: networkinterfaces.vpc.scaleway.com
spec:
group: vpc.scaleway.com
names:
kind: NetworkInterface
listKind: NetworkInterfaceList
plural: networkinterfaces
shortNames:
- ni
- nif
- networkinterface
- netiface
- niface
singular: networkinterface
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .status.address
name: address
type: string
- jsonPath: .spec.nodeName
name: node name
type: string
- jsonPath: .status.macAddress
name: mac address
type: string
- jsonPath: .status.linkName
name: link name
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: NetworkInterface is the Schema for the networkinterfaces 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'
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'
type: string
metadata:
type: object
spec:
description: NetworkInterfaceSpec defines the desired state of NetworkInterface
properties:
address:
description: Address is the address of the interface deprecated
type: string
id:
description: ID is the ID of the NIC
type: string
nodeName:
description: NodeName is the name of the node the interface is attached to
type: string
required:
- id
- nodeName
type: object
status:
description: NetworkInterfaceStatus defines the observed state of NetworkInterface
properties:
address:
description: Address is the address of the interface
type: string
linkName:
description: LinkName is the name of the Interface
type: string
macAddress:
description: MacAddress is the mac address of the interface
type: string
required:
- linkName
- macAddress
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
108 changes: 108 additions & 0 deletions helm/scaleway-k8s-vpc/crds/privatenetwork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: privatenetworks.vpc.scaleway.com
spec:
group: vpc.scaleway.com
names:
kind: PrivateNetwork
listKind: PrivateNetworkList
plural: privatenetworks
shortNames:
- pn
- privnet
- privatenet
- privatenetwork
singular: privatenetwork
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.id
name: id
type: string
- jsonPath: .spec.ipam.type
name: ipam type
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: PrivateNetwork is the Schema for the privatenetworks 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'
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'
type: string
metadata:
type: object
spec:
description: PrivateNetworkSpec defines the desired state of PrivateNetwork
properties:
cidr:
description: CIDR is the CIDR of the PrivateNetwork deprecated
type: string
id:
description: ID is the ID of the PrivateNetwork
type: string
ipam:
description: PrivateNetworkIPAM defines the IPAM for the PrivateNetwork
properties:
static:
properties:
cidr:
type: string
required:
- cidr
type: object
type:
description: IPAMType represents a type of IPAM
enum:
- DHCP
- Static
type: string
required:
- type
type: object
masquerade:
default: true
description: Masquerade represents whether the private network needs to be masqueraded
type: boolean
routes:
description: Routes are the routes injected in the cluster to this PrivateNetwork
items:
description: PrivateNetworkRoute defines a route from the PrivateNetwork
properties:
to:
type: string
via:
type: string
required:
- to
- via
type: object
type: array
zone:
description: Zone is the Zone of the PrivateNetwork Will default to the SCW_DEFAULT_ZONE env variable
type: string
required:
- id
type: object
status:
description: PrivateNetworkStatus defines the observed state of PrivateNetwork
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
66 changes: 66 additions & 0 deletions helm/scaleway-k8s-vpc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "scaleway-k8s-vpc.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "scaleway-k8s-vpc.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "scaleway-k8s-vpc.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified controller name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "scaleway-k8s-vpc.controller.fullname" -}}
{{- printf "%s-%s" (include "scaleway-k8s-vpc.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Create a default fully qualified default backend name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "scaleway-k8s-vpc.node.fullname" -}}
{{- printf "%s-%s" (include "scaleway-k8s-vpc.fullname" .) .Values.node.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "scaleway-k8s-vpc.labels" -}}
helm.sh/chart: {{ include "scaleway-k8s-vpc.chart" . }}
{{ include "scaleway-k8s-vpc.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "scaleway-k8s-vpc.selectorLabels" -}}
app.kubernetes.io/name: {{ include "scaleway-k8s-vpc.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

Loading