Skip to content

Commit

Permalink
Merge pull request #5 from amisstea/KFLUXVNGD-104
Browse files Browse the repository at this point in the history
Add configurable imageContentSources value
  • Loading branch information
hmariset authored Oct 31, 2024
2 parents 80966c2 + 2d52613 commit fd4d7b9
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/hypershift-aws-template/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 4 additions & 4 deletions charts/hypershift-aws-template/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
image: public.ecr.aws/aws-cli/aws-cli:2.17.41@sha256:76c484c1d90d4c798554b92427c42f7f33f5626e437ee120e9c90e63c35a886d
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /secret/aws-credentials
value: /opt/hypershift/secret/aws-credentials
volumeMounts:
- name: secret
mountPath: /secret
mountPath: /opt/hypershift/secret
- name: sts
mountPath: /sts
mountPath: /opt/hypershift/sts
command: ["/bin/sh"]
args:
- -ec
- |
aws sts get-session-token --output json > /sts/token.json
aws sts get-session-token --output json > /opt/hypershift/sts/token.json
echo "STS token acquired successfully"
{{- end -}}
9 changes: 9 additions & 0 deletions charts/hypershift-aws-template/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-{{ .Release.Name }}
namespace: "{{ .Release.Namespace }}"
data:
image-content-sources.yaml: |
{{- .Values.imageContentSources | nindent 4 }}
15 changes: 11 additions & 4 deletions charts/hypershift-aws-template/templates/create-cluster-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ spec:
restartPolicy: Never
volumes:
{{- include "credential-volumes" . | nindent 8 }}
- name: config
configMap:
name: config-{{ .Release.Name }}
initContainers:
{{- include "aws-sts-init-container" . | nindent 8 }}
containers:
- name: hypershift
image: "{{ .Values.hypershiftImage }}"
volumeMounts:
- name: sts
mountPath: /sts
mountPath: /opt/hypershift/sts
- name: secret
mountPath: /secret
mountPath: /opt/hypershift/secret
- name: config
mountPath: /opt/hypershift/config
command:
- hypershift
args:
Expand All @@ -36,11 +41,13 @@ spec:
- --namespace
- "{{ .Release.Namespace }}"
- --sts-creds
- /sts/token.json
- /opt/hypershift/sts/token.json
- --role-arn
- "{{ .Values.hypershiftRoleArn }}"
- --pull-secret
- /secret/pull-secret
- /opt/hypershift/secret/pull-secret
- --image-content-sources
- /opt/hypershift/config/image-content-sources.yaml
- --base-domain
- "{{ .Values.baseDomain }}"
- --region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
image: "{{ .Values.hypershiftImage }}"
volumeMounts:
- name: sts
mountPath: /sts
mountPath: /opt/hypershift/sts
command:
- hypershift
args:
Expand All @@ -39,7 +39,7 @@ spec:
- --namespace
- "{{ .Release.Namespace }}"
- --sts-creds
- /sts/token.json
- /opt/hypershift/sts/token.json
- --role-arn
- "{{ .Values.hypershiftRoleArn }}"
- --region
Expand Down
5 changes: 5 additions & 0 deletions charts/hypershift-aws-template/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"baseDomain",
"hypershiftImage",
"hypershiftRoleArn",
"imageContentSources",
"instanceType",
"nodePoolReplicas",
"region",
Expand All @@ -25,6 +26,10 @@
"type": "string",
"description": "The ARN of the IAM role assumed by the STS credentials provided to the hypershift CLI"
},
"imageContentSources": {
"type": "string",
"description": "Alternate registry information containing a list of sources and their mirrors in yaml format"
},
"instanceType": {
"type": "string",
"description": "AWS EC2 instance type for worker nodes. Use m5.* for amd64 and m6g.* for arm64.",
Expand Down
2 changes: 2 additions & 0 deletions charts/hypershift-aws-template/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

hypershiftImage: quay.io/hypershift/hypershift-operator:latest

imageContentSources: ""

instanceType: m5.large

nodePoolReplicas: 2
Expand Down

0 comments on commit fd4d7b9

Please sign in to comment.