This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Support multiple deployment backends #1130
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
846c0f8
Abstract out deployment
adam-stokes 5b65ab3
Merge branch 'master' into feat-deploy-backend
adam-stokes 5ff1a25
remove unused import
adam-stokes 4824b3c
remove unsetting of fleet server hostname as it's not needed
adam-stokes 2b1fd5d
add deployer support to stand-alone
adam-stokes 2e38d6a
add elastic-agent to k8s deployment specs
adam-stokes abf3f1a
Update internal/docker/docker.go
adam-stokes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: elastic-agent | ||
| labels: | ||
| app: elastic-agent | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: elastic-agent | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: elastic-agent | ||
| spec: | ||
| containers: | ||
| - name: elastic-agent | ||
| image: centos/systemd:latest | ||
| command: ["/usr/sbin/init"] | ||
| securityContext: | ||
| allowPrivilegeEscalation: true | ||
| runAsUser: 0 | ||
| capabilities: | ||
| add: ["SYS_ADMIN"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| bases: | ||
| - ../../base | ||
|
|
||
| resources: | ||
| - deployment.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| // or more contributor license agreements. Licensed under the Elastic License; | ||
| // you may not use this file except in compliance with the Elastic License. | ||
|
|
||
| package deploy | ||
|
|
||
| import ( | ||
| "strings" | ||
| ) | ||
|
|
||
| // Deployment interface for operations dealing with deployments of the bits | ||
| // required for testing | ||
| type Deployment interface { | ||
| Add(services []string, env map[string]string) error // adds a service to deployment | ||
| Bootstrap(waitCB func() error) error // will bootstrap or reuse existing cluster if kubernetes is selected | ||
| Destroy() error // Teardown deployment | ||
| ExecIn(service string, cmd []string) (string, error) // Execute arbitrary commands in service | ||
| Inspect(service string) (*ServiceManifest, error) // inspects service | ||
| Remove(services []string, env map[string]string) error // Removes services from deployment | ||
| } | ||
|
|
||
| // ServiceManifest information about a service in a deployment | ||
| type ServiceManifest struct { | ||
| ID string | ||
| Name string | ||
| Connection string // a string representing how to connect to service | ||
| Hostname string | ||
| } | ||
|
|
||
| // New creates a new deployment | ||
| func New(provider string) Deployment { | ||
| if strings.EqualFold(provider, "docker") { | ||
| return newDockerDeploy() | ||
| } | ||
| if strings.EqualFold(provider, "kubernetes") { | ||
| return newK8sDeploy() | ||
| } | ||
| return nil | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.