Skip to content

Commit

Permalink
Merge pull request #1 from Cray-HPE/develop
Browse files Browse the repository at this point in the history
Initial Helm chart for RIE
  • Loading branch information
rsjostrand-hpe authored Mar 20, 2023
2 parents 6207be9 + a5a16e4 commit b4221cb
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 2 deletions.
6 changes: 4 additions & 2 deletions changelog/v0.0.md → changelog/v0.1.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Changelog for v2.0
# Changelog for v0.1

All notable changes to this project for v0.0.X will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.1] - 2023-03-13
## [0.1.0] - 2023-03-17
### Added
- Initial helm chart to deploy RIE within VShasta. Currently only Mountain/Hill hardware can be discovered automatically via MEDS. Automatic discovery of River hardware is not currently supported.

13 changes: 13 additions & 0 deletions charts/v0.1/csm-redfish-interface-emulator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
name: "csm-redfish-interface-emulator"
version: 0.1.0
description: "Kubernetes resources for csm-redfish-interface-emulator"
home: https://github.com/Cray-HPE/csm-redfish-interface-emulator-charts
sources:
- https://github.com/Cray-HPE/csm-redfish-interface-emulator
maintainers:
- name: Hardware Management
url: https://github.com/orgs/Cray-HPE/teams/hardware-management
annotations:
artifacthub.io/license: MIT
appVersion: 1.4.0
1 change: 1 addition & 0 deletions charts/v0.1/csm-redfish-interface-emulator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# csm-redfish-interface-emulator
37 changes: 37 additions & 0 deletions charts/v0.1/csm-redfish-interface-emulator/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: csm-redfish-interface-emulator-loader-{{ .Release.Revision }}
labels:
app.kubernetes.io/name: "csm-redfish-interface-emulator-loader"
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
app.kubernetes.io/instance: "{{ .Release.Name }}"
spec:
template:
metadata:
labels:
app.kubernetes.io/name: "csm-redfish-interface-emulator-loader"
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
app.kubernetes.io/instance: "{{ .Release.Name }}"
spec:
restartPolicy: OnFailure
securityContext:
fsGroup: 65534
runAsUser: 65534
runAsNonRoot: true
containers:
- name: loader
image: "{{ $.Values.image.repository }}:{{ $.Values.global.appVersion }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
args: ["sls_loader.py", "/metadata.json"]
volumeMounts:
- mountPath: /metadata.json
subPath: metadata.json
name: metadata-cm
volumes:
- name: metadata-cm
configMap:
name: csm-redfish-interface-emulator-metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: csm-redfish-interface-emulator-metadata
labels:
app.kubernetes.io/name: "csm-redfish-interface-emulator"
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}"
app.kubernetes.io/managed-by: "{{ $.Release.Service }}"
app.kubernetes.io/instance: "{{ $.Release.Name }}"
data:
metadata.json: |-
{{ .Values.sls | toJson | indent 4 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{- range .Values.instances }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "csm-redfish-interface-emulator-{{ .Xname }}"
spec:
selector:
matchLabels:
app.kubernetes.io/name: "csm-redfish-interface-emulator-{{ .Xname }}"
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: "csm-redfish-interface-emulator-{{ .Xname }}"
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}"
app.kubernetes.io/managed-by: "{{ $.Release.Service }}"
app.kubernetes.io/instance: "{{ $.Release.Name }}"
spec:
containers:
- name: rie
image: "{{ $.Values.image.repository }}:{{ $.Values.global.appVersion }}"
imagePullPolicy: "{{ $.Values.image.pullPolicy }}"
env:
- name: MOCKUPFOLDER
value: {{ .mockup | quote }}
- name: XNAME
value: {{ .Xname | quote }}
{{- if .macSchema }}
- name: MACSCHEMA
value: {{ .macSchema | quote }}
{{- end }}
- name: AUTH_CONFIG
value: from_vault
- name: PORT
value: "443"
- name: VAULT_ADDR
value: http://cray-vault.vault:8200
- name: VAULT_BASE_KEYPATH
value: ""
- name: VAULT_AUTH_TYPE
value: kubernetes
- name: VAULT_DEFAULT_PASSWORD_SOURCE
value: {{ .defaultPasswordSource | default "Mountain" | quote }}
resources:
{{- $.Values.resources | toYaml | nindent 12 }}
livenessProbe:
httpGet:
path: /redfish/v1/
port: 443
scheme: HTTPS
readinessProbe:
httpGet:
path: /redfish/v1/
port: 443
scheme: HTTPS
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Xname | quote }}
labels:
app.kubernetes.io/name: "csm-redfish-interface-emulator-{{ .Xname }}"
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}"
app.kubernetes.io/managed-by: "{{ $.Release.Service }}"
app.kubernetes.io/instance: "{{ $.Release.Name }}"
spec:
type: ClusterIP
ports:
- port: 443
targetPort: 443
name: rie-https
protocol: TCP
selector:
app.kubernetes.io/name: "csm-redfish-interface-emulator-{{ .Xname }}"

{{- end }}
122 changes: 122 additions & 0 deletions charts/v0.1/csm-redfish-interface-emulator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
global:
appVersion: 1.4.0

image:
repository: artifactory.algol60.net/csm-docker/stable/csm-rie
pullPolicy: IfNotPresent

resources:
requests:
cpu: 10m
memory: 100Mi
limits:
cpu: 500m
memory: 512Mi

