-
Notifications
You must be signed in to change notification settings - Fork 765
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to generate .bicep file from a Kubernetes manifest (#7812)
* Add ability to generate .bicep file from a Kubernetes manifest * Add error handling * Fix up build error * Fix yaml deserialization hack
- Loading branch information
1 parent
2b41fcf
commit 36a97df
Showing
29 changed files
with
1,460 additions
and
141 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
142 changes: 142 additions & 0 deletions
142
...ntegrationTests/Files/ImportKubernetesManifest/azure-vote-all-in-one-redis/manifest.bicep
This file contains 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,142 @@ | ||
@secure() | ||
param kubeConfig string | ||
|
||
import kubernetes as k8s { | ||
namespace: 'default' | ||
kubeConfig: kubeConfig | ||
} | ||
|
||
resource appsDeployment_azureVoteBack 'apps/Deployment@v1' = { | ||
metadata: { | ||
name: 'azure-vote-back' | ||
} | ||
spec: { | ||
replicas: 1 | ||
selector: { | ||
matchLabels: { | ||
app: 'azure-vote-back' | ||
} | ||
} | ||
template: { | ||
metadata: { | ||
labels: { | ||
app: 'azure-vote-back' | ||
} | ||
} | ||
spec: { | ||
nodeSelector: { | ||
'beta.kubernetes.io/os': 'linux' | ||
} | ||
containers: [ | ||
{ | ||
name: 'azure-vote-back' | ||
image: 'mcr.microsoft.com/oss/bitnami/redis:6.0.8' | ||
env: [ | ||
{ | ||
name: 'ALLOW_EMPTY_PASSWORD' | ||
value: 'yes' | ||
} | ||
] | ||
ports: [ | ||
{ | ||
containerPort: 6379 | ||
name: 'redis' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource coreService_azureVoteBack 'core/Service@v1' = { | ||
metadata: { | ||
name: 'azure-vote-back' | ||
} | ||
spec: { | ||
ports: [ | ||
{ | ||
port: 6379 | ||
} | ||
] | ||
selector: { | ||
app: 'azure-vote-back' | ||
} | ||
} | ||
} | ||
|
||
resource appsDeployment_azureVoteFront 'apps/Deployment@v1' = { | ||
metadata: { | ||
name: 'azure-vote-front' | ||
} | ||
spec: { | ||
replicas: 1 | ||
selector: { | ||
matchLabels: { | ||
app: 'azure-vote-front' | ||
} | ||
} | ||
strategy: { | ||
rollingUpdate: { | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
} | ||
} | ||
minReadySeconds: 5 | ||
template: { | ||
metadata: { | ||
labels: { | ||
app: 'azure-vote-front' | ||
} | ||
} | ||
spec: { | ||
nodeSelector: { | ||
'beta.kubernetes.io/os': 'linux' | ||
} | ||
containers: [ | ||
{ | ||
name: 'azure-vote-front' | ||
image: 'mcr.microsoft.com/azuredocs/azure-vote-front:v1' | ||
ports: [ | ||
{ | ||
containerPort: 80 | ||
} | ||
] | ||
resources: { | ||
requests: { | ||
cpu: '250m' | ||
} | ||
limits: { | ||
cpu: '500m' | ||
} | ||
} | ||
env: [ | ||
{ | ||
name: 'REDIS' | ||
value: 'azure-vote-back' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource coreService_azureVoteFront 'core/Service@v1' = { | ||
metadata: { | ||
name: 'azure-vote-front' | ||
} | ||
spec: { | ||
type: 'LoadBalancer' | ||
ports: [ | ||
{ | ||
port: 80 | ||
} | ||
] | ||
selector: { | ||
app: 'azure-vote-front' | ||
} | ||
} | ||
} |
Oops, something went wrong.