refactor nmstate to appset
This commit is contained in:
37
cluster/nmstate-operator-appset.yaml
Normal file
37
cluster/nmstate-operator-appset.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: ApplicationSet
|
||||||
|
metadata:
|
||||||
|
name: nmstate-oprtstor
|
||||||
|
namespace: openshift-gitops
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
goTemplate: true
|
||||||
|
goTemplateOptions: ["missingkey=error"]
|
||||||
|
generators:
|
||||||
|
- clusters: {} # Variable is .name
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: '{{.name}}-cert-manager'
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "1"
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
name: '{{.name}}'
|
||||||
|
namespace: openshift-nmstate
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
path: cluster/nmstate/overlays/'{{.name}}'
|
||||||
|
repoURL: https://github.com/rblundon/homelab.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- RespectIgnoreDifferences=true
|
||||||
|
- CreateNamespace=true
|
||||||
|
managedNamespaceMetadata:
|
||||||
|
labels:
|
||||||
|
argocd.argoproj.io/managed-by: openshift-gitops
|
||||||
@@ -2,5 +2,7 @@ apiVersion: operator.openshift.io/v1
|
|||||||
kind: Network
|
kind: Network
|
||||||
metadata:
|
metadata:
|
||||||
name: cluster
|
name: cluster
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "4"
|
||||||
spec:
|
spec:
|
||||||
useMultiNetworkPolicy: true
|
useMultiNetworkPolicy: true
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "1"
|
||||||
labels:
|
labels:
|
||||||
kubernetes.io/metadata.name: openshift-nmstate
|
kubernetes.io/metadata.name: openshift-nmstate
|
||||||
name: openshift-nmstate
|
name: openshift-nmstate
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
apiVersion: nmstate.io/v1
|
apiVersion: nmstate.io/v1
|
||||||
kind: NMState
|
kind: NMState
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "4"
|
||||||
name: nmstate
|
name: nmstate
|
||||||
spec: {}
|
spec: {}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
apiVersion: operators.coreos.com/v1
|
apiVersion: operators.coreos.com/v1
|
||||||
kind: OperatorGroup
|
kind: OperatorGroup
|
||||||
metadata:
|
metadata:
|
||||||
annotations: {}
|
annotations:
|
||||||
# olm.providedAPIs: NMState.v1.nmstate.io
|
argocd.argoproj.io/sync-wave: "3"
|
||||||
name: openshift-nmstate
|
name: openshift-nmstate
|
||||||
namespace: openshift-nmstate
|
namespace: openshift-nmstate
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
apiVersion: operators.coreos.com/v1alpha1
|
apiVersion: operators.coreos.com/v1alpha1
|
||||||
kind: Subscription
|
kind: Subscription
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "2"
|
||||||
labels:
|
labels:
|
||||||
operators.coreos.com/kubernetes-nmstate-operator.openshift-nmstate: ""
|
operators.coreos.com/kubernetes-nmstate-operator.openshift-nmstate: ""
|
||||||
name: kubernetes-nmstate-operator
|
name: kubernetes-nmstate-operator
|
||||||
|
|||||||
38
cluster/nmstate/overlays/in-cluster/iscsi-nad.yaml
Normal file
38
cluster/nmstate/overlays/in-cluster/iscsi-nad.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
apiVersion: k8s.cni.cncf.io/v1
|
||||||
|
kind: NetworkAttachmentDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
description: Native VLAN connection for iSCSI
|
||||||
|
name: vlan121-localnet
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
config: |-
|
||||||
|
{
|
||||||
|
"name": "iscsi-net",
|
||||||
|
"cniVersion": "0.3.1",
|
||||||
|
"type": "vlan",
|
||||||
|
"master": "enp1s0f0",
|
||||||
|
"mtu": 1500,
|
||||||
|
"vlanId": 121,
|
||||||
|
"linkInContainer": false,
|
||||||
|
"ipam": {
|
||||||
|
"type": "static",
|
||||||
|
"addresses": [
|
||||||
|
{
|
||||||
|
"address": "10.10.121.10/24"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# {
|
||||||
|
# "cniVersion": "0.3.1",
|
||||||
|
# "name": "bridge-net",
|
||||||
|
# "type": "bridge",
|
||||||
|
# "isGateway": true,
|
||||||
|
# "vlan": 2,
|
||||||
|
# "ipam": {
|
||||||
|
# "type": "dhcp"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
9
cluster/nmstate/overlays/in-cluster/kustomization.yaml
Normal file
9
cluster/nmstate/overlays/in-cluster/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
commonAnnotations:
|
||||||
|
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
|
- ocp-storage-vlan.yaml
|
||||||
30
cluster/nmstate/overlays/in-cluster/ocp-storage-vlan.yaml
Normal file
30
cluster/nmstate/overlays/in-cluster/ocp-storage-vlan.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
apiVersion: nmstate.io/v1
|
||||||
|
kind: NodeNetworkConfigurationPolicy
|
||||||
|
metadata:
|
||||||
|
name: storage-network-ocp-hub
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "10"
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: ocp-hub
|
||||||
|
desiredState:
|
||||||
|
interfaces:
|
||||||
|
- name: enp1s0f0.121
|
||||||
|
state: up
|
||||||
|
type: vlan
|
||||||
|
vlan:
|
||||||
|
base-iface: enp1s0f0
|
||||||
|
id: 121
|
||||||
|
- bridge:
|
||||||
|
port:
|
||||||
|
- name: enp1s0f0.121
|
||||||
|
ipv4:
|
||||||
|
address:
|
||||||
|
- ip: 10.10.121.10
|
||||||
|
prefix-length: 24
|
||||||
|
enabled: true
|
||||||
|
name: storage-network
|
||||||
|
state: up
|
||||||
|
type: linux-bridge
|
||||||
|
description: Linux bridge with enp1s0 as a port on VLAN 121
|
||||||
38
cluster/nmstate/overlays/internal/iscsi-nad.yaml
Normal file
38
cluster/nmstate/overlays/internal/iscsi-nad.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
apiVersion: k8s.cni.cncf.io/v1
|
||||||
|
kind: NetworkAttachmentDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
description: Native VLAN connection for iSCSI
|
||||||
|
name: vlan121-localnet
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
config: |-
|
||||||
|
{
|
||||||
|
"name": "iscsi-net",
|
||||||
|
"cniVersion": "0.3.1",
|
||||||
|
"type": "vlan",
|
||||||
|
"master": "enp1s0f0",
|
||||||
|
"mtu": 1500,
|
||||||
|
"vlanId": 121,
|
||||||
|
"linkInContainer": false,
|
||||||
|
"ipam": {
|
||||||
|
"type": "static",
|
||||||
|
"addresses": [
|
||||||
|
{
|
||||||
|
"address": "10.10.121.10/24"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# {
|
||||||
|
# "cniVersion": "0.3.1",
|
||||||
|
# "name": "bridge-net",
|
||||||
|
# "type": "bridge",
|
||||||
|
# "isGateway": true,
|
||||||
|
# "vlan": 2,
|
||||||
|
# "ipam": {
|
||||||
|
# "type": "dhcp"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
9
cluster/nmstate/overlays/internal/kustomization.yaml
Normal file
9
cluster/nmstate/overlays/internal/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
commonAnnotations:
|
||||||
|
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
|
- ocp-storage-vlan.yaml
|
||||||
61
cluster/nmstate/overlays/internal/ocp-storage-vlan.yaml
Normal file
61
cluster/nmstate/overlays/internal/ocp-storage-vlan.yaml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
---
|
||||||
|
apiVersion: nmstate.io/v1
|
||||||
|
kind: NodeNetworkConfigurationPolicy
|
||||||
|
metadata:
|
||||||
|
name: storage-network-int-worker01
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "10"
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: int-worker01
|
||||||
|
desiredState:
|
||||||
|
interfaces:
|
||||||
|
- name: enp2s0f0.121
|
||||||
|
state: up
|
||||||
|
type: vlan
|
||||||
|
vlan:
|
||||||
|
base-iface: enp2s0f0
|
||||||
|
id: 121
|
||||||
|
- bridge:
|
||||||
|
port:
|
||||||
|
- name: enp2s0f0.121
|
||||||
|
ipv4:
|
||||||
|
address:
|
||||||
|
- ip: 10.10.121.64
|
||||||
|
prefix-length: 24
|
||||||
|
enabled: true
|
||||||
|
name: storage-network
|
||||||
|
state: up
|
||||||
|
type: linux-bridge
|
||||||
|
description: Linux bridge with enp1s0 as a port on VLAN 121
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: nmstate.io/v1
|
||||||
|
kind: NodeNetworkConfigurationPolicy
|
||||||
|
metadata:
|
||||||
|
name: storage-network-int-worker02
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "10"
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: int-worker02
|
||||||
|
desiredState:
|
||||||
|
interfaces:
|
||||||
|
- name: enp2s0f0.121
|
||||||
|
state: up
|
||||||
|
type: vlan
|
||||||
|
vlan:
|
||||||
|
base-iface: enp2s0f0
|
||||||
|
id: 121
|
||||||
|
- bridge:
|
||||||
|
port:
|
||||||
|
- name: enp2s0f0.121
|
||||||
|
ipv4:
|
||||||
|
address:
|
||||||
|
- ip: 10.10.121.65
|
||||||
|
prefix-length: 24
|
||||||
|
enabled: true
|
||||||
|
name: storage-network
|
||||||
|
state: up
|
||||||
|
type: linux-bridge
|
||||||
|
description: Linux bridge with enp1s0 as a port on VLAN 121
|
||||||
Reference in New Issue
Block a user