Skip to content

Commit

Permalink
Merge pull request #523 from replicatedhq/issue/520
Browse files Browse the repository at this point in the history
Using an OCI compliant image registry instead of S3 for storage
  • Loading branch information
marccampbell committed May 13, 2020
2 parents 3ab6e9e + 00a14e6 commit c452f38
Show file tree
Hide file tree
Showing 43 changed files with 1,318 additions and 374 deletions.
2 changes: 1 addition & 1 deletion kotsadm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fmt:

.PHONY: vet
vet:
go vet ./pkg/... ./cmd/...
go vet -tags "$(BUILDTAGS)" ./pkg/... ./cmd/...

.PHONY: test
test: fmt vet
Expand Down
62 changes: 0 additions & 62 deletions kotsadm/api/src/controllers/troubleshoot/TroubleshootAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,6 @@ interface BundleUploadedBody {

@Controller("/api/v1/troubleshoot")
export class TroubleshootAPI {
@Put("/:appId/:supportBundleId")
public async bundleUpload(
@Res() response: Response,
@Req() request: Request,
@PathParams("appId") appId: string,
@PathParams("supportBundleId") supportBundleId: string,
): Promise<any> {
const bundleFile = request.app.locals.bundleFile;
let analyzedBundle;

try {
const stores = request.app.locals.stores;

const exists = await stores.troubleshootStore.supportBundleExists(supportBundleId);
if (exists) {
response.send(403);
return;
}

// upload it to s3
const params = await Params.getParams();
const buffer = fs.readFileSync(bundleFile);
await putObject(params, path.join(params.shipOutputBucket.trim(), "supportbundles", supportBundleId, "supportbundle.tar.gz"), buffer, params.shipOutputBucket);
const fileInfo = await stores.troubleshootStore.getSupportBundleFileInfo(supportBundleId);

logger.debug({ msg: `creating support bundle record with id ${supportBundleId} via upload callback` });

await stores.troubleshootStore.createSupportBundle(appId, fileInfo.ContentLength, supportBundleId);

const analyzers = await stores.troubleshootStore.tryGetAnalyzersForKotsApp(appId);
await performAnalysis(supportBundleId, analyzers, stores);

analyzedBundle = await stores.troubleshootStore.getSupportBundle(supportBundleId);
} finally {
fs.unlinkSync(bundleFile);
response.send(200, analyzedBundle);
}
}

@Post("/analyzebundle/:supportBundleId")
public async analyzeBundle(
Expand Down Expand Up @@ -108,30 +70,6 @@ export class TroubleshootAPI {
response.send(204, "");
}

@Get(`/supportbundle/:bundleId/download`)
async downloadSupportBundle(
@Req() request: Request,
@Res() response: Response,
@PathParams("bundleId") bundleId: string,
@QueryParams("token") token: string,
): Promise<any | ErrorResponse> {
const session: Session = await request.app.locals.stores.sessionStore.decode(token);
if (!session || !session.userId) {
response.status(401);
return {};
}

const supportBundle = await request.app.locals.stores.troubleshootStore.getSupportBundle(bundleId);

if (!supportBundle) {
response.status(404);
return {};
}

response.setHeader("Content-Disposition", `attachment; filename=supportbundle.tar.gz`);
response.setHeader("Content-Type", "application/tar+gzip");
await s3getBundle(bundleId, response);
}
}

async function performAnalysis(supportBundleId: string, analyzers: string, stores: Stores) {
Expand Down
22 changes: 0 additions & 22 deletions kotsadm/api/src/kots_app/resolvers/kots_app_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,6 @@ export function KotsQueries(stores: Stores, params: Params) {
return details;
},

// TODO: This code is currently duplicated between kots apps and wathes.
// It should be refactored so that you can get a file tree/download files
// by a id/sequence number regardless of the app type.
async getKotsApplicationTree(root: any, args: any, context: Context): Promise<string> {
const appId = await stores.kotsAppStore.getIdFromSlug(args.slug);
const app = await context.getApp(appId);
const tree = await app.generateFileTreeIndex(args.sequence);
if (_.isEmpty(tree) || !tree[0].children) {
throw new ReplicatedError(`Unable to get files for app with ID of ${app.id}`);
}
return JSON.stringify(tree);
},

async getKotsFiles(root: any, args: any, context: Context): Promise<string> {
const appId = await stores.kotsAppStore.getIdFromSlug(args.slug);
const app = await context.getApp(appId);
const jsonFiles: string = await app.getFilesJSON(args.sequence, args.fileNames);
if (jsonFiles.length >= 5000000) {
throw new ReplicatedError(`File is too large, the maximum allowed length is 5000000 but found ${jsonFiles.length}`);
}
return jsonFiles;
},

async getAppConfigGroups(root: any, args: any, context: Context): Promise<KotsConfigGroup[]> {
const appId = await stores.kotsAppStore.getIdFromSlug(args.slug);
Expand Down
2 changes: 0 additions & 2 deletions kotsadm/api/src/schema/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export const Query = `
getFiles(slug: String!, sequence: Int!, fileNames: [String!]): String
getKotsApplicationTree(slug: String!, sequence: Int!): String
getKotsFiles(slug: String!, sequence: Int!, fileNames: [String!]): String
getAppConfigGroups(slug: String!, sequence: Int!): [KotsConfigGroup]
getKotsDownstreamOutput(appSlug: String!, clusterSlug: String!, sequence: Int!): KotsDownstreamOutput
templateConfigGroups(slug: String!, sequence: Int!, configGroups: [KotsConfigGroupInput]!): [KotsConfigGroup]
Expand Down
6 changes: 5 additions & 1 deletion kotsadm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ require (
github.com/Microsoft/hcsshim v0.8.8-0.20200225064221-b400e4ffeccc // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/aws/aws-sdk-go v1.25.18
github.com/containerd/containerd v1.3.2
github.com/deislabs/oras v0.8.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/docker/docker v1.13.1 // indirect
github.com/docker/go-units v0.4.0
Expand All @@ -25,9 +27,11 @@ require (
github.com/marccampbell/yaml-toolbox v0.0.0-20200328202846-85b6f7184a20
github.com/mholt/archiver v3.1.1+incompatible
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/opencontainers/image-spec v1.0.1
github.com/pierrec/lz4 v2.4.1+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/replicatedhq/kots v1.15.3-0.20200508174743-846a053fa0d2
github.com/replicatedhq/kots v1.15.3-0.20200512202738-aaa332813ead
github.com/replicatedhq/kotsadm v1.15.0-beta.2
github.com/replicatedhq/troubleshoot v0.9.31
github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq
github.com/segmentio/ksuid v1.0.2
Expand Down
32 changes: 32 additions & 0 deletions kotsadm/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ github.com/containerd/console v0.0.0-20170925154832-84eeaae905fa/go.mod h1:Tj/on
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/containerd v1.0.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2 h1:ForxmXkA6tPIvffbrDAcPUIB32QgXkt2XFj+F0UxetA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY=
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c h1:8ahmSVELW1wghbjerVAyuEYD5+Dio66RYvSS0iGfL1M=
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
Expand Down Expand Up @@ -186,11 +188,14 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE=
github.com/deislabs/oras v0.8.1 h1:If674KraJVpujYR00rzdi0QAmW4BxzMJPVAZJKuhQ0c=
github.com/deislabs/oras v0.8.1/go.mod h1:Mx0rMSbBNaNfY9hjpccEnxkOqJL6KGjtxNHPLC4G4As=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20170817175659-5f6282db7d65 h1:4zlOyrJUbYnrvlzChJ+jP2J3i77Jbhm336NEuCv7kZo=
github.com/docker/distribution v0.0.0-20170817175659-5f6282db7d65/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20180522102801-da99009bbb11 h1:p8hSDXZgVhyh/C9bPlG8QMY64VeXtVfjmjIlzaQok5Q=
Expand Down Expand Up @@ -634,6 +639,7 @@ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
Expand Down Expand Up @@ -683,6 +689,7 @@ github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQ
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc9 h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU4LguQVtc=
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
Expand Down Expand Up @@ -752,12 +759,35 @@ github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be h1:ta7tUOvsPHVHGom5hKW5VXNc2xZIkfCKP8iaqOyYtUQ=
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be/go.mod h1:MIDFMn7db1kT65GmV94GzpX9Qdi7N/pQlwb+AN8wh+Q=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/replicatedhq/kots v1.15.0-beta.2/go.mod h1:8mbam1nJv/DzA7809Tx0kEL4IBhIYqtzACMsM+eKIOw=
github.com/replicatedhq/kots v1.15.0-beta.3/go.mod h1:eJSwT3usYAPwEYmJZuJtt2XKWsk9UdinPElWSc7eoAg=
github.com/replicatedhq/kots v1.15.0-beta.4/go.mod h1:eJSwT3usYAPwEYmJZuJtt2XKWsk9UdinPElWSc7eoAg=
github.com/replicatedhq/kots v1.15.0-beta.5/go.mod h1:eJSwT3usYAPwEYmJZuJtt2XKWsk9UdinPElWSc7eoAg=
github.com/replicatedhq/kots v1.15.0/go.mod h1:8mbam1nJv/DzA7809Tx0kEL4IBhIYqtzACMsM+eKIOw=
github.com/replicatedhq/kots v1.15.1/go.mod h1:8mbam1nJv/DzA7809Tx0kEL4IBhIYqtzACMsM+eKIOw=
github.com/replicatedhq/kots v1.15.2/go.mod h1:8mbam1nJv/DzA7809Tx0kEL4IBhIYqtzACMsM+eKIOw=
github.com/replicatedhq/kots v1.15.3-0.20200508174743-846a053fa0d2 h1:BuRsOAtWupuYasdwxkY0jVoVNDThqO46MxcJ6T0UXuc=
github.com/replicatedhq/kots v1.15.3-0.20200508174743-846a053fa0d2/go.mod h1:75+q98hCN7KFP/wnsZes5762UZ6tR3Up+EAdbAck7RU=
github.com/replicatedhq/kots v1.15.3-0.20200512202738-aaa332813ead h1:SFN9yjLLjKEnp/f5ipIKBaULjYXd7oT2HH5DZNNaFgY=
github.com/replicatedhq/kots v1.15.3-0.20200512202738-aaa332813ead/go.mod h1:75+q98hCN7KFP/wnsZes5762UZ6tR3Up+EAdbAck7RU=
github.com/replicatedhq/kots v1.15.3 h1:E9QdndpInUq+y12F2Ux3hBUim2WvmfXqeJKbV4zODYs=
github.com/replicatedhq/kots v1.15.3/go.mod h1:8mbam1nJv/DzA7809Tx0kEL4IBhIYqtzACMsM+eKIOw=
github.com/replicatedhq/kotsadm v1.15.0-beta.2 h1:uXdr0p9vjwz3NKDhyRYgl07vC5ztHnwurx2FsiOiaBI=
github.com/replicatedhq/kotsadm v1.15.0-beta.2/go.mod h1:+eCMVGxRvj3AbnBMwy46LkS10OhTdEk0N1DlIuWpR20=
github.com/replicatedhq/kotsadm v1.15.0-beta.3/go.mod h1:2ojECILxv826Imofl8inT+b+8B5JGv7p4SUsku8GOck=
github.com/replicatedhq/kotsadm v1.15.0-beta.4/go.mod h1:ij6WVQfVNTgGxM8lp0njOaIu6txKIgw2Z39WEMCJFLc=
github.com/replicatedhq/kotsadm v1.15.0-beta.5/go.mod h1:cqiTjMz5GuNUGe2mA5Y63CMl6ueSfdy1kjhsiS6/+hQ=
github.com/replicatedhq/kotsadm v1.15.0/go.mod h1:VHKWHu7vZNZGIQel/AvIUmw2g/Pa2/Azcwo+ecqzfcA=
github.com/replicatedhq/kotsadm v1.15.1/go.mod h1:bc8AIyl8j6399RiX1bmq05vrUAnTJlTldTa+9sRG22U=
github.com/replicatedhq/kotsadm v1.15.2/go.mod h1:nz4VT3LAfROEaiTrDfFsMloEC/wdlwRcWAoy7djKXNQ=
github.com/replicatedhq/kotsadm v1.15.3 h1:zI/iha8TIAlDmp2o+G61Segl/rUD/5xfVgSVUzFqKOA=
github.com/replicatedhq/kotsadm v1.15.3/go.mod h1:/daSSECVmRR2fgZkTf7Oen46HGh6J0SwWAqBgpoy3hk=
github.com/replicatedhq/kotsadm/operator v0.0.0-20200501000547-b1b5fb425e17/go.mod h1:6GfvQbCeR02BhpcEcaPTN2J62FA3dnzxRQviEdakB/0=
github.com/replicatedhq/kurl/kurlkinds v0.0.0-20200306230415-b6d377a48a56 h1:W4lzQxpdUPFVTjs6zCDFGyAbPfow28zbFU65QCQf+SY=
github.com/replicatedhq/kurl/kurlkinds v0.0.0-20200306230415-b6d377a48a56/go.mod h1:Vp5X4tM0KmahplYOvdRqs2NY2qy1amZ89zZBm9CDENw=
github.com/replicatedhq/troubleshoot v0.9.27 h1:51ouEai9xSp7E9+Jbd+Oz1wxu5jFJbXSvLr3Vq6ivTk=
github.com/replicatedhq/troubleshoot v0.9.27/go.mod h1:g9GiMrUk+s9j2PbbaJ4vav8yAakCPg4c9GBSdVtUxyk=
github.com/replicatedhq/troubleshoot v0.9.30/go.mod h1:YLrtvTJxqlvaqR/EsnfJ4IGNG2aWqV3yPSQ3WWEA/cU=
github.com/replicatedhq/troubleshoot v0.9.31 h1:qFKR4J5vI0rvreVrpfE69tK7dlKADZ1L2YW/+FHm1io=
github.com/replicatedhq/troubleshoot v0.9.31/go.mod h1:YLrtvTJxqlvaqR/EsnfJ4IGNG2aWqV3yPSQ3WWEA/cU=
github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq h1:PwPggruelq2336c1Ayg5STFqgbn/QB1tWLQwrVlU7ZQ=
Expand Down Expand Up @@ -988,6 +1018,7 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1188,6 +1219,7 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
Expand Down
4 changes: 4 additions & 0 deletions kotsadm/kustomize/overlays/dev/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ spec:
value: http://replicated-app:3000
- name: API_ADVERTISE_ENDPOINT
value: http://127.0.0.1:30065
# - name: STORAGE_BASEURI
# value: "docker://kotsadm-storage-registry:5000"
# - name: STORAGE_BASEURI_PLAINHTTP
# value: "true"
116 changes: 116 additions & 0 deletions kotsadm/kustomize/overlays/dev/distribution/distribution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kotsadm-storage-registry-config
labels:
app: docker-registry
release: kots
data:
config.yml: |-
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
http:
addr: :5000
headers:
X-Content-Type-Options:
- nosniff
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
version: 0.1
---
apiVersion: v1
kind: Service
metadata:
name: kotsadm-storage-registry
labels:
app: docker-registry
release: kots
spec:
type: ClusterIP
ports:
- port: 5000
protocol: TCP
name: registry
targetPort: 5000
selector:
app: docker-registry
release: kots
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kotsadm-storage-registry
labels:
app: docker-registry
release: kots
spec:
selector:
matchLabels:
app: docker-registry
release: kots
replicas: 1
serviceName: kotsadm-storage-registry
template:
metadata:
labels:
app: docker-registry
release: kots
annotations:
checksum/config: 149b8559e0123ecd57d5a161f88b51b44d7194aefb604f36e44dba2514952398
spec:
securityContext:
fsGroup: 1000
runAsUser: 1000
containers:
- name: docker-registry
image: "registry:2.7.1"
imagePullPolicy: IfNotPresent
command:
- /bin/registry
- serve
- /etc/docker/registry/config.yml
ports:
- containerPort: 5000
livenessProbe:
httpGet:
path: /
port: 5000
readinessProbe:
httpGet:
path: /
port: 5000
resources:
{}
env:
- name: REGISTRY_HTTP_SECRET
value: "password"
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: "/var/lib/registry"
volumeMounts:
- name: registry-data
mountPath: /var/lib/registry/
- name: "kotsadm-storage-registry-config"
mountPath: "/etc/docker/registry"
volumes:
- name: registry-data
persistentVolumeClaim:
claimName: registry-data
- name: kotsadm-storage-registry-config
configMap:
name: kotsadm-storage-registry-config
volumeClaimTemplates:
- metadata:
name: registry-data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 5Gi
2 changes: 1 addition & 1 deletion kotsadm/kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ bases:

resources:
- ./nodeport.yaml

- ./distribution/distribution.yaml
patches:
- ./deployment.yaml
4 changes: 2 additions & 2 deletions kotsadm/pkg/airgap/airgap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"time"

"github.com/pkg/errors"
kotsv1beta1 "github.com/replicatedhq/kots/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kots/pkg/pull"
"github.com/replicatedhq/kots/kotsadm/pkg/app"
"github.com/replicatedhq/kots/kotsadm/pkg/logger"
"github.com/replicatedhq/kots/kotsadm/pkg/persistence"
"github.com/replicatedhq/kots/kotsadm/pkg/registry"
"github.com/replicatedhq/kots/kotsadm/pkg/task"
"github.com/replicatedhq/kots/kotsadm/pkg/version"
kotsv1beta1 "github.com/replicatedhq/kots/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kots/pkg/pull"
"k8s.io/client-go/kubernetes/scheme"
)

Expand Down

0 comments on commit c452f38

Please sign in to comment.