Skip to content

Commit e8dc966

Browse files
✨ Add openstack plugin logic (#4)
* Add openstack plugin logic Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Move imageDir to the config.yaml file Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Add optional node-image-registry-path flag Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Move copy of node-images.yaml file outside of for loop Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Add reference to the DiskFormat,ContainerFormat fields in CreateOpts struct Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Incorporate comments from review Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Fix typo Co-authored-by: Roman Hros <roman.hros@dnation.cloud> Signed-off-by: Michal Gubricky <michal.gubricky@dnation.cloud> * Adjust updateURLNodeImages function Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Import CreateOpts from gophercloud images package Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Fail if <node-image-registry-path> is empty in build method Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Add verify field into registry.yaml file Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Add cacert field to the registry.yaml Related to #11 Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Update main.go Co-authored-by: Roman Hros <roman.hros@dnation.cloud> Signed-off-by: Michal Gubricky <michal.gubricky@dnation.cloud> * Update main.go Co-authored-by: Roman Hros <roman.hros@dnation.cloud> Signed-off-by: Michal Gubricky <michal.gubricky@dnation.cloud> * Change csctl version to pseudo version Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Fix lint error Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> * Remove linter for docker Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> --------- Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud> Signed-off-by: Michal Gubricky <michal.gubricky@dnation.cloud> Co-authored-by: Roman Hros <roman.hros@dnation.cloud>
1 parent 032044a commit e8dc966

File tree

1,311 files changed

+515409
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,311 files changed

+515409
-3
lines changed

.github/workflows/pr-lint.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,3 @@ jobs:
4747

4848
- name: Lint YAML
4949
run: make BUILD_IN_CONTAINER=false lint-yaml-ci
50-
51-
- name: Lint Dockerfile
52-
run: make BUILD_IN_CONTAINER=false lint-dockerfile

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ ignore:
2626
- '.cache'
2727
- _artifacts
2828
- dist
29+
- example
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
values: |
2+
metrics-server:
3+
commonLabels:
4+
domain: "{{ .Cluster.spec.controlPlaneEndpoint.host }}"
5+
clusterAddonVersion: "v2"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: metrics-server
3+
repository: https://kubernetes-sigs.github.io/metrics-server/
4+
version: 3.11.0
5+
digest: sha256:d92caa34d06b047b0390aa33a6f5d15d4fe0566143625204ebbbc69085133c4e
6+
generated: "2023-09-12T12:02:23.747094767+02:00"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v2
2+
dependencies:
3+
- alias: metrics-server
4+
name: metrics-server
5+
repository: https://kubernetes-sigs.github.io/metrics-server/
6+
version: 3.11.0
7+
description: 'This chart installs and configures: * Openstack Ferrol Cluster Class '
8+
maintainers:
9+
- email: info@syself.com
10+
name: Syself
11+
url: https://github.com/syself
12+
name: openstack-ferrol-1-27-cluster-addon
13+
type: application
14+
version: << .ClusterAddonVersion >>
8.26 KB
Binary file not shown.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "cluster-addon.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "cluster-addon.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "cluster-addon.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "cluster-addon.labels" -}}
37+
helm.sh/chart: {{ include "cluster-addon.chart" . }}
38+
{{ include "cluster-addon.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "cluster-addon.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cluster-addon.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "cluster-addon.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cluster-addon.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# kindnetd networking manifest
2+
---
3+
kind: ClusterRole
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
metadata:
6+
name: kindnet
7+
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- nodes
12+
verbs:
13+
- list
14+
- watch
15+
- patch
16+
- apiGroups:
17+
- ""
18+
resources:
19+
- configmaps
20+
verbs:
21+
- get
22+
---
23+
kind: ClusterRoleBinding
24+
apiVersion: rbac.authorization.k8s.io/v1
25+
metadata:
26+
name: kindnet
27+
roleRef:
28+
apiGroup: rbac.authorization.k8s.io
29+
kind: ClusterRole
30+
name: kindnet
31+
subjects:
32+
- kind: ServiceAccount
33+
name: kindnet
34+
namespace: kube-system
35+
---
36+
apiVersion: v1
37+
kind: ServiceAccount
38+
metadata:
39+
name: kindnet
40+
namespace: kube-system
41+
---
42+
apiVersion: apps/v1
43+
kind: DaemonSet
44+
metadata:
45+
name: kindnet
46+
namespace: kube-system
47+
labels:
48+
tier: node
49+
app: kindnet
50+
k8s-app: kindnet
51+
spec:
52+
selector:
53+
matchLabels:
54+
app: kindnet
55+
template:
56+
metadata:
57+
labels:
58+
tier: node
59+
app: kindnet
60+
k8s-app: kindnet
61+
spec:
62+
hostNetwork: true
63+
tolerations:
64+
- operator: Exists
65+
effect: NoSchedule
66+
serviceAccountName: kindnet
67+
containers:
68+
- name: kindnet-cni
69+
image: kindest/kindnetd:v20230511-dc714da8
70+
env:
71+
- name: HOST_IP
72+
valueFrom:
73+
fieldRef:
74+
fieldPath: status.hostIP
75+
- name: POD_IP
76+
valueFrom:
77+
fieldRef:
78+
fieldPath: status.podIP
79+
# We're using the dualstack CIDRs here. The order doesn't matter for kindnet as the loops are run concurrently.
80+
# REF: https://github.com/kubernetes-sigs/kind/blob/3dbeb894e3092a336ab4278d3823e73a1d66aff7/images/kindnetd/cmd/kindnetd/main.go#L149-L175
81+
- name: POD_SUBNET
82+
value: '${OPENSTACK_POD_CIDRS},${OPENSTACK_POD_IPV6_CIDRS}'
83+
volumeMounts:
84+
- name: cni-cfg
85+
mountPath: /etc/cni/net.d
86+
- name: xtables-lock
87+
mountPath: /run/xtables.lock
88+
readOnly: false
89+
- name: lib-modules
90+
mountPath: /lib/modules
91+
readOnly: true
92+
resources:
93+
requests:
94+
cpu: "100m"
95+
memory: "50Mi"
96+
limits:
97+
cpu: "100m"
98+
memory: "50Mi"
99+
securityContext:
100+
privileged: false
101+
capabilities:
102+
add: ["NET_RAW", "NET_ADMIN"]
103+
volumes:
104+
- name: cni-bin
105+
hostPath:
106+
path: /opt/cni/bin
107+
type: DirectoryOrCreate
108+
- name: cni-cfg
109+
hostPath:
110+
path: /etc/cni/net.d
111+
type: DirectoryOrCreate
112+
- name: xtables-lock
113+
hostPath:
114+
path: /run/xtables.lock
115+
type: FileOrCreate
116+
- name: lib-modules
117+
hostPath:
118+
path: /lib/modules
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
metrics-server:
2+
fullnameOverride: metrics-server
3+
replicas: 1
4+
updateStrategy:
5+
type: RollingUpdate
6+
rollingUpdate:
7+
maxSurge: 0
8+
maxUnavailable: 1
9+
10+
podDisruptionBudget:
11+
apiVersion: policy/v1
12+
enabled: true
13+
minAvailable: 1
14+
15+
tolerations:
16+
- key: node-role.kubernetes.io/master
17+
effect: NoSchedule
18+
- key: CriticalAddonsOnly
19+
operator: Exists
20+
21+
service:
22+
labels:
23+
kubernetes.io/cluster-service: "true"
24+
kubernetes.io/name: "metrics-server"
25+
26+
defaultArgs:
27+
- --cert-dir=/tmp
28+
- --kubelet-preferred-address-types=ExternalIP,Hostname
29+
- --kubelet-use-node-status-port
30+
- --metric-resolution=15s
31+
32+
args:
33+
- --kubelet-insecure-tls
34+
35+
affinity:
36+
podAntiAffinity:
37+
requiredDuringSchedulingIgnoredDuringExecution:
38+
- labelSelector:
39+
matchExpressions:
40+
- key: app.kubernetes.io/name
41+
operator: In
42+
values:
43+
- metrics-server
44+
topologyKey: "kubernetes.io/hostname"

0 commit comments

Comments
 (0)