# Specify the desired configuration for each of the RIE instances
instances:
# - # Required Field: Xname of the RIE emulated BMC
# xname: x1000c0b0
#
# # Required Field: Choose one of the supported RIE mockups to select what type of BMC and hardware to emulate.
# # List of supported mockups can be found here: https://github.com/Cray-HPE/csm-redfish-interface-emulator/tree/master/mockups
# mockup: CMM
#
# # Optional Field: Choose from either Mountain or River.
# # If field not provided all mac addresses in RIE will be randomized, which is the same behavior as River. When Mountain is selected
# # The MAC addresses associated with the BMC will become algorithmic based off the BMC's xname.
# # If this field is not specified RIE will default to the behavior of River.
# macSchema: Mountain
#
# # Optional Field: Choose from either Mountain or River.
# # When RIE starts up it will check Vault at secret/hms-creds/${BMC_XNAME}, and if no value exists there then will fallback to the default
# # password source. On CSM systems there are two sources of default BMC credentials one for Mountain and one for River. To ensure a smooth
# # experience discovery hardware the RIE BMC should have the credentials that either MEDS (Mountain) or hms-discovery (River) utilizes for
# # default creds when first trying to talk to the BMC.
# # If field not provided Mountain will be defaulted to.
# defaultPasswordSource: Mountain
- {Xname: x1000c0b0, mockup: CMM, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s0b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s0b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s1b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s1b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s2b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s2b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s3b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s3b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s4b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s4b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s5b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s5b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s6b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s6b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s7b0, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0s7b1, mockup: EX425, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0r1b0, mockup: Slingshot_Switch_Blade, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0r3b0, mockup: Slingshot_Switch_Blade, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0r5b0, mockup: Slingshot_Switch_Blade, macSchema: Mountain, defaultPasswordSource: Mountain}
- {Xname: x1000c0r7b0, mockup: Slingshot_Switch_Blade, macSchema: Mountain, defaultPasswordSource: Mountain}

# Specify data to populate in SLS to facilitate discovery of the emulated hardware
sls:
Hardware:
- Xname: x1000
Class: Mountain
ExtraProperties:
# NOTE the following network information is not used for anything network related.
# The Networks.cn.HMN key needs to exist for MEDS to discover mountain hardware from the cabinet.
# The networks.*.*.{CIDR, Gateway,VLan} keys are needed for the HMS CT tests to pass.
Networks:
cn:
HMN:
CIDR: "10.104.0.0/22"
Gateway: "10.104.0.1"
VLan: 3000
NMN:
CIDR: "10.100.0.0/22"
Gateway: "10.100.0.1"
VLan: 2000

- {Xname: x1000c0, Class: Mountain}
- {Xname: x1000c0b0, Class: Mountain}

- {Xname: x1000c0s0b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1001, Aliases: [nid001001]}}
- {Xname: x1000c0s0b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1002, Aliases: [nid001002]}}
- {Xname: x1000c0s0b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1003, Aliases: [nid001003]}}
- {Xname: x1000c0s0b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1004, Aliases: [nid001004]}}

- {Xname: x1000c0s1b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1005, Aliases: [nid001005]}}
- {Xname: x1000c0s1b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1006, Aliases: [nid001006]}}
- {Xname: x1000c0s1b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1007, Aliases: [nid001007]}}
- {Xname: x1000c0s1b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1008, Aliases: [nid001008]}}

- {Xname: x1000c0s2b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1009, Aliases: [nid001009]}}
- {Xname: x1000c0s2b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1010, Aliases: [nid001010]}}
- {Xname: x1000c0s2b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1011, Aliases: [nid001011]}}
- {Xname: x1000c0s2b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1012, Aliases: [nid001012]}}

- {Xname: x1000c0s3b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1013, Aliases: [nid001013]}}
- {Xname: x1000c0s3b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1014, Aliases: [nid001014]}}
- {Xname: x1000c0s3b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1015, Aliases: [nid001015]}}
- {Xname: x1000c0s3b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1016, Aliases: [nid001016]}}

- {Xname: x1000c0s4b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1017, Aliases: [nid001017]}}
- {Xname: x1000c0s4b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1018, Aliases: [nid001018]}}
- {Xname: x1000c0s4b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1019, Aliases: [nid001019]}}
- {Xname: x1000c0s4b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1020, Aliases: [nid001020]}}

- {Xname: x1000c0s5b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1021, Aliases: [nid001021]}}
- {Xname: x1000c0s5b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1022, Aliases: [nid001022]}}
- {Xname: x1000c0s5b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1023, Aliases: [nid001023]}}
- {Xname: x1000c0s5b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1024, Aliases: [nid001024]}}

- {Xname: x1000c0s6b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1025, Aliases: [nid001025]}}
- {Xname: x1000c0s6b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1026, Aliases: [nid001026]}}
- {Xname: x1000c0s6b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1027, Aliases: [nid001027]}}
- {Xname: x1000c0s6b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1028, Aliases: [nid001028]}}

- {Xname: x1000c0s7b0n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1029, Aliases: [nid001029]}}
- {Xname: x1000c0s7b0n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1030, Aliases: [nid001030]}}
- {Xname: x1000c0s7b1n0, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1031, Aliases: [nid001031]}}
- {Xname: x1000c0s7b1n1, Class: Mountain, ExtraProperties: {Role: Compute, NID: 1032, Aliases: [nid001032]}}

0 comments on commit b4221cb

Please sign in to comment.