Deploy Lamp Stack on Kubernetes Cluster

I finished the task all I did is using envFrom instead of env
And it is failed -_- because of there are no vars, here is my code and screenshots:

kubectl create secret generic database --from-literal=MYSQL_ROOT_PASSWORD=253266fcis --from-literal=MYSQL_DATABASE=kodekloud --from-literal=MYSQL_USER=kareem --from-literal=MYSQL_PASSWORD=253266fcis --from-literal=MYSQL_HOST=mysql-service

apiVersion: v1
kind: ConfigMap
   metadata:
     creationTimestamp: null
     name: php-config
data:
  php.ini: |
     variables_order = "EGPCS"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: lamp-wp
  name: lamp-wp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: lamp-wp
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: lamp-wp
    spec:
      containers:
      - image: webdevops/php-apache:alpine-3-php7
        name: httpd-php-container
        resources: {}
        ports:
        - containerPort: 80
        envFrom:
        - secretRef:
           name: database
        volumeMounts:
        - name: php-ini
          mountPath: /opt/docker/etc/php/php.ini
          subPath: php.ini
      - image: mysql:5.6
        name: mysql-container
        envFrom:
        - secretRef:
           name: database
        ports:
        - containerPort: 3306
        resources: {}
      volumes:
      - name: php-ini
        configMap:
          name: php-config
status: {}


---
apiVersion: v1
kind: Service
metadata:
  name: mysql-service
spec:
  selector:
    app: lamp-wp
  ports:
    - protocol: TCP
      port: 3306
      targetPort: 3306
---
apiVersion: v1
kind: Service
metadata:
  name: lamp-service
spec:
  type: NodePort
  selector:
    app: lamp-wp
  ports:
    - port: 80
      targetPort: 80
  nodePort: 30008

<?PHP
$dbname = $_ENV["MYSQL_DATABASE"];
$dbuser = $_ENV["MYSQL_USER"];
$dbpass = $_ENV["MYSQL_PASSWORD"];
$dbhost = $_ENV["MYSQL_HOST"];

$connect = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");

$test_query = "SHOW TABLES FROM $dbname";
$result = mysqli_query($test_query);

if ($result->connect_error) {
   die("Connection failed: " . $conn->connect_error);
}
  echo "Connected successfully";


Where is their problem?

I have the same issue… hopefully they figure it out

1 Like

Hello Guys,

We apologise for the inconvenience. We are aware of this issue and working on to fix the same. It should be fixed soon and you will be assigned these tasks again.

1 Like

Got the same issue

Hi @MaheshJayaraj

This is marked successful for you.

Hi, same problem for me


Hi @Inderpreet
This task did not be assigned to me again :frowning:
Thanks

@dumitru.dinca

Marked successful for you.

@kareem.elkasaby1

You should get to work on this task at some point of time.

1 Like

what is the password for thor jump host sudo

@hardiku87

Please check the project wiki page for all details regarding servers and credentials.

@Inderpreet i have the same issue… i used the envFrom and the connection was successful but the task was marked failed. Could you please help review it. Thanks

@rahul456 @Inderpreet @mmumshad i have the same issue… i used the envFrom and the connection was successful but the task was marked failed. Could you please help review it. Thanks

Hi @Oyebimpe, please put your task under review

Hi @rahul456 thanks for your response, but theres no option to put it under review anymore. it has been marked failed since Oct 24. Can you help review it and mark it as completed? Thanks