Skip to content

Commit

Permalink
Merge pull request #258 from wanglet/main-helm-chart-update-1
Browse files Browse the repository at this point in the history
helm-chart: update chart
  • Loading branch information
haotao geng committed Jan 7, 2022
2 parents e2ab120 + e2479d3 commit 6176ef5
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 139 deletions.
Binary file removed deploy/fabedge-0.4.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion deploy/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ keywords:
maintainers:
- name: fabedge
email: fabedge@beyondcent.com
appVersion: "v0.4"
appVersion: "v0.4.0"
21 changes: 21 additions & 0 deletions deploy/helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,24 @@ release: {{ .Release.Name }}
{{- end -}}
{{- end -}}
{{- end }}

{{- define "cniType" -}}
{{- if .Values.cniType -}}
{{- .Values.cniType -}}
{{- else -}}
{{- $cniTypeVar := "" -}}
{{- range $index, $pod := (lookup "v1" "Pod" "" "").items -}}
{{- if hasPrefix "kube-flannel" $pod.metadata.name -}}
{{- $cniTypeVar = "flannel" -}}
{{- end -}}
{{- if hasPrefix "calico-node" $pod.metadata.name -}}
{{- $cniTypeVar = "calico" -}}
{{- end -}}
{{- end }}
{{- if $cniTypeVar -}}
{{- $cniTypeVar -}}
{{- else -}}
{{- "flannel" -}}
{{- end -}}
{{- end }}
{{- end }}
11 changes: 1 addition & 10 deletions deploy/helm-chart/templates/connector-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,7 @@ spec:
image: {{ .Values.connector.image.repository }}:{{ .Values.connector.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.connector.image.pullPolicy }}
args:
{{- $cniType := "" -}}
{{- range $index, $pod := (lookup "v1" "Pod" "" "").items -}}
{{- if hasPrefix "kube-flannel" $pod.metadata.name -}}
{{- $cniType = "flannel" -}}
{{- end -}}
{{- if hasPrefix "calico-node" $pod.metadata.name -}}
{{- $cniType = "calico" -}}
{{- end -}}
{{- end }}
- --cni-type={{ $cniType }}
- --cni-type={{ include "cniType" . }}
- --sync-period={{ .Values.connector.syncPeriod }}
- --connector-node-addresses={{ include "connector.node.addresses" . }}
- -v=5
Expand Down
121 changes: 60 additions & 61 deletions deploy/helm-chart/templates/fabedge.io_clusters.yaml
Original file line number Diff line number Diff line change
@@ -1,84 +1,83 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: clusters.fabedge.io
spec:
additionalPrinterColumns:
- JSONPath: .metadata.creationTimestamp
description: How long a community is created
name: Age
type: date
group: fabedge.io
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Cluster
subresources: {}
validation:
openAPIV3Schema:
description: Cluster is used to represent a cluster's endpoints of connector
and edge nodes
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:
properties:
endPoints:
description: Endpoints of connector and exported edge nodes of a cluster
items:
properties:
id:
type: string
name:
type: string
nodeSubnets:
description: internal IPs of kubernetes node
items:
versions:
- additionalPrinterColumns:
- description: How long a community is created
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Cluster is used to represent a cluster's endpoints of connector
and edge nodes
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:
properties:
endPoints:
description: Endpoints of connector and exported edge nodes of a cluster
items:
properties:
id:
type: string
type: array
publicAddresses:
description: public addresses can be IP, DNS
items:
name:
type: string
type: array
subnets:
description: pod subnets
items:
nodeSubnets:
description: internal IPs of kubernetes node
items:
type: string
type: array
publicAddresses:
description: public addresses can be IP, DNS
items:
type: string
type: array
subnets:
description: pod subnets
items:
type: string
type: array
type:
description: 'Type of endpoints: Connector or EdgeNode'
type: string
type: array
type:
description: 'Type of endpoints: Connector or EdgeNode'
type: string
type: object
type: array
token:
description: Token is used by child cluster to access root cluster's
apiserver
type: string
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
type: object
type: array
token:
description: Token is used by child cluster to access root cluster's
apiserver
type: string
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
Expand Down
77 changes: 38 additions & 39 deletions deploy/helm-chart/templates/fabedge.io_communities.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
name: communities.fabedge.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.members
description: community members
name: Members
type: string
- JSONPath: .metadata.creationTimestamp
description: How long a community is created
name: Age
type: date
group: fabedge.io
names:
kind: Community
listKind: CommunityList
plural: communities
singular: community
scope: Cluster
subresources: {}
validation:
openAPIV3Schema:
description: Community is used to manage a communication unit, it's members
should be edge nodes
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:
properties:
members:
items:
type: string
type: array
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: community members
jsonPath: .spec.members
name: Members
type: string
- description: How long a community is created
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Community is used to manage a communication unit, it's members
should be edge nodes
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:
properties:
members:
items:
type: string
type: array
type: object
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
Expand Down
11 changes: 1 addition & 10 deletions deploy/helm-chart/templates/operator-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,7 @@ spec:
- --init-token={{ .Values.operator.initToken }}
{{- end }}
- --edge-pod-cidr={{ .Values.operator.edgePodCIDR }}
{{- $cniType := "" -}}
{{- range $index, $pod := (lookup "v1" "Pod" "" "").items -}}
{{- if hasPrefix "kube-flannel" $pod.metadata.name -}}
{{- $cniType = "flannel" -}}
{{- end -}}
{{- if hasPrefix "calico-node" $pod.metadata.name -}}
{{- $cniType = "calico" -}}
{{- end -}}
{{- end }}
- --cni-type={{ $cniType }}
- --cni-type={{ include "cniType" . }}
- --agent-image={{ .Values.agent.image.repository }}:{{ .Values.agent.image.tag | default .Chart.AppVersion }}
- --agent-strongswan-image={{ .Values.strongswan.image.repository }}:{{ .Values.strongswan.image.tag | default .Chart.AppVersion }}
- --edge-labels={{ join "," .Values.operator.edgeLabels }}
Expand Down

0 comments on commit 6176ef5

Please sign in to comment.