Skip to content

Commit

Permalink
add pulp vars
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Holloway <[email protected]>
  • Loading branch information
loadtheaccumulator authored and ezr-ondrej committed Oct 18, 2024
1 parent 7e3ff61 commit 824dcbe
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 27 deletions.
40 changes: 22 additions & 18 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type EdgeConfig struct {
PulpS3Region string `json:"pulp_s3_region,omitempty"`
PulpS3SecretKey string `json:"pulp_s3_secret_key,omitempty"`
PulpS3AccessKey string `json:"pulp_s3_access_key,omitempty"`
PulpGuardSubjectDN string `json:"pulp_guard_subject_dn,omitempty"`
CleanupBatchSize int `json:"cleanup_batch_size,omitempty"`
}

Expand Down Expand Up @@ -175,20 +176,21 @@ func CreateEdgeAPIConfig() (*EdgeConfig, error) {
options.SetDefault("DeleteFilesRetryDelay", 5)
options.SetDefault("RBAC_BASE_URL", "http://rbac-service:8080")
options.SetDefault("RbacTimeout", 30)
options.SetDefault("PulpURL", "http://pulp-service:8080")
options.SetDefault("PulpUsername", "edge-api-dev")
options.SetDefault("PulpPassword", "")
options.SetDefault("PulpContentUsername", "edge-content-dev")
options.SetDefault("PulpContentPassword", "")
options.SetDefault("PULP_URL", "http://pulp-service:8080")
options.SetDefault("PULP_USERNAME", "edge-api-dev")
options.SetDefault("PULP_PASSWORD", "")
options.SetDefault("PULP_CONTENT_USERNAME", "edge-content-dev")
options.SetDefault("PULP_CONTENT_PASSWORD", "")
options.SetDefault("PulpIdentityName", "edge-api-dev")
options.SetDefault("PulpProxyURL", "")
options.SetDefault("PulpOauth2URL", "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token")
options.SetDefault("PulpOauth2ClientID", "")
options.SetDefault("PulpOauth2ClientSecret", "")
options.SetDefault("PulpS3BucketName", "")
options.SetDefault("PulpS3Region", "DummyRegion")
options.SetDefault("PulpS3SecretKey", "")
options.SetDefault("PulpS3AccessKey", "")
options.SetDefault("PULP_S3_BUCKETNAME", "")
options.SetDefault("PULP_S3_REGION", "DummyRegion")
options.SetDefault("PULP_S3_SECRETKEY", "")
options.SetDefault("PULP_S3_ACCESSKEY", "")
options.SetDefault("PULP_GUARD_SUBJECT_DN", "")
options.SetDefault("CleanupBatchSize", "500")
options.AutomaticEnv()

Expand Down Expand Up @@ -285,20 +287,21 @@ func CreateEdgeAPIConfig() (*EdgeConfig, error) {
RbacTimeout: options.GetUint("RbacTimeout"),
SubscriptionServerURL: options.GetString("SUBSCRIPTION_SERVER_URL"),
SubscriptionBaseUrl: options.GetString("SUBSCRIPTION_BASE_URL"),
PulpURL: options.GetString("PulpURL"),
PulpUsername: options.GetString("PulpUsername"),
PulpPassword: options.GetString("PulpPassword"),
PulpContentUsername: options.GetString("PulpContentUsername"),
PulpContentPassword: options.GetString("PulpContentPassword"),
PulpURL: options.GetString("PULP_URL"),
PulpUsername: options.GetString("PULP_USERNAME"),
PulpPassword: options.GetString("PULP_PASSWORD"),
PulpContentUsername: options.GetString("PULP_CONTENT_USERNAME"),
PulpContentPassword: options.GetString("PULP_CONTENT_PASSWORD"),
PulpIdentityName: options.GetString("PulpIdentityName"),
PulpProxyURL: options.GetString("PulpProxyURL"),
PulpOauth2URL: options.GetString("PulpOauth2URL"),
PulpOauth2ClientID: options.GetString("PulpOauth2ClientID"),
PulpOauth2ClientSecret: options.GetString("PulpOauth2ClientSecret"),
PulpS3BucketName: options.GetString("PulpS3BucketName"),
PulpS3Region: options.GetString("PulpS3Region"),
PulpS3SecretKey: options.GetString("PulpS3SecretKey"),
PulpS3AccessKey: options.GetString("PulpS3AccessKey"),
PulpS3BucketName: options.GetString("PULP_S3_BUCKETNAME"),
PulpS3Region: options.GetString("PULP_S3_REGION"),
PulpS3SecretKey: options.GetString("PULP_S3_SECRETKEY"),
PulpS3AccessKey: options.GetString("PULP_S3_ACCESSKEY"),
PulpGuardSubjectDN: options.GetString("PULP_GUARD_SUBJECT_DN"),
CleanupBatchSize: options.GetInt("CleanupBatchSize"),
}
if edgeConfig.TenantTranslatorHost != "" && edgeConfig.TenantTranslatorPort != "" {
Expand Down Expand Up @@ -512,6 +515,7 @@ func LogConfigAtStartup(cfg *EdgeConfig) {
"RepoFileUploadDelay": cfg.RepoFileUploadDelay,
"UploadWorkers": cfg.UploadWorkers,
"PulpURL": cfg.PulpURL,
"PulpGuardSubjectDN": cfg.PulpGuardSubjectDN,
}

// loop through the key/value pairs
Expand Down
98 changes: 98 additions & 0 deletions deploy/clowdapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,42 @@ objects:
name: glitchtip-dsn
stringData:
dsn: ${GLITCHTIP_DSN}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-password
stringData:
key: ${PULP_PASSWORD}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-content-password
stringData:
key: ${PULP_CONTENT_PASSWORD}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-test-s3
stringData:
region: ${PULP_S3_REGION}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-test-s3
stringData:
bucketname: ${PULP_S3_BUCKETNAME}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-test-s3
stringData:
accesskey: ${PULP_S3_ACCESSKEY}
- apiVersion: v1
kind: Secret
metadata:
name: edge-pulp-test-s3
stringData:
secretkey: ${PULP_S3_SECRETKEY}
- apiVersion: cloud.redhat.com/v1alpha1
kind: ClowdApp
metadata:
Expand Down Expand Up @@ -136,6 +172,44 @@ objects:
value: ${SUBSCRIPTION_BASE_URL}
- name : SUBSCRIPTION_SERVER_URL
value: ${SUBSCRIPTION_SERVER_URL}
- name : PULP_URL
value: ${PULP_URL}
- name : PULP_USERNAME
value: ${PULP_USERNAME}
- name : PULP_PASSWORD
valueFrom:
secretKeyRef:
name: edge-pulp-password
key: key
- name : PULP_CONTENT_USERNAME
value: ${PULP_CONTENT_USERNAME}
- name : PULP_CONTENT_PASSWORD
valueFrom:
secretKeyRef:
name: edge-pulp-content-password
key: key
- name : PULP_S3_REGION
valueFrom:
secretKeyRef:
name: edge-pulp-test-s3
key: region
- name : PULP_S3_BUCKETNAME
valueFrom:
secretKeyRef:
name: edge-pulp-test-s3
key: bucketname
- name : PULP_S3_ACCESSKEY
valueFrom:
secretKeyRef:
name: edge-pulp-test-s3
key: accesskey
- name : PULP_S3_SECRETKEY
valueFrom:
secretKeyRef:
name: edge-pulp-test-s3
key: secretkey
- name : PULP_GUARD_SUBJECT_DN
value: ${PULP_GUARD_SUBJECT_DN}
resources:
limits:
cpu: ${CPU_LIMIT_SERVICE}
Expand Down Expand Up @@ -502,3 +576,27 @@ parameters:
- name: FLOORIST_QUERY_PREFIX
description: Prefix for separating query data between prod and stage in the bucket
value: "hms_analytics/edge/unknown"
- name: PULP_URL
description: Pulp service URL
value: "http://pulp-service:8080"
- name: PULP_USERNAME
description: Username for Pulp API authentication
value: "pulp-user"
- name: PULP_PASSWORD
description: Password for Pulp API authentication
- name: PULP_CONTENT_USERNAME
description: Username for Pulp Content API authentication
value: "pulp-content-user"
- name: PULP_CONTENT_PASSWORD
description: Password for Pulp Content API authentication
- name: PULP_GUARD_SUBJECT_DN
description: Service account DN
value: "pulp/guard/subject/dn"
- name: PULP_S3_REGION
description: S3 region for Pulp backend store
- name: PULP_S3_BUCKETNAME
description: S3 bucket for Pulp backend store
- name: PULP_S3_ACCESSKEY
description: S3 accesskey for Pulp backend store
- name: PULP_S3_SECRETKEY
description: S3 secret key for Pulp backend store
19 changes: 10 additions & 9 deletions podman/env/edge-api_template.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ HTTP_PROXY=
HTTPS_PROXY=

# pulp
PULPURL=
PULPUSERNAME=
PULPPASSWORD=
PULPCONTENTUSERNAME=
PULPCONTENTPASSWORD=
PULPS3REGION=
PULPS3ACCESSKEY=
PULPS3SECRETKEY=
PULPS3BUCKETNAME=
PULP_URL=
PULP_USERNAME=
PULP_PASSWORD=
PULP_CONTENT_USERNAME=
PULP_CONTENT_PASSWORD=
PULP_S3_REGION=
PULP_S3_ACCESSKEY=
PULP_S3_SECRETKEY=
PULP_S3_BUCKETNAME=
PULP_GUARD_SUBJECT_DN=

# database
# for edge-api
Expand Down

0 comments on commit 824dcbe

Please sign in to comment.